Hey there folks,
Recently bought a cheap Chinese 2.4" TFT screen off of ebay(not SPI, lots of cabling). For my latest project I'm building a telemetry screen for my computer. I'm using a Nano V3 for controller. C# program I've coded will send some data to MC via serial, which in turn will write it to TFT.
I wanted to understand how TFTs work before I started with the rest of the project. After some struggles I've managed to make the LCD work. But having some problems. Wondered if anyone could help.
Here are the problems.
**1)**Colors are reversed. If I use tft.setTextColor(CYAN,WHITE);
I get red text with black background. Colors are defined thusly
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
I checked the wiring. It appears to be correct. So it must be driver related. For reference, lcd controller is SPFD5408. I'm using the library from here
**2)**Is there a way to bypass arduino and do the drawing directly with PC hardware? Some sort of pass-thru? In my case, arduino will always be connected to computer, and the data which TFT will display will come always from the computer. I feel like there should be a way to pass data straight to LCD, bypassing Nano. If I'm not mistaken, the display on Logitech G15(my inspiration for this project) works on such a principle.
3)This last one is kinda generic, but I still can't find the solution to it. Screens refreshes too slowly. Considering this same screen is capable of playing video when connected to the Raspberry Pi, I know it's Arduino related. I've found some libraries which claim to be 10-20 times faster than the adafruit one. But none of them has built in support for my display. It's probably possible to port my LCD chip's driver to them, but I'm not remotely as good a programmer to even attempt it.
Here is the sample code I use to test the screen. It literally takes 3 seconds to go through all the screen. In the real project I won't really need to change all that many pixels at once but considering I need at least about 24hz refresh rate. It just won't do.
void loop(void){
tft.fillRect(2,2,randNumber,2,BLUE); //Kinda simulates a graph
//delay(100);
for (int begy = 10; begy < 200; begy = begy+ 20){ //Begining pixels for X and Y
for(int begx =0; begx <300; begx = begx+50){ //
tft.setCursor(begx,begy);
tft.setTextSize (2);
tft.setTextColor(CYAN,WHITE);
tft.println(randNumber+ begy);
}
}
tft.fillRect(2,2,randNumber,2,RED);
randNumber = random (0,318);
//delay(100);
}
Bonus Question) What other MCs out there that has good LCD support and high clock speeds? I don't wanna use rPi for this project. What I'm trying to accomplish shouldn't require 4 cores running at 700mhz. I briefly considered Teensy 3.1 but, I've never used it before and also down the line I'm planning to do some small scale production of this project. And I don't want the added complexity(and cost) of a 32 bit processor if I can help it.