Arduino: LCD with HD44780 Display Driver IC

I guess everyone who starts with Arduino will connect a LCD one day. There are several tutorials how to connect a LCD online. This page describes the usage of the "Noiasca Liquid Crystal".

The LCD Parallel Interface in 4 bit Mode

The "Noiasca Liquid Crystal" library is just one of many out there, supporting the 4 bit mode of a LCD directly connected to an Arduino. The class for the parallel interface comes more from curiosity: I have already written a library for I2C expanders, needed a SPI expander and had a "LCD keypad shield" from the early Arduino days laying around. Therefore I decided to combine all my LCD libraries into one and to implement the parallel LCD also.

LCD shield special characters

The Character Set of the HD44780U A00 ROM

The "Noiasca Liquid Crystal" library does just a little bit more than other libraries: a character mapping from UTF-8 to the existing characters in the Hitachi HD44780U A00 ROM. As example some special characters in the second row of the display:

special characters Arduino LCD

(Degree, Division, middle Point, n with tilde, Pound, Yen, Tilde, Sqareroot, Proportional to, Infinity, Left Arrow, Right Arrow, Backslash)

You can read more about this character mapping in the Introduction. For the beginning you should know that you don't need to enter the octal ROM addresses of the special characters manually and these outptus can be done by a simple:

lcd.print("°÷·ñ£¥~√∝∞←→\\");

The Hardware Driver for the LCD

The library offers a basic class for displays connected directly to GPIOs on the Arduino. It uses the 4bit mode only. Nevertheless two additional pins are needed for RS and EN. If you don't need the backlight pin, set it to 255.

The necessary #include and the constructor are:

#include <NoiascaLiquidCrystal.h> 
#include <NoiascaHW/lcd_4bit.h>
LiquidCrystal_4bit lcd(rs, en, d4, d5, d6, d7, bl, cols, rows);

Your own Character Converter

If you need a different converter for the characters you can hand over a callback function as optional last parameter.

Obviously - you also have to implement the callback function to do all the magic. See the general example how to write your own character converter.

German Umlauts

For my German readers: the default constructor enables the support for the small letters ä ö ü and ß. The large German umlauts Ä Ö Ü will be converted to their counterpart A O U. If you want to try other variants, you can use following constructors:

LiquidCrystal_4bit lcd(rs, en, d4, d5, d6, d7, bl, cols, rows);                      // Ä gets A
//LiquidCrystal_4bit lcd(rs, en, d4, d5, d6, d7, bl, cols, rows, convert_ae);        // Ä becomes Ae
//LiquidCrystal_4bit lcd(rs, en, d4, d5, d6, d7, bl, cols, rows, convert_small);     // Ä becomes ä
//LiquidCrystal_4bit lcd(rs, en, d4, d5, d6, d7, bl, cols, rows, convert_special);   // Ä becomes Ä

Summary

If you need an easy support of the given character set of a HD44870 display, take the "Noiasca Liquid Crystal" library in consideration.

Links

(*) Disclosure: Some of the links above are affiliate links, meaning, at no additional cost to you I will earn a (little) comission if you click through and make a purchase. I only recommend products I own myself and I'm convinced they are useful for other makers.

 

Protokoll

First upload: 2020-09-02 | Version: 2023-07-22