STM32 ST7735 TFT Display SPI: A Complete Guide to Interfacing

by Marwen Maghrebi

This article covers interfacing STM32 with ST7735 color TFT display using SPI. You’ll learn about the required components, connections, and programming techniques to display graphics and text on the TFT screen.

STM32 ST7735 TFT Display SPI: Complete Interfacing Guide

Things used in this project

Software apps and online services:

1- STMicroelectronics STM32CubeMX

2- STMicroelectronics STM32CubeIDE

3- Proteus 8

Displaying Graphics and Text on ST7735 TFT LCD with STM32 Microcontroller:

This project involves interfacing STM32 with the ST7735 TFT display using SPI communication in Proteus simulation software. The purpose of this project is to demonstrate how to display graphics and text on the ST7735 display through interfacing STM32 with ST7735 TFT display using SPI.

 

ST7735 Display Module Overview: Features and Capabilities:

The ST7735 display is a small, color TFT LCD display module that supports a resolution of 128×160 pixels. It has an integrated controller that supports SPI communication protocol for transferring data to the display. The ST7735 display is capable of displaying up to 18-bit color depth, which means it can display up to 262,144 colors.

Configuring Pins for STM32 to ST7735 Display Interfacing:

To interface the STM32 microcontroller with the ST7735 display, we need to connect the SPI pins of the microcontroller to the corresponding pins of the display module. The SPI pins include MOSI (Master Output Slave Input), MISO (Master Input Slave Output), SCK (Serial Clock), and CS (Chip Select). We also need to connect the power and ground pins of the display module to the corresponding pins of the microcontroller.

Overall, this project provides example of how to interface an STM32 microcontroller with an ST7735 display using SPI communication protocol in a Proteus simulation environment.

STM32CubeMX Configuration:

  • Open CubeMX & Create New Project Choose The Target MCU STM32F103C6 & Double-Click Its Name
  • In the Categories tab, select the RCC High Speed Clock (HSE) to Crystal/Ceramic Resonator
  • Go To The Clock Configuration & Set The System Clock To 72MHz
  • Configure The GPIO Pins [PB12..PB15] as Output Pin
  • In the Categories tab, select the SPI1 & Transmit Only Master
  • In the Parameter settings tab, set the Prescaler (for baud Rate) to 16
  • Generate The Initialization Code & Open The Project In CubeIDE

STM32CubeIDE Configuration :

  • Write The Application Layer Code
  • t7735_cfg.h
  • ST7735.h  & ST7735.c 
  • fonts.h & fonts.c
  • testimg.h
  • main.c

Proteus Configuration :

  • Open Proteus & Create New Project and click next

  • Click on Pick Device
  • Search for STM32F103C6 & ST7735R
  • Click on Terminal Mode then choose (DYNAMIC&POWER &GROUND)
  • finally make the circuit below and start the simulation
Interfacing STM32 with ST7735 Color TFT Display via SPI

That’s all!

If you have any questions or suggestions don’t hesitate to leave a comment below.

You Might Also Like

2 comments

shin dj July 19, 2024 - 6:36 am

#include “testimg.h”
const uint16_t test_img_128x128[][128] = {
{0x0B6B,0x0B63,0x0B6B,0x2B6B,0x2B6B,0x2B6B………………………….};
What program was it converted with?

Reply
Marwen Maghrebi July 19, 2024 - 7:31 am

The image array test_img_128x128 was converted using the LCD Image Converter software. This tool allows you to convert images into arrays suitable for displaying on various LCDs and graphical displays. You can download and learn more about the software at the following link: LCD Image Converter.

Reply

Leave a Comment


Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
-
00:00
00:00
Update Required Flash plugin
-
00:00
00:00