Robostix LCD

Overview
This page shows how a 4 line by 20 character HD44780 based LCD can be connected to a robostix.

Background
This work is based on Peter Fleury's Interfacing a HD44780 Based LCD to an AVR using 4-bit mode. I looked at Peter's code, but I wanted something that was a bit more portable across processors, and that didn't require read mode. Omitting read mode allows the code to function when no LCD is present.

Connections
I chose to use Port A, which is on the back of the robostix. I used a straight header that had longer pins, and moved the black plastic towards the center and then bent the pins using my vise and a ruler.

Here's a photo of the installed pins:

This next photo shows the connectons to the LCD, which is basically identical to that shown in the interfacing article above. Note that the R/W line (on the LCD) can be tied to ground and then an extra pin is freed up.



The trim pot (blue square in the top left) was hot-glued to the LCD, and I traced the contrast, power and ground signals to slightly more convenient locations for the potentiometer.

Software
The software is split into several files. From robostix/Shared:


 * lcd.h describes the primary API.
 * lcd-api.c contains the core portion that is platform independant.
 * lcd-hal.h contains definitions shared between the lcd-api.c and the hal layer.

From robostix/Common:
 * lcd-hal-avr.c contains a HAL layer for the AVR.
 * lcd-stdio.h hooks into the C runtime library from avr-libc.

From robostix/LCD-Test is a sample program for testing. A photo of the output from LCD-Test looks like this: