SCEA117 July   2022 SN74HCS164 , SN74HCS164-Q1 , SN74HCS165 , SN74HCS165-Q1 , SN74HCS595 , SN74HCS595-Q1

 

  1.   Abstract
  2.   Trademarks
  3. 1Overview
    1. 1.1 Types of Shift Registers
    2. 1.2 Default State of a Shift Register
    3. 1.3 164 Function Shift Registers
    4. 1.4 165 Function Shift Registers
    5. 1.5 595 Function Shift Registers
    6. 1.6 Daisy-Chain Two Shift Registers
  4. 2Design Challenges
    1. 2.1 Controller Loading Limits
    2. 2.2 Operating over Large Distances
    3. 2.3 Data Loss Due to Signal Timing
    4. 2.4 Data Rate Limitations
    5. 2.5 Software Overview
  5. 3Example Design - Daisy Chain 72 Shift Registers
    1. 3.1 System Overview
    2. 3.2 System Design
    3. 3.3 Software Examples
  6. 4References

System Overview

For this example design, we will be driving 576 total indicator LEDs only using three GPIO pins from our selected MCU. We will also be reading in eight digital values from a set of DIP switches using only one additional GPIO pin.

This design is intentionally overly complex in order to show how to handle the “worst case” for driving multiple shift registers. In the majority of systems, none of the complexity shown here will be required, however all of the issues that are solved below should be considered.

For any system, the first step is to define the requirements.

  • Voltage supply is 3.3 V
    • Since this document is not concerned with the power supply design, it is assumed that the supply is stable and all boards receive the appropriate amount of power required
  • 8-channel DIP switch on controller board provides configuration
  • Six individual remote boards contain 96 LEDs each
  • LED forward voltages range from 2 V to 2.4 V, operate at 1 to 2 mA each
  • Update LEDs and read configuration 30 times per second (33 ms max refresh time)
  • Controller maximum output frequency is 1 MHz at 20 pF load
  • Controller board is physically separated from LED boards, see Figure 3-1 for the system diagram
  • Boards are connected via 50 cm long 120 ohm transmission lines (ribbon cables)

Based on the system requirements, it would be very difficult and costly to get a single controller that could individually handle all the required LEDs (96 per board, 576 total), not to mention the large number of wires that would be required to connect them. Instead, we will be using shift registers to reduce the required number of GPIOs and signal wires to only five.

The SN74HCS595 is used to allow for the LEDs to change simultaneously. This capability does require an extra control signal (RCLK), however it is very beneficial for LED applications since flickering can be observed while loading simpler shift registers like the SN74HCS164, which do not include output storage registers.

For the controller board, the DIP switch states will be read by a parallel-in, serial-out shift register. Each switch is debounced using a simple RC circuit and the SN74HCS165 is used to support the slow input transition times caused by the debounce circuits. See Debounce a Switch for more details regarding debounce circuits.