Hello, can someone please help me to get my code working properly. It scans a 3x4 keypad, when a key is pressed the value is stored in a register. 4 keys are to be stored this way. The first key value is stored ok. When the program scans the second key, it stops on the last key that was pressed. It appears that the internal pull up resistor is latched low therefore holding the first key press and jumping to the second store register,storing the value of the first key press.
Problem 2. I want the PIC to go in to sleep mode and start scanning when a key is pressed. I got it to work but when i pressed a key the program started scanning but didnt find the first key to be pressed. ie i would have to press a key twice to get 1 number, once to wake up from sleep and once to scan a key. How can i do this so that the wakes up and with the same key press stores the value.
I have the rows on portB <4-7> because of interrupt on change to wake up from SLEEP. Columns on portA because i want to use RB0 interrupt and RB2 TX , If i ever get that far. . I guess thats all a bit confusing, please see attached code and jpg. Thanks in advace.
Problem 2. I want the PIC to go in to sleep mode and start scanning when a key is pressed. I got it to work but when i pressed a key the program started scanning but didnt find the first key to be pressed. ie i would have to press a key twice to get 1 number, once to wake up from sleep and once to scan a key. How can i do this so that the wakes up and with the same key press stores the value.
I have the rows on portB <4-7> because of interrupt on change to wake up from SLEEP. Columns on portA because i want to use RB0 interrupt and RB2 TX , If i ever get that far. . I guess thats all a bit confusing, please see attached code and jpg. Thanks in advace.