Thanks for the drawing, that is how this is connected, yes I am aware of "scanning the keypads" Bruce has been a great help, but I am just narrowing it down to pressing on button, pins 1-3 low, and pin 0 high just to see how interrupt's work. I am looking to use the interrupt to sleep all the time, detect when key is pressed, wake up, set PORTB.0, and 4-7 as inputs, bits 1-3 as out, pause about 50, then began scanning keypad something like this:
recycle:
@ Sleep
@ NOP
@ NOP
goto recycle
' my Interrupt handler
search:
PORTB = 0
TRISB = $f1
PAUSEUS 10
keypadscan:
FOR row = 1 TO 3
PORTB = 0
TRISB = (DCD row) ^ $fe
col = PORTB >> 4
IF col != $f THEN keypressed
NEXT row
GOTO recycle
Haven't got all this worked out yet, but thats another day
Bookmarks