Library 16- Interfacing HD44780 LCD controller with STM32F4

HD44780 LCD on STM32F4xx16th library is here. We will interfacing HD44780 (and its compatible) driver for alpha-numeric LCDs. Library supports up to 20 x 4 LCD size. It was tested with 20 x 4 (on picture) and with 16 x 2.

HD44780 Library

Features

  • 4bit 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

Library dependencies

  • CMSIS
    • STM32F4xx
    • STM32F4xx RCC
    • STM32F4xx GPIO
  • TM
    • TM DELAY
    • TM GPIO
    • defines.h
LCD STM32F4xx 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

If you need to change your pins, open defines.h files, add lines below and edit them.

Functions and enumerations

All possible functions are listed below.

Example

Project isĀ available onĀ Github, download library 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...