We demonstrate how to add input and output pins using
shift registers
. The process of connecting several copies of the same chip together is called
daisy-chaining
. The term is derived from those
pretty flower chains
. We will show how to get more output pins from an Arduino or other MCU by daisy chaining the
74HC595
serial-in, parallel-out shift register. We will also discuss how to get more input pins into an Arduino by daisy-chaining the
CD4021
parallel-in, serial-out chip.
Daisy chaining is a super-useful, common technique and we use it all the time in our designs. For example, our
heart matrix LED display
uses three daisy-chained 74HC595 chips to control the LED matrices. Our
shift keyboard project
, uses four daisy-chained CD4021 chips, to offer 32 buttons (a button for every letter in the English alphabet, and 6 to spare!), while only requiring 3 general purpose I/O pins from the micro-controller. Daisy-chaining is not limited to shift registers, in fact many chips afford this functionality. For example,
the TLC5940 PWM controller
can be daisy-chained in a similar manner.
A LED daisy made from daisy-chained shift registers!
-
A LED daisy made from daisy-chained shift registers!
This PCB daisy has 6 of our LED bar graph shift register boards wired to a hexagon shaped arduino clone.
-
Angle view of the LED daisy
See the LED daisy flower from an acute angle.
-
Daisy Shaped Daisy Chain All Light!
Lots of light!
-
The Back of LED bar graph flower
The back of the PCB flower. It is actually seven distinct boards connected together.
-
Daisy Chain Keyboard
Our
shift register keyboard
uses daisy-chained CD4021 shift registers to gives you tons of buttons at the cost of only 3 MCU pins.
-
Four 7 Segment LED Displays Daisy-chained together
Here we have four 7-segment numerical LED displays connected to four 74HC595 chips (SOIC-16 package) daisy chained together.
This PCB daisy has 6 of our LED bar graph shift register boards wired to a hexagon shaped arduino clone.
Instructions
instructions
Step-by-Step Instructions
Step0Daisy Chain your Shift Registers
The way to daisy-chain two 74HC595 shift registers together is to connect the Q7' pin on the first shift register to the Serial In pin on the second register. All shift registers in the daisy chain share the latch and clock lines. The schematic shows a typical set up of two daisy chained 74HC595 chips. You can continue to add more chips by connecting the Q7' pin on the last shift register to the Serial In pin of the shift register you are adding.
Step1Daisy Chain CD4021 Shift Registers
For a parallel-in serial-out shift register like the CD4021, the set up is very similar to the one shown above. Again, all the shift registers share the same latch and clock pins from the micro-controller. As always these pins go by many names (latch is also referred to as PL, and parallel/serial control or P/S CTRL, and the clock pin is labelled CP in the diagram. Now, the serial in pin on the shift register closest to the micro-controller is connected to the data pin of the second shift register. The data pin is labelled Q7 in the diagram. Don't be confused, "Serial In" on the CD4021 chip has a very different meaning than serial in on the 74HC595. Because the CD4021 is a parallel-in serial-out shift register "serial in" to the CD4021 means where data from a daisy-chained shift register comes in to be sent to the micro-controller. On the 74HC595, Serial In means where data FROM the micro-controller goes to be displayed by the shift register (or sent down the daisy chain to be displayed by another register).
Comments: