Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Resource icon

K8LH 2-Pin 74HC595 LCD "8-bit" Backpack 2014-05-23

Here's a relatively simple Backpack design for HD44780 type LCD character displays that requires just two I/O pins on the host microcontroller while driving the LCD display in its "8-bit" interface mode. You should also be able to use a 74HC164 shift register instead of a 74HC595 (untested).

K8LH 2-Pin Backpacks.png


Theory of Operation

Note that the 'E' line from the microcontroller is directly connected to the 'RCK' pin on the 74HC595 and the 'E' pin on the LCD. In this way the 'E' line performs double duty by latching data from the 74HC595 internal shift register onto its outputs during the rising edge of the 'E' signal pulse and then writes those 8 data bits, as well as the LCD 'RS' bit, to the LCD on the falling edge of the 'E' signal pulse.

The 'CLK' line from the microcontroller is directly connected to the 'SCK' (serial clock) pin on the 74HC595 and the 'RS' (register select) pin on the LCD. The 'CLK' pin also drives an RC integrator which in turn drives the 'SER' shift register data input pin on the 74HC595. This configuration allows the 'CLK' line to produce both the data and clock signals used to load the 74HC595 shift register as well as the 'RS' signal used to write the LCD.

RC integrator component values were chosen for a a time constant (tau) of 3.3-us which is just long enough to accommodate PIC clock speeds down to a minimum of 4-MHz (Tcy = 1-us). Clocking a bit into the 74HC595 shift register involves setting the 'CLK' line to either '1' or '0' and waiting ~10-us to charge or drain the RC integrator before taking the 'CLK' line low and then high to shift the '0' or '1' level on the integrator output into the 74HC595 shift register via the 'SER' input.

The chart below shows the 'CLK' signal (integrator input) in pink and integrator output to the 74HC595 'SER' pin in blue. The '0' or '1' value on the 'SER' pin is clocked into the 74HC595 on each 'CLK' rising edge. Note that the time required to write a byte (and 'RS' bit) to the LCD is approximately 100-us.

rc timing.png


Example Low-Level Drivers in C (BoostC)

Example Backpack low-level drivers are provided in the program attached below. It's for a PIC18F14K22 device and it was written using the free/lite version of BoostC. The RA1 and RA2 I/O pins connect to the Backpack 'CLK' and 'E' lines, respectively.

Have fun... Cheerful regards, Mike

K8LH 2-Pin LCD front.pngK8LH 2-Pin LCD back.pngK8LH 2-Pin 74HC595 8-Bit 1st Try.jpg
  • K8LH 2-Pin LCD front.png
    K8LH 2-Pin LCD front.png
    463.9 KB · Views: 1,305
  • K8LH 2-Pin LCD back.png
    K8LH 2-Pin LCD back.png
    565.3 KB · Views: 1,358
  • K8LH 2-Pin 74HC595 8-Bit 1st Try.jpg
    K8LH 2-Pin 74HC595 8-Bit 1st Try.jpg
    58.4 KB · Views: 1,315
  • rc timing.png
    rc timing.png
    17.8 KB · Views: 3,212
  • 18F14K22 2-Pin 8-Bit Demo.zip
    2.6 KB · Views: 1,058
  • K8LH 2-Pin Backpacks.png
    K8LH 2-Pin Backpacks.png
    52.9 KB · Views: 5,682
  • Like
Reactions: upand_at_them
Author
Mike - K8LH
Views
9,487
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Mike - K8LH

Latest threads

New Articles From Microcontroller Tips

Back
Top