Good day.
My final year project involves using a PIC16F876A to check the statuses of 44 switches which are connected in a matrix. (see attached picture)
The program is similar to interfacing a keypad to a PIC. The columns (top) are configured as outputs, while the rows (side) are configured as input. When the switch is not depressed, the PIC reads a logic high on that switch location (row,column). When it is depressed, the PIC reads a low.
Here's my problem:
With 1 switch depressed, the PIC successfully reads the switch status correctly which is logic low. When I measured the voltage when that particular switch was scanned, it was in the millivolts range.
With more than 1, or all, of the switches in the same column depressed, the PIC still successfully reads the switch status correctly.
A problem arises when more than 2 switches in the same row are depressed, the PIC reads logic high instead of logic low. When I checked the voltage level, I measured 2 volts!
It seems that the PIC gave an output of 2 volts (which is supposed to be 0) to the columns (output) and it reads the 2 volts on the rows (input).
Can anyone help me? For normal operation, the switches are depressed, so the PIC should read logic low on all the switches.
Do I need a buffer/driver for the output of the PIC?
Thanks
My final year project involves using a PIC16F876A to check the statuses of 44 switches which are connected in a matrix. (see attached picture)
The program is similar to interfacing a keypad to a PIC. The columns (top) are configured as outputs, while the rows (side) are configured as input. When the switch is not depressed, the PIC reads a logic high on that switch location (row,column). When it is depressed, the PIC reads a low.
Here's my problem:
With 1 switch depressed, the PIC successfully reads the switch status correctly which is logic low. When I measured the voltage when that particular switch was scanned, it was in the millivolts range.
With more than 1, or all, of the switches in the same column depressed, the PIC still successfully reads the switch status correctly.
A problem arises when more than 2 switches in the same row are depressed, the PIC reads logic high instead of logic low. When I checked the voltage level, I measured 2 volts!
It seems that the PIC gave an output of 2 volts (which is supposed to be 0) to the columns (output) and it reads the 2 volts on the rows (input).
Can anyone help me? For normal operation, the switches are depressed, so the PIC should read logic low on all the switches.
Do I need a buffer/driver for the output of the PIC?
Thanks