Controlling 32 FETs (ISP6041) independently with millisecond timing.

All,

I'm considering using an Arduino as a 32 channel relay controller. The relays are really just the International Rectifier ISP6041 FET, since they provide enough power handling for me, and also have built-in short protection and detection, open detection, etc... I'll also use two of the PCF8575 for output control of the FETs, and two more as input feedback for the diagnostic pins on the FET.

The use case is as follows;

  1. The Arduino receives a serial setup-type command that consists of a comma delimited set of valves to turn on and a comma delimited set of times in millisec to turn on for. For example cmd{3,4,5:50,100,500} would turn on FET 3 for 50 msec, 4 for 100 msec, and 5 for 500 msec. It will than receive an execute command which will begin the setup timing. During execution it may receive an abort command that should turn off the FETs and stop timing.

  2. The Arduino occasionally may be queried for it's current state (what FETs are connected, which are open circuit, which are short-circuited) from the host. This would never occur while a timing action described in (1) was occuring.

  3. The Arduino receives a serial command that consists of a valve index and a state. This would be used to turn on a valve or turn off a valve without any attached timing.

Obviously requirements 2 and 3 are pretty straightforward. It's requirement 1 that worries me the most. At most, 7 or maybe 8 valves would actuated at a given time, but they will all have different timers attached to them. I thought maybe the best way to implement it would be to have a millisecond (or less?) interrupt that checks to see if a valve is done, and if so update it's state. During the non-interrupt portion of the code check the 32 states, and if any changed, send a new I2C command to update it. In the main loop I could also handle any incoming serial message to check for an abort (there's no latency requirement on aborting, just, you know, whenever you get around to it).

Is this crazy for an Arduino? Should I be looking at an FPGA and learning VHDL? Is it possible but my implementation thoughts are wrong and you have a better idea?

Any help would be appreciated and thank you in advance.

Read this: http://forum.arduino.cc/index.php?topic=223286.0