Shop OBEX P1 Docs P2 Docs Learn Events
NEW: Switchboard Module for Propeller Platform — Parallax Forums

NEW: Switchboard Module for Propeller Platform

Nick McClickNick McClick Posts: 1,003
edited 2010-05-21 13:38 in Propeller 1
4622071066_dcb92ab257.jpg
Project Page

The Switchboard Module uses 2x 4021 Shift Registers to read 16 buttons simultaneously. This is the same circuit as 2 NES controllers, so it only requires 4 pins, and you read the status of the buttons the same way. It fits on the Propeller Platform, or on any protoboard or breadboard.

I put it together because I wanted to do a soundboard (where you push a button and it plays back an audio sample), but I thought buttons would be more ideal than an NES controller. Of course, it works well for any project where you want a lot of buttons but don't want to use too many pins.
4621464361_5e5e8257f0.jpg

You can learn more or pick one up on the project page. The schematic is also up there along with an object for using it with the Prop. Everything's available under the MIT license, you can download the diptrace layout off the project page, too.

Let me know if you have any questions!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed!

Gadget Gangster - Share your Electronic Projects

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2010-05-19 17:03
    Nick

    I built the technical alternative to this button portion of this·board... a multibutton pad going through an ADC and got it supported with about 30 lines of code. It ends up being slow and slightly unreliable no matter what I do[noparse]:)[/noparse]

    So... for everyone who is thinking... wouldn't an RC circuit and a few resistors do the same thing? The answer is ...NO!

    Rich

    Post Edited (rjo_) : 5/19/2010 5:17:19 PM GMT
  • bazibazi Posts: 29
    edited 2010-05-20 09:15
    rjo_,
    look here http://www.avr-asm-tutorial.net/avr_en/keypad/keyboard.html#adc
    this works fine for me on avr (its own adc) and arm (own adc) and on pcs with a tlc549 on a serial port:
    http://www.skilltronics.de/versuch/elektronik_pc/ad.html
  • Nick McClickNick McClick Posts: 1,003
    edited 2010-05-20 16:53
    @rjo_- There are a lot of approaches for reading keypads (charlieplexing was another approach I thought of), but yeah - using the shift registers is the easiest, fastest, and most reliable approach. I also wanted to record multiple simultaneous button pushes, and that sounds like a nightmare with 16 buttons on an R/C network.

    The object I put up is probably around 30 lines of code. I wonder how much I could compress that...

    @bazi - I think using R/C or an ADC would be a similar. But either wouldn't work - I wanted to record multiple button presses at the same time (or even jamming every key at once), and have it foolproof (immune to RFI, temperature changes, or even different resistor values). But a matrix approach would probably work fine if you only wanted to do one button at a time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Forums RSS Feed!

    Gadget Gangster - Share your Electronic Projects
  • rjo_rjo_ Posts: 1,825
    edited 2010-05-21 01:37
    Nick...

    You have so much talent... and I want you to be around for a long time. Check out my posts in the sandbox... and try to follow my example[noparse]:)[/noparse]

    The one about my general question... not the specific question that I shouldn't have asked.

    Rich
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2010-05-21 13:38
    @rjo: Just curious, but do you think the Prop II (yes, even though it will have more I/O pins to "burn") with its built-in A/D would better support the resistor approach to reducing the pin count? Or do you think that it would face some of the same problems as you've discovered?· Oh, wait:· was your A/D converter external (I'm not permitted to go off-site to AVR pages, lol)?

    @Nick:· Nice job!· I bought components to do a scanned approach using blocking diodes (to prevent ghosting, etc.) to allow for simultaneous button presses, but that still uses 8 pins (4 columns and 4 rows) for 16 buttons.· But you've cut that in half!· · Hmm...never heard of "charlieplexing" before which also uses diodes, but it does so in a different (and more sophisticated) way than what I was planning, saving pins.· Is there a name, per se, for the technique you're using?· Hmm...okay, guess it would be called a shift-register or parallel-to-serial approach.· So the way this scales is linear.· That is, adding a third shift register would provide for another 8 buttons, for a total of 24 (8 buttons per 8-bit shift register x 3 shift registers) and would require another Prop I/O line. So, one is basically getting 8 buttons for 1 pin *after* the cost of the clk and p/s lines have been absorbed.· Expanded·for comparison, 64 buttons would take 10=8+2 pins, compared to, for example, 16=8+8 in an 8-by-8 scanned row-and-column matrix approach.· I know that's all obvious for most of you (though not me), but for what it's worth....

    Post Edited (JRetSapDoog) : 5/21/2010 3:06:08 PM GMT
Sign In or Register to comment.