Shop OBEX P1 Docs P2 Docs Learn Events
Keypad — Parallax Forums

Keypad

computer guycomputer guy Posts: 1,113
edited 2010-06-30 17:36 in Propeller 1
Hello everyone,

I have a keypad that I need to connect to my propeller chip, each button has it's own pin (0v - released, 3.3v pushed).
It is using up too many pins, is there a way that I can minimise the amount of pins it used, i.e. I/O expander?

If so, is someone able to supply a schematic for connecting one to the prop.

There are 17 pins(buttons).



Thank you smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"powered by Propeller" domed stickers $1.50 - Find them here
Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net

The Sarah Myatt Fund - Help Sarah and Her Family Fight Quadriplegia HERE

Comments

  • computer guycomputer guy Posts: 1,113
    edited 2010-06-30 04:00
    Would three PCF8574 chips be a good idea? As there is already a PCF8574 object in obex.
    I could connect them all too the same prop pins but just give them incremented id's.

    Any thoughts?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net

    The Sarah Myatt Fund - Help Sarah and Her Family Fight Quadriplegia HERE
  • T ChapT Chap Posts: 4,223
    edited 2010-06-30 04:50
    Use a PCF8575 which is 16 i/o. Very simple. For 17 pins, you could wire the 17th button to two inputs on the 8575, and that way only need data and clock. Pull the inputs high with 10k's, then short them to GND with the buttons. For using these as input devices, read the special precautions about setting first to output.

    Post Edited (Todd Chapman) : 6/30/2010 4:59:49 AM GMT
  • computer guycomputer guy Posts: 1,113
    edited 2010-06-30 05:18
    Hello Todd,

    The buttons are pulled low with 10k's and then shorted to vdd. Is this a problem?

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net

    The Sarah Myatt Fund - Help Sarah and Her Family Fight Quadriplegia HERE
  • T ChapT Chap Posts: 4,223
    edited 2010-06-30 05:34
    Same thing, should be fine.
  • T ChapT Chap Posts: 4,223
    edited 2010-06-30 17:36
    BTW, when I stated that for the 17th button you could connect it to two inputs to give >16 possibilities, that will require some buffering on the button so that it stays in a hi-z state when open to not affect the other buttons. One solution might be to buffer the button with two 3904's, both driven by the voltage produced from the 17th button. I haven't tested this, but the drawing is the general idea, maybe someone has a better idea. The point being, that with this type of scheme, with only data and clk with I2C, you can have a lot of buttons connected, and as long as no more than one button gets pressed you are fine. I don't know what the real limit of buttons is doing something like this, but is would be quite a few. The drawing shows a button on pin 1, a button on pin 2, and a button using pins 1 and 2.

    EDIT I just realized the switch 17 in the drawing is configured to pull the pins to GND, while the other two buttons pull the pins high. So this schematic is flawed, but still gives the idea for using several pins at once to exceed the 16 input limit. You could hold all the inputs high, and let the buttons 1-16 pull the pins low, then the 3904's should work as drawn.

    Also, using 16 or more 10k's pulling UP the inputs may tax your supply, so if that is a concern, you may want to use something high, 47k for example as pullups.

    Post Edited (Todd Chapman) : 6/30/2010 9:04:29 PM GMT
    673 x 446 - 18K
Sign In or Register to comment.