Interfacing STM32 Blue Pill with ST7735 Color TFT Display

This is another project using STMicroelectronics ARM Cortex-M3 microcontroller based STM32F103C8T6 Blue Pill development board.
In this post we will see how to interface the ST32 Blue Pill board with ST7735 color TFT display where Arduino IDE software is used to write the interfacing program code. We will also see the simulation of the STM32F103C8T6 Blue Pill board with the ST7735 TFT display using Proteus simulation software.

The ST7735 TFT display is a color display with diagonal size of 1.8″ and resolution of 128×160 pixels. This display uses SPI protocol for the communication with master device which is in this example the STM32 Blue Pill board microcontroller STM32F103C8T6.
The ST7735 TFT display module usually comes with an SD card slot which allows -when SD card inserted- the storage of large size files such as images in order to print them in the display (not used in this project).
This module works with 3.3V only, connecting it directly to a 5V system will not work and may damage its controller circuit!

The display which is used in this project is shown below (face):

ST7735S SPI TFT display face

and the back of the display module:

ST7735S SPI TFT display back

As shown in the back of the display module image there is AMS1117 3V3 voltage regulator IC, it’s used to supply the display controller circuit with 3.3V from an input supply of 5V (because it does work with 3.3V only).
Also, we can disuse the built-in voltage regulator (AMS1117 3V3) if we already have a regulated voltage source of 3.3V, here we have to close (solder) jumper J1 (red ellipse).
In this example I’m going use 3.3V from the STM32 Blue Pill board, so I have to close J1 jumper.

Interfacing STM32F103C8T6 Blue Pill with ST7735 TFT display circuit:
Project circuit schematic diagram is shown below.

The ST7735S shown in project circuit diagram has 8 pins: (from right to left): RST (reset), CE (chip enable), DC (or D/C: data/command), DIN (data in), CLK (clock), VCC, BL (back light) and Gnd (ground).

Interfacing STM32F103C8T6 Blue Pill with ST7735 TFT display circuit

Hardware required:
This is a summary of circuit required parts.

  • STM32 Blue Pill board   —> STM32F103C8T6 32-bit Arm Cortex-M3 MCU
  • ST7735 TFT display module
  • Breadboard & jumper wires…
  • FTDI FT232RL USB-to-UART converter (for burning program file to the MCU)

Circuit description:
The main power source of the circuit comes from the micro USB port of the STM32 Blue Pill board with voltage of 5V. The board contains a voltage regulator that feeds the STM32F103C8T6 microcontroller with 3.3V. The ST7735 display module is powered with 3V3 from the STM32 Blue Pill board where its ‘VCC’ & ‘BL’ pins are connected to ‘3.3V’ pin of the BluePill board.

The ST7735 display is connected to the STM32F103C8T6 Blue Pill board as follows:
RST pin is connected to pin PA2 of the Blue Pill board,
CS pin is connected to pin PA3 of the Blue Pill board,
D/C pin is connected to pin PA4 of the Blue Pill board,
CLK pin is connected to pin PA5 of the Blue Pill board,
DIN pin is connected to pin PA7 of the Blue Pill board,
VCC and BL are connected to pin 3V3,
GND is connected to pin GND of the Blue Pill board board.

Pins PA5 and PA7 are hardware SPI1 module pins of the STM32F103C8T6 microcontroller respectively for SCK (serial clock) and MOSI (master-out slave-in).

Interfacing STM32 Blue Pill with ST7735 display Arduino code:
Arduino IDE is used to write project code, the STM32 Blue Pill board has to be added to the IDE before compilation.
The STM32 Blue Pill board can be installed using Arduino IDE Boards Manager.
Project Arduino code is just an example of graphics test provided by Adafruit Industries with the ST7735 display library.

The FT232RL USB to serial UART converter is used to program the STM32F103C8T6 microcontroller, the ST-LINK V2 programmer also can be used and it is supported by the Arduino IDE.

The following Arduino code requires two libraries from Adafruit Industries:
The first library is a driver for the ST7735 TFT display which can be installed from Arduino IDE library manager (Sketch —> Include Library —> Manage Libraries …, in the search box write “st7735” and install the one from Adafruit).
The second library is Adafruit graphics library which can be installed also from Arduino IDE library manager.
During installation of the Adafruit ST7735 library Arduino IDE may ask for installing some other libraries form Adafruit Industries.

Hints:
The used libraries are included in the Arduino code as shown below:

The connection between the STM32 Blue Pill board and the ST7735 display is as shown in the above circuit schematic, it is defined in the Arduino code as shown below:

And the initialization of the ST7735 display library with the connections previously defined:

Full Arduino code:

The below video shows my DIY circuit for this project:

Proteus Simulation:
The interfacing of ST32F103C8T6 Blue Pill with ST7735 display project can be simulated using Proteus simulation software as shown in the video below:

Proteus simulation file download:
Interfacing STM32F103C8T6 Blue Pill with ST7735 display Proteus simulation file download link is below, use Proteus version 8.15 or higher to open it.
Download

And the link below is Proteus library for the STM32F103C8T6 Blue Pill board. After the download put the file in Proteus library folder, for example in my case Proteus library folder path is: C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\Library
Proteus library for the STM32F103C8T6 Blue Pill board

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top