16 bit Shift Register?

Does anyone know if there is such thing as a shift register that handles more than 8 bits? And if so, where is it sold?

Thanks.

How many bits do you want ?
I know you can get 16 bit shift registers

STP16C596

What about just chaining two or more ordinary 8-bit shiftregisters?
:wink:

Thanks a lot, florinc. And raron, what do you by chain? I'm not familiar with that term.

If you use the 74HC165 shift register (parallel in/serial out) for example: you connect the serial out from the first register with the serial in from the second. And the load pins from both registers to one arduino pin, same with clock.

Mafu: That didnt make any sense?

However if you exchange the PISO (parallell-in serial-out) 74x165 with a SIPO (serial-in parallell-out, like the 74x164 or others), you could do it kind of like that: Connect the last bit of the first shiftregister to the input of the second shiftregister. Both shiftregisters' clocks connects together, and only the first shiftregisters input to the Arduino output.

Jetherit: The above is what I ment by chaining them (serially, of course). I hope I used the right term (about "chaining" something - hang something one after another).

Hi raron,
You can chain both types of shift register, Mafu's answer was perfectly correct. It just depends if you want more inputs or outputs.

The MCP 23S17 is in effect a 16 bit shift register with programmable input / outputs. It uses SPI and there is another one that uses I2C.

Florinc: Thanks a lot for that link, but I can't seem to find the through-hole version of the shift register shown on that PDF. If someone could show me a link to it on digi-key, that would be greatly appreciated.

It seems to be discontinued (digikey has only the SOIC package, which is not cheap either, at around US$3).
But, I will give you a tip: moderndevice has some kits for sale, and they include 4 of a pin-to-pin equivalent of STP16C596 among other parts, for only US$20:
http://moderndevice.com/8X8display.shtml

Why would they discontinue that? Is there some better way to make Serial-Parallel that I don't know about?

Also, thanks for that link, but I'm not sure if I want to spend that much for something I'm only going to use certain parts of. What I ultimately want to do is link several LED matrices, to have a big grid to do whatever with. I figure I could use an 8-bit shift register, but that would take exactly twice as many pieces, and also twice as many pins on my arduino.

Thanks again, guys.

Sorry for double post.

Grumpy_Mike: You mentioned the MCP 23S17. Since that appears to be my only through-hole option at the moment, how does it work? Does it take any more control than a usual shift register? You said it's programmable so I wasn't sure. Thanks.

Why would they discontinue that?

Because they are not selling enough to make it worth their while making it.

Get the data sheet on the MCP 23S17. It is more involved than a simple shift register and cost me £1.00 each, although I am sure you can get them cheaper. You will see it has lots of internal registers you need to address but it's easy enough to drive, connect it to the SPI pins. Include the SPI library at the start of the sketch:-

#include <Spi.h>
SPI SPI();  // initilise SPI object
void setup(){
// Set up ICON register it defaults to address 0xA on reset:
        expanderW(0x40, 0x0A, BANK | SEQOP | HAEN); 
// then you need to set up if each pin is an input or output
     expanderW(0x40,IODIRA, 0xff);      // Data direction register A all inputs
}
byte expanderR(byte com,byte add) 
{
  byte value;
  digitalWrite(SS_PIN, LOW);
  Spi.transfer(com);  // address read
  Spi.transfer(add);   //  register address
  value = Spi.transfer(0x0);   //  dummy data for read
  digitalWrite(SS_PIN, HIGH);
  return value;
}

byte expanderW(byte com, byte add, byte dat) // expander read
{
  digitalWrite(SS_PIN, LOW);
  Spi.transfer(com);  // address write
  Spi.transfer(add);   //  register address
  Spi.transfer(dat);   //  register data
  digitalWrite(SS_PIN, HIGH);
}

Constants like BANK | SEQOP | HAEN are defined values as per the data sheet. The address to pass the read routine is 0x41.
You can have up to 8 of these connected to the SPI lines at one time as they have three address input lines. The 0x40 here is with all lines wired to ground.
There is an I2C version of this chip called MCP23017 but being I2C it will be slower to write to but use 2 fewer pins.

You can chain both types of shift register, Mafu's answer was perfectly correct. It just depends if you want more inputs or outputs.

Of course. My bad, turns out it was just me not making sense of it at the time.

The most commonly used SR is the 595 which can be daisy chanied to make 8, 16, 24, 32, etc. bits as required.