Feb 16, 2015 0 Comments in LCD, Learning, SPI by
Managing the TFT LCD display controller ST7735

This product can be bought at our shop as:

This tiny TFT LCD display is the best way to add a small, colorful and bright display to any project. It’s quite impressive how a so small device can have so clear colours, in fact it has a true TFT driver (the ST7735 chip) that can display full 18-bit color (262,144 shades!).

The display is connected to the Cosino based board via a SPI bus and it can be managed as a normal Linux’s framebuffer device thanks to its driver, so the developer can easily move to it all his/her applications running over a framebuffer.

warning Note: the board has an on-board microSD slot which is not supported yet!

Connecting the device

In order to get access to the device you need to should consider the table below.

Mega 2560 extension

Signal J21
LITE
27
MISO 20
SCK 15
MOSI 18
TFT_CS 23
CARD_CS
D/C 11
RESET 12
GND 33
VCC 5

See the ST7735’s data sheet here for further info.

Accessing the device

In order to get access to the device from the user space you must configure the kernel accordingly.

warning Note: the following example is for Cosino Mega 2560 board but you can adapt it according to your hardware.

The SPI & backlight settings to put into the DTS file arch/arm/boot/dts/at91-cosino_mega2560.dts are reported below as a patch:

The you must configure the kernel enabling the framebuffer and backlight support as reported in the following patch:

For sake of simplicity you can find both patches here.

Then install the new kernel and reboot the system. If everything works well you should read the following kernel messages during the boot:

and Tux (the Linux logo) should appear during the boot.

Now, in order to test our new framebuffer device you can use the fim package to display some pictures on it. For instance by using the command:

I was able to put my social profile picture on the display!

Rodolfo Giometti on ST7735 TFT LCD

Facebooktwittergoogle_pluslinkedin
Tags:

Leave a Reply

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

− 7 = 3