Shift Registers

Pages
Contributors: JordanDee
Favorited Favorite 47

Why Shift Bits?

Shift registers are often used for the purpose of saving pins on a microcontroller. Every microcontroller has a limited number of pins for general inputs and outputs (GPIO).

If a project needs needs to control 16 LEDs, that would normally require 16 pins of a microcontroller. In the event that you don't have 16 available I/O pins, this is where the shift register comes in handy. With two shift registers connected in series, we can accomplish the task of controlling the 16 LED's with only using 4 I/O pins. That is quite a difference, and you can save even more pins the more shift registers you have chained together.

This uses the same hardware as the original NES, a shift register to gather button states

A real world example of using a shift register to gather inputs is the original Nintendo controller. The main microcontroller of the NES needed to get button presses from the controller, and it used a shift register to accomplish that task.