controling in between 100 and 255 outputs

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.

PGTBOOS:
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.

Lefty

You probably want a serial-in, parallel-out shift register. The [u]74595[/u] 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.)

Interesting do you know what kind of shift registors (i never used them).. can be used, or know of a some sample with an arduino ?

74hc595 for instance.

They are rather cheap.

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

centipede shield ?

robtillaart:
centipede shield ?

Two are good for 128 bits, so enough for his low end estimate but short of his 255 estimate.

If very long headers are used to allow two Centipede Shields to be stacked, then by changing the ADDRESS jumper it is possible to address 128 I/O pins.

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.

CrossRoads:
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?

Lefty

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 low
digitalWrite(controlSS, HIGH); // 1 of 8 strings now has it latch pin low, ready for data
SPI.transfer( stringX[byte0]);
SPI.transfer( stringX[byte1]); // do this part a little smarter - make the string called an array, and select it based on
SPI.transfer( stringX[byte2]);  // the timing criteria going on
SPI.transfer( stringX[byte3]);  // maybe even repeat this entire example 8 unique times, each with its own unique time check to kick it off
digitalWrite(controlSS, LOW);
SPI.transfer(0xff); // all outputs high
digitalWrite(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 ms
Then 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.

just reading an Arduino Mega has 54 pins.. so 3 or 4 of them might do the trick too.

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 ?.

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.

http://computerchristmas.com/christmas/link-how_to/HowToId-4/How_To_Build_A_Parallel_Port_Controller_Box

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.

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.

I am completely new to chip connections how many devices can be connected using ISP and a arduino as a Master ?

Hmm I might favour Arduino slaves, since i have some experience with programming them, and it would require less soldering for me.
Or hmm i make it a soldering project.. :slight_smile:

"how many devices can be connected using ISP and a arduino as a Master ? "
Depends how you wire them up, doesn't it?

Use a part that buffers the signals as it passes them along, like WS2801, the number is probably reaaaaally high, limited by your abillity to distribute power. That's basically what LED strips are - how long are those strings?

Use parts that are all driven in parallel, with SCK-MISO-MOSI going to all pins and unique chip select or latch pins, you are only limited by the number of slave select pins available.
For an Uno, that would be 17.

For some combination of the two, there are too many possibilities to count. As I described above, I demonstrated 20 shift registers controlled with just 3 pins, and made 5 sets doing of boards do that.

The schematic I showed had 64 parts being controlled - the key would be in proper distribution of the control signals and power. Termination of the signals might be needed, altho with SPI at 1/4 of system clock, that's 4 clock cycles (250nSO) for signals to settle, making for a pretty tolerant system.