Maybe you are reading the logical value of the keyboard matrix i/o port instead of reading the phisical value.
On ATMEL AVR microcontroller, to read the logical value of port b for example you use:
in r16,PORTB
To read the actual phisical value of port b you will use:
in r16,PINB
So, in your matrix keyboard you need to read the physical value (the real value), not the logical value from the port.
|