Hello there!

This is just a quick post on how to use a color SPI LCD (with a ST7735 controller) with your STM32L4 microcontroller. I am using Oleg Yakovlev’s library with just some minor modifications (mostly to adapt it to the current ST HAL API and to the STM32L432).

Oleg’s library does not rely on a frame buffer inside MCU RAM, instead it writes directly into the LCD controller memory, this results in a very low RAM usage. The LCD is configured to work in 16-bit RGB565 mode, thus a maximum of 65,536 colors are allowed (the controller can work with up to 18-bit colors or 262,144 colors, but you would need to change some lines of code, specially because in this mode each pixel is represented by a 3-byte sequence in an SPI transmission, while in RGB565 each pixel is compressed in a 2-byte sequence).

The library includes functions for drawing pixels, lines, boxes and circles. There are also functions for drawing text using included 8×12 and 16×16 character fonts.

My code for the STM32L432KC is available in my GitHub account: https://github.com/fabiopjve/ST7735 and includes all the necessary files to make it work on a Nucleo 32 board (even the CubeMX ioc project file).

The next step will be to write a port of it to the RISC-V microcontroller!

Best

Using a color ST7735-based SPI LCD with the STM32L432 microcontroller
Tagged on:                             

Leave a Reply