how to write to 240 pins every <0.2 seconds

Hello there, I'm building a Water Curtain and I need to know what hardware and software I can use to write to a massive 240 output pins every 0.2 seconds or faster. Controlling the shear number of pins, and doing it quickly enough to be able to produce images in the drips as they fall down is the part that I need help with.

I understand the MCP23017 is limited to to something like 128 pins - not enough. Is the TPIC6B595 a good option?

I'm really just throwing out the feelers, there's got to be some kind of solution to write to 240 pins every 0.1 seconds, whether it's on a RPI or an Arduino, so please help me!!! Many thanks in advance.

Further information;

Here's an example of what I'm making Aqua Graphic Water Curtain by Aquatique show - YouTube
I've attached a picture of the mechanism I've built to be able to intersect the water drops as they fall. This is working well, and it has a 12V solenoid to actuate the movement. I'm not using solenoid valves because they drip when closed, and I came across another water curtain build that used this system.
I want to have a water drip every 25mm, and I'd like the machine to be about 6 meters long although I'd prefer not to be constrained even at that length. ( 6000mm divided by 25mm = 240 pin )
I'm guesstimating that every 0.2 secs would get the project looking ok, but every 0.1 seconds would be more like what's needed.

Yes, TPIC6B595 are great for sinking current thru solenoid coils.
I have a board with 12 of them for 96 outputs, use 3 and have some extra outputs for other stuff.

CrossRoads:
Yes, TPIC6B595 are great for sinking current thru solenoid coils.
I have a board with 12 of them for 96 outputs, use 3 and have some extra outputs for other stuff.

great! what sort of time does this take to write to 240 pins? also, what's the limit to the number of boards you can drive?

I had a project that updated 45 shift registers at 20 KHz rate, so every 0.2seconds, 5 Hz, is not a problem.

You (or somebody) should check this, but I did an experiment once to find out how long digitalWrite() takes. I simply alternated between writing high & low 10 or 20 times and then I looped that, and checked the timing with an oscilloscope.

The result was 3.3uS. That's about 300,000 writes per second without doing anything else and not counting the time for the loop to start-over.

Your real-world your program will probably be doing "other things" so it will probably go slower.

But, there are also [u]port commands[/u] and since it's an 8-bit processor you should be able to write to 8-pins just as fast as to 1-pin. Or, with assembly/machine language you can probably go faster.

P.S.
My experiment was with an Uno

240 pins / pins per device = 30 devices.
Try a time test, flesh this out as needed:

startTime = millis();
digitalWrite (csPin, LOW);
for (x = 0; x < 30; x =x+1){
SPI.transfer(dataArray[x]);
}
digitalWrite (csPin, HIGH);
endTime = millis();
elapsedTime = endTime - startTime;
Serial.print (elapsedTime);

You can write easily to multiple boards at the same time, with one port pin dedicated to one board. Port manipulation can be done in C/C++ using the port names, no assembly code required. The digitalWrite() maps logical to physical pins, what takes time and can be omitted.

Speed depends on distance, when the signals are distorted on long wires or near EM sources (solenoids). Differential line drivers can help to preserve signals over long or distorted lines.

CrossRoads:
I had a project that updated 45 shift registers at 20 KHz rate, so every 0.2seconds, 5 Hz, is not a problem.

ok, I need to design a board around the TPIC6B595. Do you have a schematic to hand or something that will aid me? maybe you sell them on tindie?

also, what's the limit to how many pins these IC's can write to?

thanks so much

I offer the 12 TPIC6B595 boards, assembled, $105 each plus USPS flat rate mail and paypal fee.
Each board has a 328P processor on it.
You can coordinate them sending data out together; you can have one 328P drive all 36 shift registers if you locate the boards close to each other so clock/data/latch can be connected board to board with short, clean wiring.
The schematic is at my website
http://www.crossroadsfencing.com/BobuinoRev17/

240 outputs = 30 shift registers = 30 bytes = 240 bits. There is no theoretical limit to how many shift registers you can daisy chain; the limit is purely practical (physical size, wires, power consumption, etc).

At a modest 2 MHz, SPI can transfer that much data in 120 µs.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.