Summary of Interfacing PIC12F1822 with ST7735 SPI TFT display
This article explains how to interface a PIC12F1822 microcontroller with an ST7735 SPI TFT display using the CCS PIC C compiler. It involves using a specific driver for the ST7735 display, which can be downloaded and included in the project. The PIC12F1822 utilizes its internal oscillator with PLL for 32MHz operation and uses its SPI module for communication. The example is tailored for the ST7735R Black Tab variant, with instructions for other versions available. A simple circuit with resistors, power supply, and wiring on a breadboard is described.
Parts used in the PIC12F1822 and ST7735 SPI TFT Interface:
- PIC12F1822 Microcontroller
- ST7735R (or ST7735S) 1.8" SPI TFT Display
- 5 x 1K Resistors
- +5V Power Supply Source
- Breadboard
- Jumper Wires
This post shows how to interface PIC12F1822 microcontroller with ST7735 SPI TFT display using CCS PIC C compiler.
For this interfacing we need a driver for the TFT display. Driver topic at the following link:
ST7735 SPI TFT Display Driver for CCS PIC C compiler
Or you can just download it directly from the following link:
ST7735 SPI TFT Display Driver
Put the downloaded C file in your project folder.
Required Components:
- PIC12F1822 Microcontroller
- ST7735R (or ST7735S) 1.8″ SPI TFT Display
- 5 x 1K Resistors
- +5V Power Supply Source
- Breadboard
- Jumper Wires
PIC12F1822 and ST7735 SPI TFT Example Circuit:
In this project PIC12F1822 internal oscillator is used and MCLR pin function is disabled.
PIC12F1822 and ST7735 SPI TFT Example CCS C code:
PIC12F1822 Has 1 SPI module, this module is used in this interfacing.
My TFT display is ST7735R Black Tap (ST7735S) and for initializing this type of TFT display I used the following line:
TFT_BlackTab_Initialize();
If you have a TFT display with green or red tabs or a TFT with ST7735B controller read the driver topic above.
Note that green, red and black tabs have the same controller ST7735R.
The following line enables internal oscillator @ 8MHz and also the PLL which makes the microcontroller runs at 32MHz (8MHz x 4).
setup_oscillator(OSC_8MHZ | OSC_PLL_ON);
This code is compiled with CCS PIC C compiler versions 5.051.
for more detail: PIC12F1822 and ST7735 SPI TFT Example