BIT4 is a 4Bit microcontroller – fully programmable with only three buttons.
BIT4 is a 4Bit microcontroller – fully programmable with only three buttons.
The BIT4 microcontroller has 256 Bytes of programm memory, split in 16 pages with each 16 instructions. A instruction is 8bit wide and consists of an command and data:
To enter the programming mode, hold BTN2 down, press the RESET button once and then release BTN2. In programming mode, step through the instructions with BTN2. When going to a new instruction, the leds will show the current address for a fraktion of a second. With BTN1 the value of the command and data of the current instruction can be changed. When stepping to a new address with BTN2, the instuction of the address above gets saved in the EEPROM. At the end, press RESET to leave the programming mode and to start the programm execution.
all design files are available on github.com
Hello, thanks a lot for sharing the project. I have some questions,
Do you use a different array for program and memory, like a Harvard architecture? Or you just use a memory array for data and instructions? It seems based on the readme, that you deal with bytes and separate them in nibbles to work with later. Did you write everything by yourself? Or did you use some libraries?
Just to finish, I was thinking if it is difficult to extend TPS, or BIT4, to make things with relays, like a PLC, but instead of programming it with Ladder, programming it with the three buttons. That would be very nice, maybe it is already done, but for people like you with knowledge maybe it is not that difficult. You could control garage doors, etc.
Thank you very much for your attention.
where can I get it?
It would be better with 512 bytes
NOP,RTS JMP,JSR,JEQ,JNE xXX SHL,ASR,LSR,NEG,ROR,ROL,DA,COM,TST BNK b
BCLR,BSET,BTST,BTG n LD,CMP,ADD,ADC #X OR,AND,ADD,ADC,SUB,SBB,LD,ST,CMP A,X
512×12 :
NOP,RTI,RTS LD,ST A1,A0+ LPM bnk,A+,xX JMP xXX JSR XX SKBC,SKBS n,xX
SHL,ASR,LSR,ROL,ROR,PUSH,PULL Ai INC,DEC,DA,COM,DSZ,SKZ,SNZ xX BCLR,BSET n,xX
LD,CMP,TST,OR,AND,XOR,ADD,ADC,SUB,SBB Ai,#X Ai,xX ST,SWP Ai,xX
2Kx12 rom
128×4 ram
NOP,RTS JSR xXX TJZ,TJNZ R,#X,XXX xX,XXX OR,AND CC,#X
SHL,ASR,LSR,ROR,ROL,DAA INC,DEC,COM,ADC xX LD,ST R,xX LDA #X
SWAP,TST A,xX OR,AND,XOR,ADD,ADC,SUB,SBB,CMP A,#X A,xX
NOP,RTS,PWD,SHL,ASR,LSR,NEG,ROL,ROR,DA,COM,TST JMP,JSR,JEQ,JNE,JCC,JCS xXX MOV,OR,AND,TST X,X
BNK n BCLR,BSET,BTST,BTG n LD,CMP,ADD,ADC #X OR,AND,ADD,ADC,SUB,SBB,LD,ST,CMP A,X