Lots of Additional Outputs?
Up to Project Discussion
I'm a decent software programmer - but a complete clown when it comes to physical electronics: does anyone know where i should look if i wanted to drive a large number of individual LEDs? are there tricks that i could use to do this with the 8 outputs on the make controller? would i need to chain together a bunch of controllers (sounds expensive)?
You could do it without adding a bunch of boards together, to a point. I would suggest you setup an array and give commands through the controller outputs. That is, for a simple example setup an array of LEDs 4x4, then when you want light 0,0 to turn on you activate inputs 0 and 4. There are other tricks to make bigger arrays. Just treat the hardware like predefined software functions and you will figure it out.
CraigD
Cymek
no probalo, man
just use an 8 bit multiplexer and hook it up to the 8 outputs on the board, this will turn your 8 outs into 256 outs, a multiplexer will cost you about 5 bucks max, try to order a couple of samples thru digikey or something.
you could even attempt to hook the 4 servo power pins up to a 4 way multiplexer for an additional 16. You'd have to use the active signal on these for your power bit.
heck if you're feeling super crazy, you could hook all of them up to one single mux for 4096 outputs, but that's just getting ridiculous.:shocked:
You'll want to add a 2 bit counter to each output of the multiplexer , use the voltage off the lowest bit to power your led. Each time you send an on and then an off to that led, it will cycle the state (on/off).
tunell,
Could you give those of us with less experience a link to a suitable multiplexer from digikey? I'm in the same boat as dsquires, years of programming experience with virtually no electronics.
David
for your counter, the best looking thing on digikey (after an admittedly short search) is the
296-1665-5-ND,
it is a dual 4 bit counter, so you'll have 3 pins that you wont use, but you should get two counters out of the same IC package.
i misstated earlier that it should be a multiplexer, what is actually needed is a demultiplexer, but usually these come as the same component, and it just depends on how you hook them up. I will refer to it as a mux.
For the multiplexer, the part number will depend on how many inputs/outputs you want, but the part number below looked like a good fit. The more inputs your mux has the better, but you tend to get into inconvenient package shapes when you do this. using 2 3-bit decoders will allow you to have 2 * 8 outputs plus two of the original MC outputs. To get the really big numbers of outputs, you'll need single demultiplexers, which may be a pain to buy small quantities of.) You can also chain the multiplexers together take a look at the wikipedia page for info on how to do this. They have a pretty good overview there. Chaining the 3-bit muxes in 2 levels will give you a total of 64 outputs. a third level will give you the 4000 mentioned above, but your breadboard may look like a delicious plate of spaghetti.
for the demux, take a look at
3 bit demux - MC14066BCPGOS-ND
http://pdfserv.maxim-ic.com/en/ds/MAX328-MAX329.pdf
Before you order your components, pull up the datasheet for each device and take a close look at the pinout diagram to make sure you know how to hook it up. I typically buy the DIP style package as well as it is way easier to solder. Also take a look at the current capabilities of the counter, as this will affect what you can hook up to it's output. The outs on the counter will probably not be quite as heavy duty as the ones on the MC. Obviously you're also going to need a breadboard or a breadboard style PCB (Radio Shack).
a common issue when hooking these types of devices up is to forget to use a pulldown resistor on each device input. Make sure you hook a resistor to ground on the output (1k or greater). this will ensure that your input is at 0 when it's not at 1. I've spent a lot of time trying to troubleshoot my circuits while forgetting this important point. Also make sure you have your signal pin set to your power voltage (multiplexers are usually for sending data, but you'll just want to send a steady voltage to cycle the counter)
sorry for the multiple edits
hope this helps
I remembered someone asking about this, and here is a potential easier solution for those interested...
Futurlec makes an interesting board which I2C input and provides 8 additional output lines
Just a thought...
EBo --
Previously John (EBo) David wrote:
I remembered someone asking about this, and here is a potential easier solution for those interested...Yeah, if you're up for the fairly intrusive mod to the controller board that is required to get TWI to work. And if you can live without USB pullup control, which I cannot.
Futurlec makes an interesting board which I2C input and provides 8 additional output lines
My preferred solution for this sort of I/O expansion (which I have not yet gotten around to implementing, myself, but have worked out extensively) is to use SPI. You'd have to tack-solder flyleads to the board to get the SPI signals, but you'd have to do that for TWI, anyway. You can drive plain old shift registers with SPI. You lose one of the App board LEDs (it becomes a chip select indicator for your new SPI channel). There is already firmware support for hardware SPI.
You could, alternatively, bit-bang SPI on three digital outs (or serial port pins) if you wanted to. A digital in (or fourth serial port pin) would be needed if you wanted to do SPI reads, but driving a bunch of LEDs won't need that.
Another option, of course, would be to bit-bang TWI on three digital outs and a digital in. You'd need some additional circuitry (a transistor and associated resistors, at least) to make that work. You could do it without the additional circuitry (aside from the two TWI pullup resistors) if you used two (since they can be bidirectional) serial port pins instead.
Why would you have to loose USB pullup control? I have not done the I2C mod, but to play with the SPI and I2C stuff I was looking at bit-banging the the DI/O. Actually, I cannot wait until the MC expansion board (version 2.0) comes out which will hopefully fix these problems...
Anyway, here is to dreaming...
EBo --
Hmmm... just had another thought... Since you have stuff working for the conroler as is, you could mock up a custom breakout board and turn the appled's into digital outs. That gives you 4 more digital outputs without having to worry about strange programming as these would simply appear to be appleds as far as the programs are concerned.
EBo --
Previously John (EBo) David wrote:
Because the TWI lines are used on the controller board for pullup control and to monitor the power supplied on the USB port.
Why would you have to loose USB pullup control?
There's a howto or tutorial somewhere on this site which goes into it. In that document, they just make the pullup be permanently enabled so they can use the line for TWI.
Previously John (EBo) David wrote:
to play with the SPI and I2C stuff I was looking at bit-banging the the DI/O.Certainly doable, but watch out for the latency of the driver chips. It may not be much of an issue if you're only going at 1MHz or so. The drivers introduce 100-300ns of delay. TWI is usually only 100KHz or 400KHz, so well within range. You just have to watch your minimum pulse widths and settling times. Setting and then immediately (the next processor cycle) clearing the respective GPIO line might not even register at the driver output at all.
Either SPI or TWI, being synchronous protocols, can be run at arbitrarily lower speeds, which is why bit-banging them is so much easier than bit-banging something like async, USB, or Ethernet.
Actually, I cannot wait until the MC expansion board (version 2.0) comes out which will hopefully fix these problems...Sounds nifty. I've heard of a new version, but not much about what is projected to be changed. If Liam puts out a call for ideas, I've got a few.
Powered by
Ploneboard

