Built-in project · no microcontroller

74HC shift register and counter drawer

12 chips on breadboards, powered, every input tied low and ready to rewire. There is no microcontroller in it: the simulator solves the 12 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.

Teaching? Assign it to your class in one click.

Beginner About 20 minutes to build and run. Runs in your browser. Free, and no account needed.

The parts retail for about $23. On Mokxi they're free.

The circuit runs here once the page has loaded.

What you'll learn

  • Why unused logic inputs must be tied high or low
  • How a shift register moves bits one clock at a time
  • How binary and decade counters count clock pulses
  • Using a chip's truth table to plan its wiring
  • Difficulty: Beginner
  • Time: About 20 minutes
  • Parts: 18

How it works

This is a parts drawer, not a finished circuit. Eleven chips sit on three breadboards, each one powered from a 5 V supply. Every input is tied to ground with a wire, so nothing floats.

The set has four shift registers (74HC164, 74HC166, 74HC597, TPIC6B595) and seven counters (74LS90, 74LS93, 74HC390, 74HC393, 74HC190, 74HC191, 74HC192). Nothing else is wired. You choose a chip, move one input wire to the 5 V rail, and watch what it does.

Parts list

18 parts, plus the jumper wires. They retail for about $23; on Mokxi they're free.

  • 3 × Full-size breadboard
  • 3 × Power, 5 V
  • 1 × 74HC164 shift register
  • 1 × 74HC166 shift register
  • 1 × 74HC597 shift register
  • 1 × TPIC6B595 power shift register
  • 1 × 74LS90 decade counter
  • 1 × 74LS93 binary counter
  • 1 × 74HC390 dual decade counter
  • 1 × 74HC393 dual 4-bit counter
  • 1 × 74HC190 up/down decade counter
  • 1 × 74HC191 up/down binary counter
  • 1 × 74HC192 up/down decade counter
  • 1 × 74HC194 universal shift register

Wiring table

Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.

Part and pinConnects to
74HC164 shift register pin VCC5 V
74HC166 shift register pin VCC5 V
74HC597 shift register pin VCC5 V
TPIC6B595 power shift register pin VCC5 V
74LS90 decade counter pin VCC5 V
74HC164 shift register pin DSAGround
74HC164 shift register pin DSBGround
74HC164 shift register pin GNDGround
74HC164 shift register pin CPGround
74HC164 shift register pin MRGround
74HC166 shift register pin DSGround
74HC166 shift register pin D0Ground
74HC166 shift register pin D1Ground
74HC166 shift register pin D2Ground
74HC166 shift register pin D3Ground
74HC166 shift register pin CEGround
74HC166 shift register pin CPGround
74HC166 shift register pin GNDGround
74HC166 shift register pin MRGround
74HC166 shift register pin D4Ground
74HC166 shift register pin D5Ground
74HC166 shift register pin D6Ground
74HC166 shift register pin D7Ground
74HC166 shift register pin PEGround
74HC597 shift register pin D1Ground
74HC597 shift register pin D2Ground
74HC597 shift register pin D3Ground
74HC597 shift register pin D4Ground
74HC597 shift register pin D5Ground
74HC597 shift register pin D6Ground
74HC597 shift register pin D7Ground
74HC597 shift register pin GNDGround
74HC597 shift register pin MRGround
74HC597 shift register pin SHCPGround
74HC597 shift register pin STCPGround
74HC597 shift register pin PLGround
74HC597 shift register pin DSGround
74HC597 shift register pin D0Ground
TPIC6B595 power shift register pin SERINGround
TPIC6B595 power shift register pin SRCLRGround
TPIC6B595 power shift register pin GGround
TPIC6B595 power shift register pin GNDGround
TPIC6B595 power shift register pin GND2Ground
TPIC6B595 power shift register pin RCKGround
TPIC6B595 power shift register pin SRCKGround
TPIC6B595 power shift register pin GND3Ground
74LS90 decade counter pin CKBGround
74LS90 decade counter pin R01Ground
74LS90 decade counter pin R02Ground
74LS90 decade counter pin R91Ground
74LS90 decade counter pin R92Ground
74LS90 decade counter pin GNDGround
74LS90 decade counter pin CKAGround
74LS93 binary counter pin VCC5 V
74HC390 dual decade counter pin VCC5 V
74HC393 dual 4-bit counter pin VCC5 V
74HC190 up/down decade counter pin VCC5 V
74HC191 up/down binary counter pin VCC5 V
74LS93 binary counter pin CKBGround
74LS93 binary counter pin R01Ground

55 more connections: open it in the simulator to see them all.

The notes that come with it

There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.

sketch.ino
// 74HC shift register and counter drawer.
//
// Every chip is on a breadboard and powered, and every one of its inputs is
// tied low by a wire to a ground rail, so nothing floats. Nothing else is
// wired: pick a chip, move an input's wire to the + rail, put an LED with a
// resistor on an output, and see what it does. Each chip's help page has its
// pins and its truth table.

Troubleshooting

The usual mistakes with this circuit, and the fix for each.

  • The outputs flicker or show garbage while data is shifting. 74HC164 shift register
    The 74HC164 has no output latch, so every shift shows on the pins. Use a 74HC595 if you need to hold the output, or blank the display while loading.
  • Nothing shifts in, or only zeros appear. 74HC164 shift register
    Pins A and B are ANDed together, so tie unused one high. Data is read on the rising clock edge. Master reset (MR) is active low, so tie it to VCC.
  • The data does not load, or shifts out wrong. 74HC166 shift register
    Set SH/LD low and clock once to load the parallel inputs. Then set it high to shift. Check the clock inhibit pin and that the master reset is high.
  • The bits come out in a surprising order. 74HC166 shift register
    The last input H comes out first at QH. Reverse your bit order in software if needed. Tie unused inputs to a level and decouple the supply.
  • The shifted data is wrong or arrives in the wrong order. 74HC597 shift register
    Data is first sampled into the input register by the input clock, then loaded to the shift register with its own latch, then shifted out. Pulse them in the right order, and watch the bit order (MSB first or LSB first).
  • The chip ignores clocks or gives random output. 74HC597 shift register
    Hold the clear pin (active low) high and the output enable correctly. Never leave the control inputs floating. Add a 0.1 uF decoupling capacitor between VCC and GND.
  • The LED or load does not light when you connect it from the output to ground. TPIC6B595 power shift register
    Outputs sink current, like open drain. Connect the load from the supply (up to 50 V) to the output pin. Add a resistor for LEDs. A high bit turns that output on.
  • No outputs respond. TPIC6B595 power shift register
    G (output enable) is active low, so tie it to GND. SRCLR is active low, so tie it to VCC. Shift data in with SRCK, then pulse RCK to latch it to the outputs.

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.