Skip to content

ximtech/HD44780

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HD44780

STM32 LL(Low Layer) GPIO library for LCD. Works for both 16x2 and 20x4 etc.

Features

  • Small code footprint
  • Supports progress bar
  • Display printf function
  • No HAL dependencies

LCD 16x2

image

LCD 20x4

image

Add as CPM project dependency

How to add CPM to the project, check the link

CPMAddPackage(
        NAME HD44780
        GITHUB_REPOSITORY ximtech/HD44780
        GIT_TAG origin/main)

Project configuration

  1. Start project with STM32CubeMX:
  2. Set output pins
  3. Select: Project Manager -> Advanced Settings -> GPIO -> LL
  4. Generate Code
  5. Add sources to project:
include_directories(${includes}
        ${HD44780_LCD_DIRECTORY})   # source directories

file(GLOB_RECURSE SOURCES ${sources}
        ${HD44780_LCD_SOURCES})    # source files
  1. Then Build -> Clean -> Rebuild Project

Wiring

image

Usage

In HD44780_LCD.h default defines. Override them in main.h if needed

#define HD44780_LCD_COL_COUNT 20
#define HD44780_LCD_ROW_COUNT 4

//#define HD44780_USE_8_BIT_MODE    // define LCD working mode, choose 4 or 8 bit mode, but not both
#define HD44780_USE_4_BIT_MODE

#define HD44780_USE_CUSTOM_PORT // override values in main.h declaring custom define ports 
#define LCD_PORT GPIOA  // Pin and port for 4 bit mode, for 8 bit mode see declarations in HD44780_LCD.h

#define LCD_RS LL_GPIO_PIN_9
#define LCD_EN LL_GPIO_PIN_10

#define LCD_D4 LL_GPIO_PIN_0
#define LCD_D5 LL_GPIO_PIN_1
#define LCD_D6 LL_GPIO_PIN_5
#define LCD_D7 LL_GPIO_PIN_6