serial LCD display circuit

Raspberry Pi 74164 Serial Shift Register Interface Liquid Crystal Display

by Lewis Loflin

Here we connect my serial LCD display circuit to the Raspberry Pi. This saves the use of GPIO pins for other uses. The routines are as follows:

pulseCLK() used to clock data into the SN74164.

pulseE() shifts the parallel data in the display. The RS pin determines if the data is a command/address or ASCII code.

ssrWrite(int) uses a "for" loop with pulsCLK() to shift 8-data into the SN74164.

initLCD(), clearLCD(), and Home() are used to setup the operation of the LCD display. They set RS LOW for command mode, use ssrWrite() to clock byte into 74164, the use pulseE() to enter parallel data into display control circuits.

gotoLocation(address) inputs an address in the internal ram of the display at a select location for display. 0x80 is column 0, line 0 (first character line 1) and 0xC0 is column 0 line 1 (first character line 2).

wrtiteString(text-string) is used with the above functions to write an ASCII string to the display. This must proceeded by gotoLocation(address) to set the position pointer in the display for the text.

convBinary(value) is used to convert an 8-bit number to an ASCII string of 1s and 0s. It doesn't drop leading 0s like the python bin(x) function does.

The complete code is rpi_arduino2.txt.

Click for picture RPi 2 GPIO pin connections.


This is a collection of programs and hardware hacks related to mainly Raspberry Pi and Debian Linux.

Web site Copyright Lewis Loflin, All rights reserved.
If using this material on another site, please provide a link back to my site.