Character LCD Displays

In this section, we'll work with Hitachi HD44780 compatible LCD (Liquid Crystal Display) modules. These character LCDs have been used for decades in everyday devices like printers, digital clocks, microwaves, and countless other appliances.

LCD Variants

HD44780-compatible LCDs come in different formats:

I2C vs Parallel Interface

Parallel Interface: Connects multiple GPIO pins directly to the LCD. Requires more wiring (around 12 connections) but provides direct control.

I2C Interface: Uses an I2C adapter board that simplifies wiring to just 4 connections (VCC, GND, SDA, SCL). The adapter includes a built-in potentiometer for contrast adjustment.

We'll Use I2C

In this book, we'll use the I2C version because it's much simpler to wire and doesn't require external components for contrast control. The I2C adapter (usually address 0x27 or 0x3F) handles all the parallel signals internally.

Wiring the LCD (I2C)

LCD PinPico PinNotes
GNDGNDCommon ground
VCCVBUS5V power supply
SCLGPIO 17I2C clock line
SDAGPIO 16I2C data line

Character Grid: 5x8 Pixels

Each character on a 16x2 LCD is formed using a 5x8 pixel matrix. That means every character uses 5 vertical columns and 8 horizontal rows of tiny dots. The HD44780 controller automatically handles displaying ASCII characters.

Custom Characters

Besides standard ASCII characters, you can create up to 8 custom characters (glyphs) using the 64 bytes of Character Generator RAM (CGRAM). Each glyph uses 8 bytes (one per row), where each byte defines which pixels are on or off in that row.

Projects Covered

  • Display "Hello, Rust!" text
  • Create and display custom glyphs (like a Ferris crab symbol)
  • Combine multiple cells for larger symbols
  • Use the custom glyph generator tool

Contrast Adjustment

When using an I2C LCD module, adjust the small potentiometer on the I2C adapter board to set the contrast. Turn it slowly until the characters are clearly visible.

Complete code examples using the hd44780-driver and liquid_crystal crates are available for both Embassy and rp-hal implementations.