NEW: Switchboard Module for Propeller Platform
Nick McClick
Posts: 1,003
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.
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
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
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
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
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
@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