Interfacing PIC12F1822 with ST7735 SPI TFT display
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.
- PIC12F1822 Microcontroller
- ST7735R (or ST7735S) 1.8″ SPI TFT Display
- 5 x 1K Resistors
- +5V Power Supply Source
- 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:
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