HAL library 15- HD44780 for STM32Fxxx

HD44780 LCDs are still very popular devices in embedded project so I think you can’t without simple library for them. I’ve port my old library to HAL based libraries for these LCDs.

Library

Read more about new HAL libraries

Features

  • 4-bits operation mode
  • Minimum GPIOs used (6)
  • Supports different LCD sizes
  • Supports up to 8 custom characters
  • Enable/disable cursor blinking
  • Show/hide cursor
  • Shift content in ram left/right
  • Connection pins to board are user selectable
  • Automatically jumps to new line when you reach max X on LCD
  • Strings with \n, \r or \n\r
    • With \n in string LCD jumps to lower line, but X position stays the same
    • With \r in string LCD jumps to the beginning of the line
    • With \n\r in string LCD jumps to the beginning of a new line

Dependencies

  • HAL
    • STM32Fxxx HAL
    • defines.h
    • TM GPIO
    • TM DELAY

Default pinout

LCD STM32Fxxx DESCRIPTION
GND GND Ground
VCC +5V Power supply for LCD
V0 Potentiometer Contrast voltage. Connect to potentiometer
RS PB2 Register select, can be overwritten in your project’s defines.h file
RW GND Read/write
E PB7 Enable pin, can be overwritten in your project’s defines.h file
D0 Data 0 – doesn’t care
D1 Data 1 – doesn’t care
D2 Data 2 – doesn’t care
D3 Data 3 – doesn’t  care
D4 PC12 Data 4, can be overwritten in your project’s defines.h file
D5 PC13 Data 5, can be overwritten in your project’s defines.h file
D6 PB12 Data 6, can be overwritten in your project’s defines.h file
D7 PB13 Data 7, can be overwritten in your project’s defines.h file
A +3V3 Backlight positive power
K GND Ground for backlight

Custom settings

In case, you need to change any pin for your end project, you can open defines.h file and edit settings you need from library.

Functions and enumerations

Example

Project is available on Github, download all libraries below.

tilz0R

Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...