Monday 15 January 2018

Controlling an LCD using MSP430 via a shift register 74HC595

Introduction

In this post, we will control an LCD using MSP430G2553 via a shift register, 74HC595.

I have already executed a project on controlling an LCD in 4 bit mode using an MSP430  (Pulse Rate Detector): https://youtu.be/dle8M3QlXc4

Although, 4 bit mode reduces the amount of pins required for operation when compared with 8 bit mode, we can further reduce the number of pins required from MSP430 to 3 by using a shift register!

These three pins are required for ENABLE (LCD ENABLE pin), Data and Clocks respectively.

74HC595

74HC595 is a high speed 8-bit serial in, parallel out shift register consisting of a storage register and 3 state-outputs.

Both the shift and the storage registers have a separate clock (SH_CP, ST_CP). During the positive transition of the SH_CP, data is shifted and the content is transferred to storage register during positive transition of ST_CP (check the datasheet of 74HC595 for detailed explanation and pin diagram).

In this project, both the clocks are tied together to reduce the number of pins, thus, the shift register will always be one clock ahead of the storage register. Thus, if we want to receive a serially transferred 8 bit data, an extra clock pulse should be provided after the transmission of the 8-bit serial data as the storage register lags by a single clock pulse w.r.t the shift register.
The OE pin is active low, hence, it is connected to ground for extracting the parallel output.

Circuit Diagram

The hardware connections are straight-forward. The shift register output is connected to the LCD data lines and RS control pin (Data/Command control). Both the clocks are tied together and controlled via a single port pin of MSP430, one pin is connected to ENABLE of LCD and the third port pin is connected to the DATA pin of the shift register. The R/W pin of LCD is grounded as only write operation is performed for this project.

OE pin of shift register is grounded and MR is pulled to 5Volts, Q0 - Q3 are each connected to D4 - D7 of the LCD, and Q4 is connected to RS.


Circuit Diagram

Software

Comment below your email ID to get access to the Software/Code for this project.

Demonstration

Check the project in action:

2 comments: