Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gavinlyonsrepo/hd44780_lcd_rpi
Library to support the HD44780 LCD , (I2C PCF8574 "backpack" interface) for the Raspberry PI.
https://github.com/gavinlyonsrepo/hd44780_lcd_rpi
bcm2835 display display-library hd44780 hd44780-display lcd lcd-display lcd-library lcd1602 lcd16x2 lcd2004 lcd20x4 library pcf8574 raspberry-pi raspberry-pi-3 raspberrypi raspeberry-pi rpi rpi3
Last synced: about 1 month ago
JSON representation
Library to support the HD44780 LCD , (I2C PCF8574 "backpack" interface) for the Raspberry PI.
- Host: GitHub
- URL: https://github.com/gavinlyonsrepo/hd44780_lcd_rpi
- Owner: gavinlyonsrepo
- License: gpl-3.0
- Created: 2022-03-05T23:03:29.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-11T11:47:29.000Z (11 months ago)
- Last Synced: 2024-02-11T12:35:09.207Z (11 months ago)
- Topics: bcm2835, display, display-library, hd44780, hd44780-display, lcd, lcd-display, lcd-library, lcd1602, lcd16x2, lcd2004, lcd20x4, library, pcf8574, raspberry-pi, raspberry-pi-3, raspberrypi, raspeberry-pi, rpi, rpi3
- Language: C++
- Homepage: https://gavinlyonsrepo.github.io/
- Size: 121 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Website](https://img.shields.io/badge/Website-Link-blue.svg)](https://gavinlyonsrepo.github.io/) [![Rss](https://img.shields.io/badge/Subscribe-RSS-yellow.svg)](https://gavinlyonsrepo.github.io//feed.xml) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/whitelight976)
![ lcd ](https://github.com/gavinlyonsrepo/pic_16F1619_projects/blob/master/images/LCDPCF.jpg)
# HD44780_LCD_RPI
## Table of contents
* [Overview](#overview)
* [Installation](#installation)
* [Test](#test)
* [Hardware](#hardware)
* [Software](#software)
* [I2C](#i2c)
* [Debug](#debug)
* [API](#api)
* [Output](#output)
* [Notes and issues](#notes-and-issues)
## Overview* Name : HD44780_LCD_RPI
* Description :0. Library to support the HD44780 LCD , (I2C PCF8574 "backpack" interface)
for the Raspberry PI.
1. Dynamic install-able system level Raspberry Pi C++ library.
2. Backlight, scroll, cursor and entrymode control.
3. Custom character support + print class for numerical data.
4. Hardware I2C using bcm2835 library
5. Dependency: bcm2835 Library
6. Tested on size 16x02 and 20x04 (but may work on other sizes eg 16x04 , untested)* Author: Gavin Lyons
* 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.74 dependency. Provides low level I2C bus, delays and GPIO control.## Installation
1. Install the dependency bcm2835 Library if not installed.
* Install the C libraries of bcm2835, [Installation instructions here](http://www.airspayce.com/mikem/bcm2835/)2. Download the HD44780_LCD_RPI library
* Open a Terminal in a folder where you want to download,build & test library
* Run following command to download from github.
```sh
curl -sL https://github.com/gavinlyonsrepo/HD44780_LCD_RPI/archive/1.3.3.tar.gz | tar xz
```3. Run "make" to run the makefile in repo base folder to install library, it will be
installed to usr/lib and usr/include
```sh
cd HD44780_LCD_RPI-1.3.3
make
sudo make install
```## Test
1. Next step is to test LCD and installed library with the example test file.
Wire up your LCD. Next enter the examples folder and run the makefile in THAT folder,
This 2nd makefile builds the example file using the just installed library.
and creates a test exe file in "bin".```sh
cd examples/
make
make run
```2. There are 5 examples files.
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: make & make run.| Filepath | File Function | Screen Size |
| ---- | ---- | ---- |
| src/HELLO_16x02 | Hello world basic use case | 16x02 |
| src/TEST_16x02 | Carries out test sequence testing features | 16x02 |
| src/TEST_20x04 | Carries out test sequence testing features | 20x04 |
| src/CLOCK_16x02 | A basic clock Demo | 16x02 |
| src/TEST_I2C_16x02 | Check I2C connection | 16x02 |## Hardware
Connections
1. LCD SCLK = SCLK1 I2C pins P1-05 GPIO3
2. LCD SDA = SDA1 I2C pins P1-03 GPIO2## Software
### I2C
Hardware I2C.
1. I2C Address is set by default to 0x27(your module could be different,
user can change argument passed into LCD class constructor).2. I2C Clock rate can be a passed into in the LCD class constructor method as a argument,
User can pass 1 of 4 BCM2835_I2C_CLOCK_DIVIDER values 2500, 626 150 or 148.
See image below.3. In the event of an error writing a byte, debug info with error code will be written to console.
This error code is the bcm2835I2CReasonCodes enum. Debug flag must be set to true to see this output.
See image below for bcm2835I2CReasonCodes. User can set error timeout between retry attempts and number of retry attempts
and can monitor the Error flag to see current bcm2835I2CReasonCodes.4. If you have multiple devices on I2C bus at different clock speeds.
The I2C clock speed function may have to called before each tranche of LCD commands.
and not just at start.![ bcm ](https://github.com/gavinlyonsrepo/SSD1306_OLED_RPI/blob/main/extras/image/bcm.jpg)
For more info on bcm2835I2CClockDivider & bcm2835I2CReasonCodes see [bcm2835 doc's for details](http://www.airspayce.com/mikem/bcm2835/group__constants.html)
### Debug
User can turn on debug messages with LCDDebugSet method see example file.
### API
The API (application programming interface) html documentation is at link. Hosted on github pages and generated by Doxygen software.
Here the user will find lots of information on files, functions & data types. *NOTE :: This API is for the Arduino source port*. It is very similar
expect constructor, I2C method's will be different.[Software API Url Link](https://gavinlyonsrepo.github.io/misc/software_docs/HD44780_LCD_PCF8574/index.html)
## Output
Output of custom character test in test file.
![ pic ](https://github.com/gavinlyonsrepo/HD44780_LCD_RPI/blob/main/extras/image/custom_output.jpg)
20x04 display.
![ pic2 ](https://github.com/gavinlyonsrepo/HD44780_LCD_PCF8574/blob/main/extras/image/2004.jpg)
## Notes and issues
1. For detailed graphical description of entry modes , cursor types, custom characters
and more see here [link](http://dinceraydin.com/lcd/commands.htm)2. 16X04 board not tested but should work
## See Also
[Combined Display library 'Display_Lib_RPI'](https://github.com/gavinlyonsrepo/Display_Lib_RPI)