Template: 2.4inch LCD for stm32 use

From Waveshare Wiki
Jump to: navigation, search

Hardware Connection

The examples are based on STM32F103RBT6 as well as the connection table. If you want to use other MCU, you need to port the project and change the connection according to the actual hardware.

Connect to STM32F103RBT6
LCD STM32
VCC 3.3V/5V
GND GND
DIN PA7
CLK PA5
CS PB6
DC PA8
RST PA9
BL PC7

Use Waveshare XNUCLEO-F103RB as examples
2.4inch LCD Module 006.jpg

About the examples

The examples use HAL libraries. Download demo codes, unzip, and find the STM32 projects. Open LCD_demo.uvprojx which is located in STM32\STM32F103RBT6\MDK-ARM directory by Keil project
LCD STM32 CODE1.png

Open main.c file, you can configure the types for actual displays, recompile the project and download it to your board.
LCD STM32 CODE2.png

LCD_0in96_test()    0.96inch LCD example
LCD_1in14_test() 1.14inch LCD example
LCD_1in3_test() 1.3inch LCD example
LCD_1in54_test() 1.54inch LCD example
LCD_1in8_test() 1.8inch LCD example
LCD_2in_test() 2inchLCDexample