shift register design question

Hi-

hardware design question @ shift registers:

I plan to control 29 H-bridges (direction only) and plan to use TPIC6B595 shift registers. Each SR will control 4 H-bridges so I will have 15 SRs.

I've never worked with this many SRs before and I am trying to decide if I should daisy chain them all and use only 3 Arduino pins OR break things up and spread them across more pins.

Speed is not a huge concer (e.g. +/- 50 ms is ok). Is this more of a "what is easier to program for" issue or are there hardware issues here that I am unaware of?

tx!

--Roy

Greetings Roy,

If speed is not an issue, then connect them all in series — it will work very well. Just make sure that you change your SER IN data and then issue an SRCK instead of changing them both at the same time. If you change the SER IN data at the same time as the SRCK, you might end up with a race condition, that could get hard to debug.

Regards,
David

Hi David-

Thanks! - the race condition thing is something I completely hadn't considered (and fwiw - I have loved that phrase since the first time I heard it/learned what it meant - and way hard to debug).

Do you know if there is a way from the datasheet to roughly calculate what the update speed would be- or is that something one just needs to test?

The hardware design <----> programming design is an interesting zone. I'll probably screw it up and learn a lot on this project ... :smiley:

you could use the SPI port to send data to shift regs if you want it nice, fast, and mostly controlled by hardware. SPI protocol basically loops bits through a bunch of loop-connected shift registers after all. connect the last one's output to MISO and you can even read the data back!

Otherwise, you'll probably get 5-20 cycles per bit with good bit-bang code, which gives you an update rate of (16MHz / 20 cycles = 800Khz) / (15*8=120 bits) = 6.6KHz - way more than enough :slight_smile: