![]() ![]() Movlw b'00010100' switch on porta4/serial input on 2īsf LED turn on boot light for a secondĬlrf pattern clear the "pressed button" pattern, and Movlw b'11000000' B pullups off/rising edge/TMR0 internal/TMR0 low to high #define SWITCH PORTA,4 an extra pushbutton (not used for anything) ![]() #define LED PORTA,3 just a power-up indicator #include processor specific variable definitions list p=16F84 list directive to define processor My sequence seems to follow the timing diagram in the datasheet, but I'm obviously screwing something up. Everything else lands in the correct spot on the lights, and I've tried a whole slew of edits, changing the order of the latch and clock events, and adding NOPs to give it a chance to think. The issue I'm having is that somehow bit0, which should be the first one shifted out, is always a zero. It just dumps the contents of that variable to portb, bit for bit. Can anybody spot what I'm doing wrong in this shift register code? "Pattern" (ideally) holds the current state of the eight buttons. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |