Go Down

Topic: controling in between 100 and 255 outputs (Read 1 time) previous topic - next topic

PGT

Jan 16, 2013, 07:57 pm Last Edit: Jan 16, 2013, 08:00 pm by PGTBOOS Reason: 1
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.

retrolefty


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

DVDdoug

#2
Jan 16, 2013, 08:08 pm Last Edit: Jan 16, 2013, 08:17 pm by DVDdoug Reason: 1
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.)

PGT

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 ?

MikMo

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

robtillaart

centipede shield ?

- http://macetech.com/store/index.php?main_page=product_info&products_id=23 -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

retrolefty


centipede shield ?

- http://macetech.com/store/index.php?main_page=product_info&products_id=23 -


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

Quote

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.

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.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

retrolefty

#8
Jan 16, 2013, 09:34 pm Last Edit: Jan 18, 2013, 07:39 pm by retrolefty Reason: 1

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

CrossRoads

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.

Code: [Select]

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





Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

PGT

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.

PGT

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


zoomkat

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
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

CrossRoads

#13
Jan 17, 2013, 01:12 am Last Edit: Jan 17, 2013, 01:34 am by CrossRoads Reason: 1
Quote
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.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

PGT

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

Go Up