How to: Wire 4x4 Keypad to work with PCF8574A I/O expander chip?
SteveWoodrough
Posts: 190
I am trying to duplicate the setup given in this link, using a standard 4x4 key pad (same as sold by Parallax), and the PCF8574AN I/O expander chip.
http://www.instructables.com/id/CHIP-8-and-the-Pocket-Mini-Computer/step5/DIY-4X4-Keypad-Required-Parts/
For software I am using the driver: http://obex.parallax.com/objects/search/?q=pcf8574&csrfmiddlewaretoken=9f407a2d35db5b615c53fd64f0384712
The good news is that the chip and the driver, Craig Webers PCF8574 Driver Test.spin, v1.0, work just fine. By that I mean I ground any input to the PCF8574 chip, I get a corresponding result on the PST.
The question I have is exactly how to wire the 4x4 keypad? In the example shown in the link above, the keypad is wired directly to the I/O expander one for one. Each keypad pin out is assigned to an input on the I/O expander. This is not working, and that result makes sense since there is nothing driving the input to the I/O expander low. With the keypad connected to the I/O expander, each keypad press simply connects one input with another.
There is some simple bit of engineering Im missing.
Thank YOU
Steve
http://www.instructables.com/id/CHIP-8-and-the-Pocket-Mini-Computer/step5/DIY-4X4-Keypad-Required-Parts/
For software I am using the driver: http://obex.parallax.com/objects/search/?q=pcf8574&csrfmiddlewaretoken=9f407a2d35db5b615c53fd64f0384712
The good news is that the chip and the driver, Craig Webers PCF8574 Driver Test.spin, v1.0, work just fine. By that I mean I ground any input to the PCF8574 chip, I get a corresponding result on the PST.
The question I have is exactly how to wire the 4x4 keypad? In the example shown in the link above, the keypad is wired directly to the I/O expander one for one. Each keypad pin out is assigned to an input on the I/O expander. This is not working, and that result makes sense since there is nothing driving the input to the I/O expander low. With the keypad connected to the I/O expander, each keypad press simply connects one input with another.
There is some simple bit of engineering Im missing.
Thank YOU
Steve
Comments
Is this the circuit you are replicating?
http://www.instructables.com/id/CHIP-8-and-the-Pocket-Mini-Computer/step11/The-PCF8574A-I2C-Circuit/
Do you have a PFC8574 chip or a PFC8574A chip? I discovered a difference in the address $38/$20 that made all the difference when I did that project. I also discovered that Taiwanese vendors don't always know the difference.
Jeff
http://forums.parallax.com/showthread.php/144862-My-First-ExpressPCB-order...-help-review-please!
THANK YOU for the response. I am using an PCF8574AN chip from DigiKey. The address I am using is 56 (same as 38 in Hex, all address lines pulled low) . Using the standard OBEX 8574 driver and test program the chip works. If I was going to simply monitor 8 switches going to ground, life would be easy. Iith the above object I get a binary result with each pin I ground. If I ground P0 I get 01111111. If I ground P3 the result is 11101111. The part I cannot figure out is how to ground a pin when the membrane keypad is not connected to a ground. If I use the setup shown, all I am doing is connecting one I/O expander input pin to another each time I press a switch.
STOP! I think I see the problem. I'm using the PCF8574 object and that is WAY different than your object to read the 4x4 keypad. Let me play with that a while and I'll post a result one way or the other.
Thank You!!!
Steve
Will any old PNP's work? What size resistors? 10K?
Thank you
Steve
Paul
I've improved the design some, with ground plane and another shorter board to fit the Propeller Platform standard. I haven't done much with it since the holidays. Perhaps I should finish.
The revision that I submitted works flawlessly, however.
THANK YOU!!!
Steve
BTW- the credit really should go to Beau Schwabe. He came up with the idea for the transistors. My original design used optoisolators!@!
http://forums.parallax.com/showthread.php/143382-4x4-Keypad-Decoder-the-Hard-Way
No, I did not. Thank you for redirecting me there. Keypad mapping was to be tomorrow's project!
I looked at your original post earlier while researching my problem, but it seemed to the inexperienced gearhead (me) that you were going around about things in a difficult manner.
Your post with the pcb and circuit never came up when I searched "keypad" or "8574" so I could not associate your solution to your original work.
Excellent work, thank you for sharing.
Steve
I have one more bare board I can send you. Jeff (OBC) stocks the chip and other parts you need to build it. It builds easily. The hardest part is trimming the header pieces neatly.
PM me your address and I'll send you my other bare board at no charge.