Tutorial : interfacing an I2C LCD Display with STM32L4

Document created by jean-christophe Toussaint on Mar 17, 2018Last modified by Brian Kling on Jun 18, 2018
Version 5Show Document
  • View in full screen mode

The I2c protocole is commonly used for establishing communication between master and

slaves at low speed.


The hd44780 is a widespread common LCD controller allowing to drive various formats of LCD displays made of 1 line with 8 characters (1X8), 2X16, 2X20, 4x20 or others.

It can be driven through a pcf8574 device which provides general-purpose remote I/O expansion by way of the I2C interface [serial clock (SCL), serial data (SDA)].


This example was developed using the System Workbench for STM32 programing environment (sw4stm32 eclipse)


The following equipment is used

-  NUCLEO-L476RG Board or equivalent and a HD44780 LCD with a PCF8574 expander like Quimat IIC/I2C/TWI Serial 2004 20x4 LCD Module

-  Eclipse with the necessary packages for Nucleo boards installed

-  OpenOCD or STLink USB Driver - STM32CubeMX


The goal of this tutorial is aimed at showing to hobbyists and students how to develop and to use a small I2C library for LCD displays.


JC Toussaint

full professor @ phelma Grenoble Institute of Technology

4 people found this helpful