Showing posts with label LCD Library. Show all posts
Showing posts with label LCD Library. Show all posts

Thursday, May 12, 2022

Displaying Bitmap images on ST7735 display from a memory card using an AVR microcontroller

This is an extension for the ST7735 display driver library made for displaying Bitmap images stored on an SD memory card on the ST7735 TFT display using an AVR microcontroller. The Bitmaps can be of 16-bit or 24-bit colors. Since the ST7735 display driver only accepts 16-bit colors, the 24-bit images will be converted to 16-bits.

Here is a short demo video:


The images must be resized first to fit the size of your display. A free and popular software for this task is Irfanview. Open the image using Irfanview then press CTRL+R, specify the new image size then save it as a .bmp and place the images on the memory card in a folder of your choice.

Saturday, February 5, 2022

Library for ST7735 TFT display driver for AVR microcontrollers

There are already some libraries for the ST7735 display driver such as the one from Adafruit but made only for Arduino. I needed one for AVR microcontrollers in general, so I made this one. With a bit of twiking it could also be adapted to work with other types of microcontrollers. This library is based on the one from Adafruit but with some functions removed, modified and others added. The interface needs 4 microcontroller pins and it uses SPI for communication.

Library for the ST7735 TFT display driver for AVR microcontrollers

Library for the ST7735 TFT display driver for AVR microcontrollers demo

There are many GUI elements that can be created and above are a few examples such as: selectable menus, scrollbars, check-boxes and animated icons. I made those in Inkscape for a battery charger project.

Contents:


Wiring the ST7735 TFT display

It is important to note that the power supply voltage for the ST7735 display driver is maximum 3.3V and same for the other input pins. Some TFT modules include a 3.3V regulator and a voltage level shifter in which case it can be used with 5V microcontrollers, if not some level shifting must be done if the microcontroller is not powered from 3.3V.

ST7735 connection diagram with voltage level shifter

This schematic is an example that also includes an SD card. Here, MISO is used for DC pin (Data/Command) since the ST7735 doesn't use the MISO in the 1-Wire SPI protocol, and also as MISO (Master In Slave Out) for the SD card. The 74AHC125D can't be used for this pin since is not bi-directional, hence the mosfet level shifter.

ST7735 connection diagram with voltage level shifters and pinout

1 - GND - ground power supply

2 - VCC - 3.3V power supply (minimum 150mA)

3 - SCL - SPI serial clock pin (SCK)

4 - SDA - SPI serial data input/output (MOSI)