Pages: [1] 2   Go Down
Author Topic: controling in between 100 and 255 outputs  (Read 825 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 16, 2013, 02:00:12 pm by PGTBOOS » Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16468
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 22
Posts: 1160
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.)
« Last Edit: January 16, 2013, 02:17:40 pm by DVDdoug » Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 5
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

centipede shield ?

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

Rob Tillaart

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

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16468
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23611
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16468
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: January 18, 2013, 01:39:19 pm by retrolefty » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23611
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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




Logged

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.

Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8896
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23611
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* 255_output_shifter.jpg (147.78 KB, 960x720 - viewed 14 times.)

* 12_digit_driver_board.jpg (275.1 KB, 843x768 - viewed 9 times.)
« Last Edit: January 16, 2013, 07:34:59 pm by CrossRoads » Logged

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.

Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.. smiley
Logged

Pages: [1] 2   Go Up
Jump to: