FDCC LCD Alphanumeric Display Library for AVR


Hello World! I love robots

I would like to add an alphanumeric display to my AVR projects. I picked up this FDCC1604A 16×4 alphanumeric display from RS components.

I now require a library to simplify use over a variety of ATMEL based applications.

Download the source here:

These alphanumeric displays are controlled using a parallel bus which can operate in either 4-bit or 8-bit mode, with three control signals RS, RW and E

Signal Pin Values Description
RS – Register Select HIGH – Write to register
LOW – Send Command
When in write mode, set this pin high to write to DDRAM or CGRAM, otherwise write data on the data bus will be interpreted as a command
RW – Read/Write HIGH – Read mode
LOW – Write mode
Set high to read data form the bus and low to write data (send data or a command)
E – Enable HIGH – Can send and receive data
LOW – LCD can process data
The LCD controller can only process data when the enable pin is not pulled high. In order to send data or a command, must first ensure that the LCD is not currently busy, then
pulse the enable pin with data on the bus and RS and RW pins set accordingly.

I require several criteria for the library;

  • Expose as much functionality of the LCD as possible
  • Be able to individually set the pins of the MCU to correspond to pins of the LCD with minimal programming to change
  • Allow for either 4-bit or 8-bit bus mode
  • Work for any FDCCxxxxx model display. My code will conform to the data sheet of all of the displays, however I will be satisfied when it works for a FDCC1604A and a FDCC1602B as they are all I have available to me

Switching between 4-bit mode and 8-bit mode is a matter of commenting or un-commenting the LCD4bit define in the header. If this define is included then all
functions will be adjusted to work in 4-bit mode. This allows the same function set to be used for both 4-bit and 8-bit mode.

I have also created a set of defines In order to individually set which pins of which ports connect to the LCD, simply set the port letter and pin number in these defines: