Shift register Question

Hi guys,

In the project I am currently developing I am measuring 32 sensors over an SPI interface, to select each sensor I am using a shift register ( currently some 74HC595 chips) to lower the chip select pin. However to make this work properly I need all the outputs to be "high" when the enable pin is "high" ( i.e. when the shift registers outputs are turned off ). So I was wondering if anybody know of any shift registers out there where the outputs can be "high" when the enable pin is "high", or if anybody had any ideas of a circuit I could build around a shift register to achieve this....

My initial idea was to put a "NOT gate" on each of the shift registers outputs, however this seemed a little heavy handed....

Many Thanks for any help you can give me,


Hi All,

I have answered my own question, when the enable pin is high all of the outputs are effectively floating, so by pulling each output up to 5V the outputs are high when the enable pin is high, and when the enable pin is low the outputs operate as normal....

A pullup resistor is too easy solution?! Put a few Kohm (3.3, 4.7) resistor between the V+ and the output pin of the shift register, this will keep that line high until you pull it low by your command.

Edit: so you already find this solutions by yourself, good!

Cheers, Ale.

But you can leave them all enabled all the time. The (paralleled) latch inputs are used only when there is a valid pattern in all the shift registers.

Yes, just write 0 to the selected device, 1 to the rest.
All outputs change at one time when 4 bytes are shifted out.

digitalWrite (ssPin, LOW);
for (x=0; x<4; x = x+1){
digitalWrite (ssPin, HIGH); // all outputs update on this rising edge

and just manipulate dataArray[0,1,2,3] to have a low where you need it for a particular transfer.

MarkT: But you can leave them all enabled all the time. The (paralleled) latch inputs are used only when there is a valid pattern in all the shift registers.

This is the obvious solution however the goal is to measure each sensor at 50Hz and for it to be scalable for a system with 100+ sensors, for this reason instead of setting all the bits in the shift registers each time I make them all high and then just push a single low through all of the bits in sequence taking measurements from a different sensor each time it "moves".

Thanks for all the help/advice though =)

You still have to clock the latch at some point, note, otherwise no output changes.

I strongly suggest you clock through all 1’s, latch, then to read a particular sensor do this:

clock through the right 11111011111 pattern, clock the latch, then do the SPI operation,
then clock through all one’s again and clock the latch.

Each SPI device has a minimum time after the CS goes high during which it will
still own the bus and drive MISO, its not zero, so its best to give some deadtime
between operations to prevent sensors confusing each other. Its likely to be 100ns
or less, but it is not likely to be zero.

You can use software controlled clock too, make your own single clock pulse to shift in one bit, and then one output clock to change the outputs.