adafruit st7735 tft display made in china
While I was looking for a TFT display for a project with Arduino, I found on several webstores some displays based on the ST7735 chip by Sitronix (datasheet).
Based on its datasheet, the ST7735 chip has a SPI (Serial Peripheral Interface) interface, but the pin names on the silk screen of my display “seem” to suggest an I2C interface (SDA, SCL…):
Adafruit wrote a fantastic tutorial to explain how to use them, here I only want to show you how to setup the display for the connections I made earler:
If you’re using a board based on the esp32 chip and you need to display bitmap images, give a look to my library, SPIFFS_ImageReader, which perfectly integrates with the ones by Adafruit!
If anyone has one of these displays that you thought was broken, here is a working sketch based on an 8051 driver example I received from the Chinese vendor. Perhaps it will help get someone started... I took the function initial() from this sketch and added it to Bodmers ST7735_init.h for my "BLUETAB" version which is the subject of this topic.
I have attached a couple wiring diagrams I tried. There have been several other variations, but I"m having second thoughts. The ONLY example of someone hooking up TFT display was different display using pins that made no sense to me (image name timestamped 09:28.10 PM). I tried it, but didn"t work. The other diagram attempts to use pins called out in the graphicstest sketch.
So, trying to Google for tutorials, other examples of successful running TFT display from MKR1000 turned up nothing. Additionally, I tried digging in to variant.h files, libraries, ports, etc. as brought up in yours and other"s posts, and I wasn"t able to make enough sense of it all.
So, it"s dawning on me that I am barking up the wrong tree. Either I am really missing something very fundamental, or based on the lack of anything on the forums or web in general on hooking up a TFT Display, at least ST7735, to a MKR1000, it just isn"t ready for plug-n-play guys like me. Has it been done? Is it intended to be done? I can see no indication that it has.
I haven"t included a wiring diagram but my test sketch below lists the pins to which I"m connecting the TFT on each of the three Arduino boards I"ve tried.
The TFT display is a kind of liquid crystal LCD that is connected to each pixel using a transistor and it features low current consumption, high-quality, high-resolution and backlight. This 1.8-inch full color LCD has a narrow PCB screen. The resolution is 128×160 pixels and it has a four-wire SPI interface and white backlight. The driver is ST7735R.
testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", ST7735_WHITE);
In this blog I will show how to connect a 0.96" IPS color display that is 80x160 pixels to Arduino Nano. Then I will try the new Arduino Web Editor to create and later to share this project.
Sometimes it is handy to have a small screen in your Arduino project. The 0.96 inch IPS color diplay is perfect for this. You can get the original Adafruit Color TFT display with SD card readerfor this for $20 (excluding shipping costs), but you can also find a clone on Chinese reseller websites or eBay. Mine did not include a SD card reader, but it was $3 (including shipping).
What is also handy about the Web Editor is that you don"t need to install any libraries. As you will see, in my project I use some Adafruit libraries, but did not have to do anything to call the extra library functions. I just compiled without any errors or warnings.
In my case I also needed a part that was not in the Fritzing database. Luckily there is a community that submits parts. It is located on the forum page. Adafruit also has parts on their Github page. To import the part just click the icon in the Parts frame and select Import...
I was now able to create the breadboard diagram. Below you see the breadboard diagram created with Fritzing app of how to connect the display to Arduino Nano.
The display part is Adafruit based, but I have created a table on how to translate the Original Adafruit 0.96" 160x80 Color TFT Display to Chinese Clone IPS 0.96 inch 7P SPI ST7735 module
However, there seems to be no ST7735 driver / HAL libraries for MSP430. Also, there seems to be no working code for ST7735 in Energia. There are many references to Screen_ST7735.h on energia.nu / 43oh / github, but it seems to be dead links or vaporware.
Can anyone point me to WORKING code for ST7735 on Energia and/or CCS MSP430. I shout working because none of the links I have found that claims to have a ST7735 library actually presents .h and .c / .cpp files.
The ST7789 TFT module contains a display controller with the same name: ST7789. It’s a color display that uses SPI interface protocol and requires 3, 4 or 5 control pins, it’s low cost and easy to use. This display is an IPS display, it comes in different sizes (1.3″, 1.54″ …) but all of them should have the same resolution of 240×240 pixel, this means it has 57600 pixels. This module works with 3.3V only and it doesn’t support 5V (not 5V tolerant).
The ST7789 display module shown in project circuit diagram has 7 pins: (from right to left): GND (ground), VCC, SCL (serial clock), SDA (serial data), RES (reset), DC (or D/C: data/command) and BLK (back light).
As mentioned above, the ST7789 TFT display controller works with 3.3V only (power supply and control lines). The display module is supplied with 3.3V (between VCC and GND) which comes from the Arduino board.
To connect the Arduino to the display module, I used voltage divider for each line which means there are 4 voltage dividers. Each voltage divider consists of 2.2k and 3.3k resistors, this drops the 5V into 3V which is sufficient.
The first library is a driver for the ST7789 TFT display which can be installed from Arduino IDE library manager (Sketch —> Include Library —> Manage Libraries …, in the search box write “st7789” and install the one from Adafruit).
The display quality is very good (much better than the camera captures), although it has quite narrow viewing angle constraints, outside of 20 degrees or so it shows mostly white, without colour or generally inverted.
The various versions of the panel over the years can supposedly be discriminated between by the colour of the tab on the cover of the polarizer sheet: red, green, or black. In the Adafruit sources, some are associated with different chip versions:
The display comes out of reset with vertical stripes, it"s the line shift register in the controller just repeated on every line, plus some scary regular black columns that look like dead column multiplexing drivers.
On using the red table init for the timing register, for the first time the display did something different involving all the pixels, which was very encouraging. After more prodding and poking I discovered changing it to a per-frame delay of 10 additionally made the raster come out right, showing the video data in the panel framebuffer.
The Adafruit Arduino shield version just gets in the way and defeats MISO appearing at SDA, it breaks reading from the panel... just bin it and use the panel directly