sainsmart 1.8 tft lcd made in china
The 1.8" TFT LCD SPI-bus display modules available from Adafruit and SainSmart are functionally equivalent, except that the SainSmart unit can be driven at a much faster SPI bus rate than the Adafruit (32 MHz vs. 4 MHz in my testing). Fabien Royer has shown that this is due to a slow level shifter in the Adafruit unit.
The board supports multiple different 1.8" panel pinouts including Adafruit and SainSmart, and sports mounting pads for three GPIO buttons. Very nice!
Adafruit_ST7735 is the library we need to pair with the graphics library for hardware specific functions of the ST7735 TFT Display/SD-Card controller.
Basically, besides the obvious backlight, we tell the controller first what we are talking to with the CS pins. CS(TFT) selects data to be for the Display, and CS(SD) to set data for the SD-Card. Data is written to the selected device through SDA (display) or MOSI (SD-Card). Data is read from the SD-Card through MISO.
So when using both display and SD-Card, and utilizing the Adafruit libraries with a SainSmart display, you will need to connect SDA to MOSI, and SCL to SCLK.
Note: Adafruit displays can have different colored tabs on the transparent label on your display. You might need to adapt your code if your display shows a little odd shift. I noticed that my SainSmart display (gree tab) behaves best with the code for the black tab – try them out to see which one works best for yours.
#define sclk 4 // SainSmart: SCL#define mosi 5 // SainSmart: SDA#define cs 6 // SainSmart: CS#define dc 7 // SainSmart: RS/DC#define rst 8 // SainSmart: RES
#define sclk 13 // SainSmart: SCL#define mosi 11 // SainSmart: SDA#define cs 10 // SainSmart: CS#define dc 9 // SainSmart: RS/DC#define rst 8 // SainSmart: RES
You can name your BMP file “parrot.bmp” or modify the Sketch to have the proper filename (in “spitftbitmap” line 70, and in “soft_spitftbitmap” line 74).
#define SD_CS 4 // Chip select line for SD card#define TFT_CS 10 // Chip select line for TFT display#define TFT_DC 9 // Data/command line for TFT#define TFT_RST 8 // Reset line for TFT (or connect to +5V)
#define SD_CS 4 // Chip select line for SD card#define TFT_CS 10 // Chip select line for TFT display#define TFT_DC 9 // Data/command line for TFT#define TFT_RST 8 // Reset line for TFT (or connect to +5V)
However, if your application needs your screen sideways, then you’d want to rotate the screen 90 degrees, effectively changing the display from a 128×160 pixel (WxH) screen to a 160×128 pixel display. Valid values are: 0 (0 degrees), 1 (90 degrees), 2 (180 degrees) and 3 (270 degrees).
tft.print("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. ");
Greetings, Stan! I just got mine working. It seems that the Sainsmart labels their pins a little differently from the Adafruit. I was stumped, until I came across Kamal Mostafa"s website (Raspberry Pi projects : Adafruit/SainSmart 1.8" TFT LCD : st7735fb driver). There, he presents a table of which pins on the Adafruit correspond to which pins on the Sainsmart. Specifically:
Ignore, completely, the 4 pins over in the SD-Card section. Some of those pins have the same labels as what is referred to in the TFT docs you"ll find, but these are not the pins you want (unless you want to be accessing the SD card and not the TFT display).
The trouble seems to come from the fact that the Sainsmart labels their MOSI and Clock lines the way they"re labeled with i2C (as "SCL" and "SDA"). Anyway, here"s how I wired mine:
Don"t use the TFT18.ZIP that Sainsmart has on their website. It only works with an older version of the Arduino software. Instead, just use the built-in examples you"ll find at File->Examples->TFT->Arduino
With the above wiring, I was able to run the built-in examples without any modification. I"m currently working on getting Sainsmart"s demo sketches (like graphicstest_highspeed) to work. If you want them, let me know, but the built-in Arduino ones should work just fine for you.
It"ll be a big help to those who are unsure of compiling the kernel, etcYes, and I guess that will include most of the Raspberry Pi userbase. Hopefully it will boost the use of these LCDs on the Pi. And plug&play displays like yours, make it even easier.
I tried to download the latest version •2013-02-09-wheezy-raspbian-2013-04-11-fbtft.zip - but its a dead link for me?Can you try again, I have moved the file to another server.
Also I read on Kamal"s blog ( http://www.whence.com/rpi/) that the sainsmart spi bus can be used up to 32mhz, but your driver defaults to 4mhz, the same as the adafruit unit. The adafruit display has an extra buffer chip inline so cannot be used at 32mhz, but the sainsmart does not so it can be run faster. My chinese display also does not have the extra buffer. Playing video back using mplayer seems a lot slower than that of Kamal"s kernel as well - have you tried it?
I selected the sainsmart 1.8" option as that is almost the same as my display however the RGB is swapped. Is there an option to change it?No, sorry it"s not.
Also I read on Kamal"s blog ( http://www.whence.com/rpi/) that the sainsmart spi bus can be used up to 32mhz, but your driver defaults to 4mhz, the same as the adafruit unit. The adafruit display has an extra buffer chip inline so cannot be used at 32mhz, but the sainsmart does not so it can be run faster. My chinese display also does not have the extra buffer. Playing video back using mplayer seems a lot slower than that of Kamal"s kernel as well - have you tried it?If you don"t have a levelshifter you can go full speed (yes, the adafruit18fb default is 4MHz, picked up from Kamal"s work).
spidevices: adafruit18fb spi0.1 32000kHz 8 bits mode=0x00Now lets load the driver telling it to display the transfer time for each frame sent (https://github.com/notro/fbtft/wiki/Debug):
The refresh rate is set to 50fps as per the driver, but the big buck bunny video I being used is being resized on the fly by the Pi so it not optimal. A better solution would be to have a native 160x128 version of the video, but i didnt get round to editting it.
Hi Notro - can we have the adafruit18fb (that brings the line to 2Mhz while sending commands) driver to support the rotate and bgr options as the sainsmart18fb please?
ivancreations wrote:Hi Notro - can we have the adafruit18fb (that brings the line to 2Mhz while sending commands) driver to support the rotate and bgr options as the sainsmart18fb please?
Spice up your Arduino project with a beautiful large touchscreen display shield with built in microSD card connection. This TFT display is big (7" diagonal) bright (14 white-LED backlight) and colorfu 800x480 pixels with individual pixel control. As a bonus, this display has a optional capacitive and resistive touch panel attached on screen by default.
※Price Increase NotificationThe TFT glass cell makers such as Tianma,Hanstar,BOE,Innolux has reduced or stopped the production of small and medium-sized tft glass cell from August-2020 due to the low profit and focus on the size of LCD TV,Tablet PC and Smart Phone .It results the glass cell price in the market is extremely high,and the same situation happens in IC industry.We deeply regret that rapidly rising costs for glass cell and controller IC necessitate our raising the price of tft display.We have made every attempt to avoid the increase, we could accept no profit from the beginning,but the price is going up frequently ,we"re now losing a lot of money. We have no choice if we want to survive. There is no certain answer for when the price would go back to the normal.We guess it will take at least 6 months until these glass cell and semiconductor manufacturing companies recover the production schedule. (Mar-03-2021)
Impact: ER-TFT043-7 is the same with ER-TFT043A1-7 in mechanical dimension and electrical spec in our testing.As old customer,we recommend you test samples before mass order.
ER-TFT043A1-7 is 4.3 inch IPS TFT LCD 800x480 dots display, with driver IC ST7262E43 and optional capacitive touch panel or resistive touch panel,superior display quality,full view angle and easily controlled by MCU such as PIC, AVR, ARDUINO,ARM and Raspberry portable or handheld device.PI.
It can be used in any embedded systems,car,mp4,gps,industrial device,security and hand-held equipment which requires display in high quality and colorful image.It supports rgb interface. FPC with zif connector is easily to assemble or remove.Of course, we wouldn"t just leave you with a datasheet and a "good luck!".Here is the link for 4.3"TFT Touch Shield with Libraries, Examples.Schematic Diagram for Arduino Due,Mega 2560,Uno and 8051 Microcontroller Development Board&Kit.
When compared to the ordinary LCD, TFT LCD gives very sharp and crisp picture/text with shorter response time. TFT LCD displays are used in more and more applications, giving products better visual presentation.
TFT is an abbreviation for "Thin Film Transistor". The colorTFT LCD display has transistors made up of thin films of Amorphous silicon deposited on a glass. It serves as a control valve to provide an appropriate voltage onto liquid crystals for individual sub-pixels. That is why TFT LCD display is also called Active Matrix display.
A TFT LCD has a liquid crystal layer between a glass substrate formed with TFTs and transparent pixel electrodes and another glass substrate with a color filter (RGB) and transparent counter electrodes. Each pixel in an active matrix is paired with a transistor that includes capacitor which gives each sub-pixel the ability to retain its charge, instead of requiring an electrical charge sent each time it needed to be changed. This means that TFT LCD displays are more responsive.
To understand how TFT LCD works, we first need to grasp the concept of field-effect transistor (FET). FET is a type of transistor which uses electric field to control the flow of electrical current. It is a component with three terminals: source, gate, and drain. FETs control the flow of current by the application of a voltage to the gate, which in turn alters the conductivity between the drain and source.
Using FET, we can build a circuit as below. Data Bus sends signal to FET Source, when SEL SIGNAL applies voltage to the Gate, driving voltage is then created on TFT LCD panel. A sub-pixel will be lit up. A TFT LCD display contains thousand or million of such driving circuits.
Topway started TFT LCD manufacturing more than15 years ago. We produce color TFT LCD display from 1.8 to 15+ inches with different resolutions and interfaces. Here is some more readings about how to choose the right TFT LCD.
I"m a beginner with arduino and I got the code working on a 2.2" Adafruit TFT screen. But as you can imagine it"s still rendering in 128x160. I tried to change the code in a couple of ways but if I change the variables it doesn"t seem work at all anymore. (Thought it would be a memory issue, but I got it working on a Arduino Mega2560 and that didn"t help either)