Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Raspberry pi C++ library for ERM19264-5 v3 LCD (UC1609C controller)

License

NotificationsYou must be signed in to change notification settings

gavinlyonsrepo/ERM19264_UC1609_RPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 ERM19264

ERM19264_UC1609_RPI

Table of contents

Overview

  • Name : ERM19264_UC1609_RPI
  • Title : Library for ERM19264-5 v3 LCD (UC1609C controller)
  • Description :
  1. Dynamic install-able system level Raspberry Pi C++ library.
  2. Inverse, Scroll, rotate and contrast control.
  3. 6 standard ASCII font + glyph font support
  4. Graphics class included.
  5. Sleep mode.
  6. Bitmaps supported.
  7. Hardware & software SPI options
  8. Dependency: bcm2835 Library
  9. See also :Combined Display library 'Display_Lib_RPI'
  • Author: Gavin Lyons

  • This is a port of myArduino libraryMore details there as well as link to the API(There are some differences between this port and Arduino library most notably use of glyph fonts)

  • Development Tool chain.

    1. Raspberry PI 3 model b
    2. C++, g++ (Debian 12.2.0)
    3. Raspbian , Debian 12 bookworm OS, , 64 bit.
    4. kernel : aarch64 Linux 6.1.0-rpi7-rpi-v8
    5. bcm2835 Library 1.73 dependency. Provides low level I2C bus, delays and GPIO control.

Output

Output Screenshots, From left to right top to bottom.

  1. Full screen bitmap displayed
  2. FPS example test.
  3. Different size and inverted ASCII fonts.
  4. ASCII font 0-127 printed out (128-255 also available)
  5. Glyph fonts

opop

Installation

  1. Install the dependency bcm2835 Library if not installed (at time of writing latest version is 1.73)

  2. Download the ERM19264_UC1609_RPI library

    • Open a Terminal in a folder where you want to download,build & test library
    • Run following command to download from github.
curl -sL https://github.com/gavinlyonsrepo/ERM19264_UC1609_RPI/archive/1.7.1.tar.gz| tar xz
  1. Run "make" to run the makefile to install library, it will beinstalled to usr/lib and usr/include
cd ERM19264_UC1609_RPI-1.7.1makesudo make install

Test

  1. Next step is to test LCD and installed library with an example.Wire up your LCD. Next enter the examples folder and run the makefile in THAT folder,This makefile builds the examples file using the just installed library.and creates a test exe file in "bin". User should see "hello world"on the LCD screen by end of this step.
cd examples/makemake run
  1. There are seven examples files to try out.To decide which one the makefile builds simply edit "SRC" variable at top of the makefile in examples folder.In the "User SRC directory Option Section". Pick an example "SRC" directory path and ONE ONLY.Comment out the rest and repeat step 1.

Hardware

9 pins , Vcc and GND, anode and cathode for the backlight LED and an SPI interface.The backlight control is left up to user , connect to 3.3V thru a resistor.If using Hardware SPI 3 pins will be tied to the SPI CEO, CLK and MOSI lines. if using software SPI you should be able use any GPIO you want for all five pins. Datasheets URLS are in the extras folder.

There are 3 different colours in range, Parts used purchased fromebay

  1. ERM19264SBS-5 V3 LCD Display UC1609C controller , white on blue
  2. ERM19264FS-5 V3 LCD Display UC1609C controller , black on white
  3. ERM19264DNS-5 V3 LCD Display UC1609C controller white on black

Wiring Diagram from supplier showing connection to RPI.

 ERM19264

This wiring Diagram from the manufacturer showing hardware setup connected to an ~8051 MCU, showing both 3.3 volt and 5 volt systems.Note status of J1 PCB jumper.

 ERM192642

Software

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 allowsfor more flexible GPIO selection. When running Software SPI it may be necessary on very highfrequency MCU's to change the LCD_HighFreqDelaySet method, It is a microsecond delay by default it is at 0.

The SPI settings are in LCDSPIon function.Speed is currently at BCM2835_SPI_CLOCK_DIVIDER_64.6.25MHz on RPI3. This can be adjusted in code or user can passthe divider value in the "begin" method as a parameter. These values aredefined by enum bcm2835SPIClockDivider. For full list seelink.User can also adjust which SPI chip enable pin the use uing "begin" method parameter.

Fonts

There are 6 standard scale-able ASCII fonts.A print class is available to print out most passed data types.The fonts 1-6 are byte high(at text size 1) scale-able fonts, columns of padding added by SW.The example file TEXT_GRAPHICS shows how to use these.

Six standard fonts available :

Font numFont nameFont size xbyyNote
1Default5x8Full Extended ASCII 0 - 0xFF
2Thick7x8no lowercase letters , ASCII 0x20 - 0x5A
3Seven segment4x8ASCII 0x20 - 0x7A
4Wide8x8no lowercase letters, ASCII 0x20 - 0x5A
5Tiny3x8ASCII 0x20 - 0x7E
6Homespun7x8ASCII 0x20 - 0x7E

In addition to those 6 fonts, The ability to use glyph-fonts is alsoavailable. I have packaged four fonts with the library, these are not installedin the system but are in the include folder of examples.The example file FONTS_GLYPH shows how to use these.The Font structures are in the ERM19264_gfxfont.h file.To use a font in your program, #include the corresponding .hfile and pass address of GFXfont struct to setFont().Other fonts are available from the Adafruit GFX arduino library.If you copy over other fonts remove the PROGMEM keyword. Lots more detail there onhow these fonts are created and work.The glyph-fonts use 3 special functions: setFontGlyph drawCharGlyph drawTextGlyph.They cannot currently use the print class, also cannot be inverted.Inverting only works with the standard fonts because the characters are a uniform size. It's not a sensible thing to do with proportionally-spaced fonts with glyphs of varying sizes and that may overlap.

Bitmaps

There is a few different ways of displaying bitmaps,

NumMethodData addressingNote
1LCDBitmap()VerticalWrites directly to screen , no buffer used.
2LCDBuffer()VerticalFor internal use mostly
3buffer initVerticalCan be used when initialising at start up
4drawBitmap()Verticaldefault, setDrawBitmapAddr(true)
5drawBitmap()HorizontalsetDrawBitmapAddr(false)

See the bitmap example file for more details on each method. Bitmaps can be turned to datahere at link , Bitmaps should be defined as const buffers non-const, for methods 3 buffer can be initialised with bitmap data.

User Adjustments

If the LCD does not initialize correctly.Try adjusting the RAM address control setting from 0x02 to 0x01. It can be set in LCDbegin() argument list.See github issue 4 at the Arduino source port github repository for more details, link in overview.

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 color 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.

Parameterdefault ValuesDefineRegister Bits
LCD bias9BIAS_RATIO_SETBR 1:0
Temp coefficient-0.00%/ CTEMP_COMP_SETTC 1:0
Frame rate95 fpsFRAMERATE_SETLC 4:3
Power control1.4mA + Internal VLCD (7x charge pump)PC_SETPC 2:0
V bias Bot(contrast)0x49Set by user with LCDbeginPM 7:0
Ram Address Control0x02Set by user with LCDbeginAC 2:0

Notes and Issues


[8]ページ先頭

©2009-2025 Movatter.jp