Ok i have need to control hundred or more digital outputs in a timed sense. (Art project)

I am not sure what kind of micro controller could do that, or if it should be a combination of multiple micro-controllers.What i do know that each output would need to be controlled individual with some delay, but this delay will also rapidly change and be different for each output.Overall it needs to work pretty fast too, like a blink of an eye

I am thinking of setting it all maybe let an arduino output some binary bits, but the arduino doesnt have enough pins.Any ideas would be welcome on how to do this.

Ok i have need to control hundred or more digital outputs in a timed sense. (Art project)

I am not sure what kind of micro controller could do that, or if it should be a combination of multiple micro-controllers.What i do know that each output would need to be controlled individual with some delay, but this delay will also rapidly change and be different for each output.Overall it needs to work pretty fast too, like a blink of an eye

I am thinking of setting it all maybe let an arduino output some binary bits, but the arduino doesnt have enough pins.Any ideas would be welcome on how to do this.

No micro-controller is going to have 255 independent output pins avalible. A popular method one could use is a series of serial in parallel output shift registers wired in series to gain the total number of output pins you require. Then in your arduino software you shift out the serial bit stream and clock pulses for the register array and when all bits are transferred out you pulse a latch pin wired to all the shift registers that transfer all the bits to their output pins at the same time. There is plenty of time to perform all that magic as a blink of the eye is a long time for a arduino running at 16 Mhz.

You probably want a serial-in, parallel-out shift register. The 74595 seems to be very popular. I assume it (and the Arduino) will be fast-enough for you.

Serial data transmission does tend to be slower, because you'll have to "write" 100-255 times before you can update the parallel data. However, Ethernet is serial, and and digital audio/video transmision is serial, SATA disc drives are serial... So in the real world serial can be very-fast!

You feed-in the data serially one bit at a time, synchronized with a clock signal. When all of the data has been shifted-into position, you send another signal to transfer & latch the data at the parallel outputs. These devices can be chained together for many outputs. (I'm using an LED driver that uses the same concept to drive 48 independently addressable LEDs from a 3-wire serial output.)

Depending on what you are goint to control you might need other tuff as well. Like the Arduino pins you can't draw much current from the shift register pins.Shift registers with high current draw capability are available but they are much more expencieve. You should alo conider your power upply needs.

If you tell a little about what you are going to control we could probably give better advice :-)

Or parallel strings of shift registers in series.Than one doesn't need to shift out 32 bytes of data every time.Use 4 strings perhaps, and only shift out 8 bits to update one string.Use SPI.transfer( ) and 4 chip selects, 1 per string.

Or parallel strings of shift registers in series.Than one doesn't need to shift out 32 bytes of data every time.Use 4 strings perhaps, and only shift out 8 bits to update one string.Use SPI.transfer( ) and 4 chip selects, 1 per string.

But doesn't it take the same amount of time to shit shift out all X bits no matter if one long string or multiple strings. Especially if you want to transfer the latch all at the same time?

The requirement was for "each output would need to be controlled individual with some delay, but this delay will also rapidly change and be different for each output.Overall it needs to work pretty fast too, like a blink of an eye"

Breaking up the grouping supports that.Even better - 8 strings of 4.Use 1 more part to control the 8 chip selects for the other strings.

digitalWrite(controlSS, LOW);SPI.transfer(stringSelectData); // 1 of 8 outputs lowdigitalWrite(controlSS, HIGH); // 1 of 8 strings now has it latch pin low, ready for dataSPI.transfer( stringX[byte0]);SPI.transfer( stringX[byte1]); // do this part a little smarter - make the string called an array, and select it based onSPI.transfer( stringX[byte2]); // the timing criteria going onSPI.transfer( stringX[byte3]); // maybe even repeat this entire example 8 unique times, each with its own unique time check to kick it offdigitalWrite(controlSS, LOW);SPI.transfer(0xff); // all outputs highdigitalWrite(controlSS, HIGH); // data is latched into 4 registers

I think the code to control it would be something like sending the delay time to one of the 100 ~ 255 pins in msThen based on the signal a mosfet will control a larger current.

How does it go with SPI, i've read a bit about it but its a bit unclear, i understand from it that its slightly different then the shift register method.If i am right, then SPI is a kind of cable on which multiple (arduino?) devices can connect and each get a number.So then to send a signal the signal should address the number of the connected arduino, and then send an instruction to it ?.Does one need to invent a protocol or handshake for that to define how much data in which direction you need to send?

Also since i need many outputs here, to save cost, could it be like having a normal duemilanove as a Master, with lots of cheaper Tiny arduino models like SPI slaves ?.

hmm or perhaps.. (thinking) 1 arduino master controling 15 arduino boards through SPI, and then have 10 boards with each 14 pins minus the one used for SPI ~ i guess 3? makes 15 * 11 = 165 pins..

.. i am not sure about my budget, i assume i would be able to program the arduino dough thats a big plus.. however these other two solutions might be cheaper (that extension board and using 2 arduino's) gives 128 pins.. maybe using an usb hub i can add 3 arduino's to a PC The shift register solution.. i dont know i think it is the cheapest ? , but also require more electronics knowledge perhaps.

Below is a four page how-to for making a parallel port controller for controlling 320 strings of christmas lights. Similar approaches could be done with an arduino. I've tinkered some with the 74HC259 latching multiplex chips doing simple stuff. lots of wires, but fairly straight foward.

I wonder if i would use SPI and send data to control this all what would be the shortest time to send such control information ?.

Yes it would. No other interface is faster.

Quote

If i am right, then SPI is a kind of cable on which multiple (arduino?) devices can connect and each get a number.

No, that is describing I2C. SPI, each device (or string of devices) gets its own chip select (aka slave select).SPI is the fastest interface, with default clock rate speed of 4 MHz - fastest I2C speed is 400KHz, and requires the devices to acknowledge the transmission.

Here's what I was discussing earlier. This is drawn with open-drain TPIC6B595, replace with 74HC595 if don't need the higher current sink capability.

The board pictured can hold 12 TPIC6B595s, I have daisy chained 2 of them with 20 shift registers total to control a 5x20 display (used 5 of 8 outputs on each).Apparently I can't count all the time - 256/8 = 32 chips, so 4 strings of 8, could that with 4 of these boards. Only 1 needs the uC setup, the others can be just shift registers, caps, and connectors.