Many microcontrollers have different locations for accesing the inputs and outputs. For example on ATMEL AVR microcontroler to read or write the logical values to port B you use PORTB. To read the actual phisical value of port B you will need to use PINB. Example: "in r16,PINB" will read the physical bits of port B. This is what you need to use to read the keyboard matrix.
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.
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.