Shift Register With MSP430

by drselim in Circuits > Microcontrollers

1502 Views, 2 Favorites, 0 Comments

Shift Register With MSP430

74HC595 Shift Register & MSP430

In this instructable we'll see how the 74HC595 shift register works, then we're going to build a circuit with an LED array and connect it to the MSP430 Microcontroller. By writing C code in Code Compose Studio, we'll play with our circuit.

Supplies

8 LEDs, 8 Current limiting resistors, breadboard, MSP430 Launchpad, jumper cables, code composer studio

Basics of the Shift Register

shiftreg-pic.png
4bit_shift_reg.png

Let's look at some definitions:

•A flip flop is an element which is able to store one bit data. A register contains several flip flops. An n-bit register is consisted of n flip flops and several logic gates that implement their state transitions.

•A register capable of shifting its stored bits is called a shift register. A shift register is formed by chain-connected flip flops, where the output of a flip flop is connected to the input of the other. Flip flops are fed by the same clock source.

The pins of the 74HC595 Shift Reg:

SER-Serial Input

OE-Output enable

RCLK–Register Clock

SRCLK–Shift Register Clock

SRCLR–Shift Register Clear

QA-QH - Outputs

Here you should pay attention that the Output Enable and the Shift Register Clear pins are active low, meaning that you have to connect pin 13 to the ground to enable output and you have to connect pin 10 to Vcc in order to avoid clearing the Shift Register’s content.

How Shift Register Works

working_diag.png

The Working principle of the Serial in Parallel out shift register:

1)The input is fed in the SER pin (a zero or one bit: low or high voltage)

2)SRCLK is triggered with a clock pulse to insert the input to the first stage of the shift register

3)RCLK is triggered with a clock pulse to insert the content of the Shift Register stages to Storage Register and if the Output is enabled we'll be able to see the content.

4)In each new input+SRCLK+RCLK cycle a new input (either a zero or one) is inserted to the first stage and the other stages are shifted to the next stage.

You can see the video for the animation of these steps.

Circuit Setup

circuit_diag.png
fritzing_diag.png

We'll create our circuit according to the diagram.

connect the VCC and the GND pins of the shift register to the related pins in the MSP430 Launchpad.

connect 8 output pins to 8 resistors and LEDs,

connect P1.0 of the MSP430 to the SER input of the Shift Register.

connect active low OE to ground

connect SRCLK to P1.4 pin of the MSP430

connect RCLK to P1.5 pin of the MSP430

connect active low SRCLR to VCC

Programming in Code Composer Studio

screenshot.png

You can use the following five example codes to play with the circuit that you've built:

https://github.com/selimg76/microcontroller/blob/m...

https://github.com/selimg76/microcontroller/blob/m...

https://github.com/selimg76/microcontroller/blob/m...

https://github.com/selimg76/microcontroller/blob/m...

https://github.com/selimg76/microcontroller/blob/m...

If you like the content please subscribe to my YouTube channel for similar tutorials and projects.

https://www.youtube.com/c/drselim

I hope you enjoy this instructable.

See you in another one!