- Name : ERM19264_UC1609
- Title : Library for ERM19264-5 v3 LCD (UC1609C controller) for the Arduino eco-system
- Description :
- Arduino eco-system library.
- Inverse, Scroll, rotate and contrast control.
- 6 ASCII fonts included.
- Graphics class included.
- Sleep mode.
- 3 different modes: Multi-buffer , single buffer , light weight text only
- Bitmaps supported.
- Hardware & software SPI options
- Author: Gavin Lyons
- Arduino IDE: 1.8.10
- History: See Changelog in extras/doc folder
- Copyright: GNU GPL v3
Output Screenshots, From left to right top to bottom.
- Full screen bitmap displayed
- Multi buffer mode screen divided into two buffers
- Different size and inverted default font
- ASCII font 1-127 printed out with default font size 1
- Fonts 5-6
- Fonts 1-4
The library is included in the official Arduino library manger and the optimum way to install it is using the library manager which can be opened by the manage libraries option in Arduino IDE.
See link below for instruction for this and for the other methods too.
Installing Additional Arduino Libraries guide
9 pins , Vcc and GND, anode and cathode for the backlight LED and an SPI interface. The example files are setup for an UNO for the pin connections used by for other MCU tested see extras folder GPIO_MCU_used.txt file. The backlight control is left up to user. If using Hardware SPI two of pins will be tied to the SPI CLK and MOSI lines if using software SPI you should be able use any GPIO you want for all five pins. Datasheets are in the extras folder.
There are 3 different colours in range, Parts used purchased from ebay
- ERM19264SBS-5 V3 LCD Display UC1609C controller , white on blue
- ERM19264FS-5 V3 LCD Display UC1609C controller , black on white
- ERM19264DNS-5 V3 LCD Display UC1609C controller white on black
The library was tested on 1 and 2. The Backlight should always be connected to 3.3V according to datasheets.
The ERM LCD module has a "662k" 3.3V regulator at back and by default setup is a 3.3V device. However if can also be run at 5V and connect to 5V device by Modifying jumper J1 on back. This wiring Diagram from the manufacturer showing hardware setup connected to an ~8051 MCU, showing both 3.3 volt and 5 volt systems. NOTE the J1 position. If J1 is shorted the LCD can connect to 5V , J1 bypasses the 3.3V regulator.
SPI
Hardware and software SPI. Two different class constructors. User can pick the relevant constructor, see examples files. Hardware SPI is recommended, far faster and more reliable but Software SPI allows for more flexible GPIO selection and easier to port to other MCU' s. When running Software SPI it may be necessary on very high frequency MCU's to change the UC1609_HIGHFREQ_DELAY define, It is a microsecond delay by default it is at 0. All the hardware SPI settings are defined in the header file and can be easily changed if necessary. It should be able to share SPI bus with other SPI devices on different SPI settings.
buffers
3 buffer modes
- MULTI_BUFFER (default)
- SINGLE_BUFFER
- NO_BUFFER , Text only no buffer , relatively light weight. Turns LCD into simple character LCD(216 characters). Default font only. Bitmaps can still be written directly to screen but no graphics possible.
To switch between modes, user must make a change to the USER BUFFER OPTION SECTION at top of ERM19264_UC1609.h file. Pick ONE option and one option ONLY. The example files at top, say which option to pick. If wrong option is picked, example files will not work or maybe even compile.
fonts
There are six fonts.
A print class is available to print out most passed data types.
The fonts 1-4 are a byte high(at text size 1) scale-able fonts.
Font 5-6 are specials large fonts but are numbers only and cannot be scaled(just one size).
Font 5-6 will print just numbers + semi-colons , if you print a float using print command
it will place a space and use a circle for a decimal point.
Font data table:
Font num | Font name | Font size xbyy | ASCII range | Size in bytes |
---|---|---|---|---|
1 | Default | 5x8 | Full Extended ASCII 0 - 0xFF | 1275 |
2 | Thick | 7x8 | no lowercase letters , ASCII 0x20 - 0x5A | 406 |
3 | Seven segment | 4x8 | ASCII 0x20 - 0x7A | 360 |
4 | Wide | 8x8 | no lowercase letters, ASCII 0x20 - 0x5A | 464 |
5 | Big Nums | 16x32 | ASCII 0x30-0x3A ,Numbers + : only | 704 |
6 | Med Nums | 16x16 | ASCII 0x30-0x3A ,Numbers + : only | 352 |
By default only Font 1 is commented in and ready to go to save memory. So to use a non-default Font (2-6), two steps.
- Comment in the respective define at top of library header file ERM19264_UC1609_graphics_font.h in the USER FONT OPTION ONE section
- Call SetFontNum function and pass it number of respective font. eg SetFontNum(2)
font mods
The default ASCII font (font one) is an extended ASCII font 0-255 characters. If you do not need characters 127-255 and wish to save memory space: In library header file ERM19264_UC1609_graphics_font.h in the USER FONT OPTION TWO section Simply comment this define out.
- UC_FONT_MOD_TWO (save 640 bytes) extended ASCII 127-255
You can also remove the first 30 characters if not needed but user will need to change ERM19264_ASCII_OFFSET from 0x00 to 0x20. This will save a further 150 bytes.
bitmaps
Bitmaps are written directly to screen unless Bitmap set to a buffer. Best to use multi-buffer to share screen between bitmaps and text + graphics. Bitmaps can be turned to data here at link use vertical addressing draw mode.
User adjustments
When the user calls LCDbegin() to start LCD they can specify a contrast setting from 0x00 to 0xFF. Datasheet says 0x49 is default. (VbiasPOT). Lower contrast works better on the blue version.
It is also possible for user to change LCD bias , Temperature coefficient, frame rate and power control but this must be done by changing defines in header file. Choose lower frame rate for lower power, and choose higher frame rate to improve LCD contrast and minimize flicker. See Data sheet for range of values here. Defaults where found to be fine during all testing of this library.
Parameter | default Values | Define | Register |
---|---|---|---|
LCD bias | 9 | BIAS_RATIO_SET | BR 1:0 |
Temp coefficient | -0.00%/ C | TEMP_COMP_SET | TC 1:0 |
Frame rate | 95 fps | FRAMERATE_SET | LC 4:3 |
Power control | 1.4mA + internal V LCD | PC_SET | PC 2:0 |
V bias Bot(contrast) | 0x49h default | Set by user with LCDbegin | PM 7:0 |
Functions
Functions: Detailed information on the functions can be found in comments in the ERM19264_UC1609.cpp file and a list of them in keywords.txt. The graphic functions can be found in the ERM19264_graphic.h file.
Src Files | Desc |
---|---|
ERM19264_UC1609.h | library header file |
ERM19264_UC1609.cpp | library source file |
ERM19264_graphics.h | Custom graphics header file |
ERM19264_graphics.cpp | Custom graphics source file |
ERM19264_graphics_font.h | Custom graphics font file |
Examples files ino | Desc | Buffer mode |
---|---|---|
BITMAP | Shows use of bitmaps | Several see notes |
GRAPHICS | Tests use of graphics | Multi_buffer |
MISC | Shows misc functions, rotate, invert etc | Multi_buffer |
MULTIBUFFER | Shows use of multi buffer mode | Multi_buffer |
NOBUFFER | Shows use of no buffer text only mode | No_buffer |
TEXT | Shows use of text and fonts, Fonts must be enabled | Multi_buffer |
SINGLEBUFFER | Shows use of single buffer mode | Single_buffer |
SWSPI | Shows use of software SPI | Multi_buffer |
HELLO | Hello world basic use case | Multi_buffer |
Tested on following MCUs both software and hardware SPI, The example files are setup for an UNO for the pin connections used by for other MCU testing see extras/doc folder GPIO_MCU_used.txt file.
- Arduino UNO & NANO v3
- ESP8266
- ESP32
- STM32 "blue pill"