- Sun Mar 13, 2011 4:04 pm
#122665
I want to interface a 4 X 4 matrix keypad from Grayhill to an Arduino. My idea it to interface the keypad to a PCF8574 I/O expander. The keys are arranged:
1 2 3 A
4 5 6 B
7 8 9 C
* 0 # D
The keypad brings the matrix out on an 8 pin SIP with 4 pins for the rows and
4 for the columns. I plan to connect the pins in this order on the 8574.:
Row0 - P0 Row1 - P1 Row2 - P2 Row3 - P3
Col0 - P4 Col1 - P5 Col2 - P6 Col3 - P7
Do I need to connect pull-ups for all row/col lines?
I will read the 8574 data into a byte variable which will give me the key-press data with the high nibble being the column data and the low nibble being the row data. Pressing the 1 key should then return 0001|0001 and a 2 would return 0010|0001 and a D would return 1000|1000 if I am thinking correctly. How do I extract the row number and the column number from the byte?
Also, the 8574 has an interrupt that notifies when any change occurs on any pin. Should I consider using that feature to notify the application when there is a key-press?
1 2 3 A
4 5 6 B
7 8 9 C
* 0 # D
The keypad brings the matrix out on an 8 pin SIP with 4 pins for the rows and
4 for the columns. I plan to connect the pins in this order on the 8574.:
Row0 - P0 Row1 - P1 Row2 - P2 Row3 - P3
Col0 - P4 Col1 - P5 Col2 - P6 Col3 - P7
Do I need to connect pull-ups for all row/col lines?
I will read the 8574 data into a byte variable which will give me the key-press data with the high nibble being the column data and the low nibble being the row data. Pressing the 1 key should then return 0001|0001 and a 2 would return 0010|0001 and a D would return 1000|1000 if I am thinking correctly. How do I extract the row number and the column number from the byte?
Also, the 8574 has an interrupt that notifies when any change occurs on any pin. Should I consider using that feature to notify the application when there is a key-press?
Victor Fraenckel
windswaytoo ATSIGN gmail DOT com
KC2GUI
windswaytoo ATSIGN gmail DOT com
KC2GUI