Shop OBEX P1 Docs P2 Docs Learn Events
Keypad with shift resisters — Parallax Forums

Keypad with shift resisters

Carl RCarl R Posts: 10
edited 2011-08-24 09:37 in BASIC Stamp
Can someone tell me where to find information on how to wire a 4x4 Matrix Keypad with shift resisters
and how to code it for a BSpx . Thanks Carl

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-23 11:48
    Look at Nuts and Volts Column #22. It should work fine with a BS2px, just faster. What do you mean by "shift resistors"?
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-08-23 12:41
    I read that one could use a shift register and read 8 buttons shift the state of each button into the prop with one pin.
    Apparently we can connect two shift resisters together and read 16 buttons with one pin, maybe this is what he wants?

    I wanted to make a custom keyboard configuration, and thought I might try to read 108 buttons using a single pin. The idea was to use bare solder pads like on the quickstart board, but I didn't get past figuring out which parts would work.

    Would shift registers work with quickstart - type "Pad buttons"? Could eight such buttons be read with a single pin?
    Could larger and/or multiple shift registers be used to read lots of buttons, say over 100?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-23 13:15
    @prof_braino,
    The question here was about a 4 x 4 keypad which consists of 16 keys arranged in a matrix format to be scanned using 4 + 4 = 8 I/O pins, usually 4 inputs and 4 outputs. This could be done with an 8-pin I/O Expander, but not with ordinary shift registers. Larger keyboards (like your 108 keys) are typically scanned in the same fashion. You might use 14 outputs and 8 inputs. The outputs could be handled with a pair of serial to parallel shift registers like the 74HC595 and the inputs could be handled with a parallel to serial shift register like the 74HC165 or you could use a 16-bit I/O expander plus an 8-bit I/O expander.

    You could use I/O Expanders to handle something like the QuickStart's pad buttons. In this case, you have to switch between input mode and output mode fairly quickly and you can't really do that with the shift registers.
  • Carl RCarl R Posts: 10
    edited 2011-08-23 19:13
    Hi Mike I'm new to all of this and I thought that shift registers were used to expand I/O s. I guess I need to find out about I/O expander s.

    Carl
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-23 20:53
    Have a look at this stuff on I/O expanders, particularly AN1081. This is an SPI-based I/O Expander which is faster, but uses more I/O pins than I2C (which also works with a BS2px). The MCP23017 is the I2C version of the same thing and there are 8-bit versions of both of these 16-bit I/O Expanders.
  • Carl RCarl R Posts: 10
    edited 2011-08-24 09:37
    Thanks mike

    Carl
Sign In or Register to comment.