I haven't learnt the coding part of keypad integration in 8051 yet, but I'm aware of the working and theory behind the integration. I'd really appreciate it if someone explains the readKey subroutine in the attached file. Thanks in advance.
'readKey' is a subroutine that reads a keyboard.
The type of keyboard is unspecified, with no program comments and no schematic to give clues to its operation.
More information is needed.
'readKey' is a subroutine that reads a keyboard.
The type of keyboard is unspecified, with no program comments and no schematic to give clues to its operation.
More information is needed.
I think I understand how the subroutine works now. K1 checks for key is released from previous input and moves on to K2 if the key is released. K2 detects key input by checking if any of the columns are Low and moves on to the next loop OVER, which checks for any debounce. If there is a Low value in any of the column after the 20ms time delay, it moves on to the next loop and hence signifies that there is no debounce or else moves back to K2 to detect an input again. The OVER1 loop identifies the row by grounding each row one after the other and checking for a low output in the columns. After finding the row, finding the column is as easy as checking if the Carry Bit is low for any of the row buttons. I may be wrong, and if I am please correct me.