kmr-1.8 tft display pricelist
Recently, I had the idea to make a digital picture frame—one of these kinds which load images from SD cards and show each image for some time. I was remembering myself that I already own a small TFT display, the KMR-1.8 SPI, that works out of the box with an Arduino Uno. When I digged up my KMR-1.8 SPI, I realized that it has also an in-built SD card reader. Moreover, I looked up the Internet and found ready-to-use libraries for the in-built SD card reader as well as showing images on the TFT display. For these reasons, I thought making such an digital picture frame will turn out very easy.
When I started to implement my first lines of codes and started to connect my Arduino Uno to the KMR-1.8 SPI, I ran into two major problems. First, the colors of my image file did not match to the colors displayed by the KMR-1.8 (red and blue were interchanged). Second, my first prototypes stopped to work after about 5 minutes. The application started to freeze and showed the same image forever instead of displaying the next image after a chosen time.
There exists various versions of so-called “1.8 TFT displays” from different manufacturers. Not all of them are 100% compatible to each other. Therefore, if you own a TFT display and want to use my tutorial to make it work, please check if your TFT display really matches the version I used in this tutorial:
The source code relies on three header files (and libraries): SPI.h (Link), SD.h (Link) and TFT.h (Link). Please make sure that all of them are correctly installed before trying out my source code (In Arduino IDE: Tools -> Manage Libraries…).
I overcame the first problem by not using the default initialization method (“TFTscreen.begin();”) of the TFT library. Instead, I looked up whats inside the “begin”-method. I found a method called “initR” which has a parameter that allows to perform the initialization for a specific chip. Here, the parameter value “INITR_BLACKTAB” worked for me as the colors were then shown correctly. In addition, I call the method “setRotation” with parameter value “1” in order to be conform to the default initialization method. In the end, the code for the setting up the TFT library object looks like this:// ...
The code looks for image files (*.BMP) on the SD card and shows each image for 60 seconds. You can change the display time by setting “DELAY_IMAGE_SWAP” to a new value.
@david_prentice: I meant Himax, well spotted! I remember seeing a 1.8" display with a HX---- driver advertised, but I am not sure where I saw it. Yes you are right, ILI9163/S6D02A1/ST7735 are all options often advertised for 1.8" displays.
Interestingly it reports my display as having an ILI9163 but I am using initialisation code from this library for a S6D02A1 and it works OK but that may just be by luck and a degree of initialisation address compatibility.
I needed to install this library from Bodmer; then edit the User_Setup.h file ( in sketchbook/libraries/TFT_ESPI ) to match my display and the connections used.
This User_Setup.h works fine for the ESP32; except that in the UTFT_DEMO_FAST Example the final screen (orange rectangle on blue background) no text was displayed.
An 1.8" 128 x 160 TFT LCD can be purchased for around $3. The one that I got has the marking of "KMR-1.8 SPI". It claims to be ST7735R based. ST7735R is a 262K 18-bit color TFT controller/driver by Sitronix. ST7735R is a chip with large aspect ratio (10 x 0.7 mm); it has 759 pads (including 396 source and 162 gate driver output pins) and supports a number of interfaces, parallel and serial.
LED+, SD_CS, MOSI and SCK have 4.7-Ohm series resistors. LED- is shorted to GND. The display is advertised to work with Arduino, but it appears to take only 3V input.
I used 1600-Ohm resistors in series for 5V to 3V conversion. I wonder if that might cause some problem. The display input pins do not cause the 5V signal level to drop as I expect with ESD protection diodes. Could the input be 5V tolerant? The I/O voltage is specified as 1.65 to 3.7V according to the data sheet and the operating voltage is 2.3 to 4.8V. 5V would be stressing it. I power the Arduino nano with the USB, so the actual voltage is 4.7V (after the diode). It is possible that the 3V from the regulator is not actually used by the display, but only for the SD card.
People have reported that the display can also run on Orange Pi. The device is supported by notro"s fbtft, with built-in support for Adafruit 1.8". The wiring is as follows,
The data sheet specifies the min serial clock cycle time is 66ns for write and 150ns for read. Even for just writing, the max clock frequency is 15MHz. Even though the driver seemed to load correctly, I was unable to display anything. Lowering the SPI clock rate did not help.
I powered both the arduino and the display with 3.3V. The hardware SPI worked. (I mistakenly used D12 as DC, which compounded the problem. D12 is MISO.) Even the software SPI behaved a little better (without the some flicking). So the hardware is fine running 3.3V (drawing about 55mA).
The next step is to run X windows on it. I created X11 config file and run startx as the second display. The X Window did run on the display; but the X Windows on the HDMI display disappears.