16-bit serial-to-parallel

17 November 2018
A circuit for the weekend — two 74HC595 8-bit shift registers that are chained together to control 16 bits of parallel output, in this case driving a bank of LEDs, and are in turn are both controlled via a single serial line. The chaining together of the two shift registers was done using an output that I was not quite sure was intended for the purpose, so the state of this output is also exposed separately — hence the round green LED between the two banks of red LEDs.

Shift registers

As their name suggests, shift registers work by loading a bit in at one end and then bit-shifting it between internal latches, as summarised in the diagram below. The 74HC595 has output buffering so output can be maintained while a new output is still being loaded, or alternatively it can tri-state the output to high-impedance so it can be used on a shared bus that other chips can also drive. I used the Texas Instruments SN74HC595 variant which can drive 35mA per output, and 70mA in total, whereas inputs draw very little current. The one output that is of special interest is QH' which bypasses the output buffer and presents the output of the final shift register directly — below it is indicated as overflow and in the circuit is fed into the input of the second shift register. The green LED indicates whether it is high or low.

Building the circuit

For this circuit I used Multicomp MC01007 perfboard (Farnell 2768277), which is a slightly wider version of the MC01006 perfboard (Farnell 2768276) I have normally used for small on-the-hoof circuits: 15-by-25 holes rather than two pieces of 15-by-16 joined together. There is little to say about using perfboard that I have not discussed already and this circuit is not the first time I have used MC01007 boards. The underside of the circuit, which in hindsight estimate to have taken a total of 4-5 hours to build, is shown below. Compared to previous circuits I had a much larger stock of different coloured wires to use, as well as some new tools, but these I will discuss in a future article.

Solder side of circuit board

How things could have been

As was the case with the 74HC238 decoder, I suspect that had I come across shift register chips back in late-July 2017, I would quite likely not started with I2C, and instead used the former for the column drivers within the LED display I was thinking of. At the time I was looking for some sort of serial-to-parallel chip without really knowing any terminology, and stumbled across I2C expanders when using serial as a search term — I2C was something I had come across a few times as a term before, but otherwise was starting from practically scratch. I made a few mistakes such as getting a USB I2C device that only operated as a slave, and then ordering in a master-capable USB device before realising they are available from a UK vendor, which all added to the difficulty of getting started with I2C. Even though I2C may or may not have been a good thing to use, in hindsight it is a good thing that I got to grips with I2C at a very early stage, because as things turned out most of the stuff I subsequently did did required it.