View Full Version : NEW: Switchboard Module for Propeller Platform

Nick McClick
05-19-2010, 11:56 PM
Project Page (http://www.gadgetgangster.com/find-a-project/56?projectnum=324&utm_source=parallax&utm_medium=forum&utm_campaign=switchboard)

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.
http://farm4.static.flickr.com/3363/4621464361_5e5e8257f0.jpg (http://www.gadgetgangster.com/find-a-project/56?projectnum=324&utm_source=parallax&utm_medium=forum&utm_campaign=switchboard)

You can learn more or pick one up on the project page (http://www.gadgetgangster.com/find-a-project/56?projectnum=324&utm_source=parallax&utm_medium=forum&utm_campaign=switchboard). 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! (http://www.nicholasm.com/proprss/)

Gadget Gangster - Share your Electronic Projects (http://www.gadgetgangster.com)

05-20-2010, 12:03 AM

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:)

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


Post Edited (rjo_) : 5/19/2010 5:17:19 PM GMT

05-20-2010, 04:15 PM
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:

Nick McClick
05-20-2010, 11:53 PM
@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! (http://www.nicholasm.com/proprss/)

Gadget Gangster - Share your Electronic Projects (http://www.gadgetgangster.com)

05-21-2010, 08:37 AM

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:)

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


05-21-2010, 08:38 PM
@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 (http://en.wikipedia.org/wiki/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