Arduino: The Noiasca Liquid Crystal for 4004 displays
On
this page I want to show how to use a 40 characters 4 rows display with my
Noiasca Liquid Crystal library.
These 4004 LC displays basically consist of two 4002 displays. Therefore they have two enable lines and you will need an additional pin to drive the second enable line. As the library needs to know which logical driver should be used, the library must track which line you are currently using. Dependig on the line either IC 1 or IC2 will be activated.
As always you have to include the library and the respective hardware implementation:
#include <NoiascaLiquidCrystal.h> // use the adopted library downloaded from https://werner.rothschopf.net/202003_arduino_liquid_crystal_umlaute.htm #include <NoiascaHW/lcd_4bit.h> // parallel interface, 4bit
The constructor will need a lot of parameters, so it is a good idea to define some constants:
const byte cols = 40; // 40 columns/characters per row (must be correct for the 40x4) const byte rows = 4; // 4 rows const byte rs = 8; // RS pin const byte rw = 255; // RW pin is not used, therefore you must set it to 255 const byte en = 9; // enable pin for first IC (upper rows) const byte en2 = 11; // enable pin for second IC (lower rows) const byte d4 = 4; // data pin const byte d5 = 5; // data pin const byte d6 = 6; // data pin const byte d7 = 7; // data pin const byte bl = 255; // set to 255 if not used const t_backlightPol blType = POSITIVE; // set to either POSITIVE, NEGATIVE
At the time of the implementation the RW pin is not used. Don't forget to connect the RW pin to GND! If you leave this LCD pin floating, it's very likely that the display isn't showing anything at all.
The type of backlight defines if the backlight pin is HIGH active or LOW active. Currently only POSITIVE is supported.
When you have each parameter defined you can define your LCD object with all 12 parameters:
LiquidCrystal_4bit lcd(rs, rw, en, en2, d4, d5, d6, d7, bl, blType, cols, rows);
By default, some special characters and the German Umlauts will be printed accordingly. If you want to use another character converter, you can add a callback function:
LiquidCrystal_4bit lcd(rs, rw, en, en2, d4, d5, d6, d7, bl, blType, cols, rows, convert_small); // a converter (Ä gets ä)
If you want to learn more about character converting, you can read here.
Caveats
Currently only the parallel interface will supports the 40 x 4 LCD. This is due to the additional needed pin I would lose backlight control if you use an 8 channel expander.
Summary
With the additional language converters it becomes very easy to print Cyrillic letters in pure ASCII (lower ANSI) on a standard LCD. If you need true Cyrillic support you should consider to buy a specific SPLC780D1 002A LCD - which is also covered by the Noiasca Liquid Crystal library.