Introduction: LCDBPV2 3.2" TFT + Touch & Arduino UNO. FAST
When I started building projects i realized that need a display, better than leds to display data in real time.
Displays could be expensive and also there are different types: 7 segments with different sizes, monochrome, color, with bigger resolution, vfd, oled, LCD TFT...
As a result, i will present LCDBPV2 3.2"TFT LCD 16bit color + Touch + Backlight driver wich solves all drawbacks of the commonly used LCD, and is cheap.
Step 1: Different Displays for Different Projects and Prices
16x2 HD44780 based LCD
Obviating 7 segment display because short amount of data can show, the first display you can bought cheaply on ebay is a monochrome HD44780 driver based 16x2 LCD controlled by 8 bit (4 if short character map is enough). You can found it on ebay for a few dollars in a different colors and also there is an expensive and of course coolest than normal LCD, VFD version. You can play with backlight and contrast and even you can create custom characters using his integrated (and limited) graphic RAM.
Well, is good start, but as you can create custom characters and symbols available memory goes down and you need to do juggling to preserve RAM, further, is a small screen.
128x64 monocrome LCD
After 16x2 LCD, 128x64 graphical LCD is a good option, but caution: price goes overly.
Now, the difference with better TFT LCD are density of colors (monochrome vs mountain of colors) and bus: the first remains 4 bit or even I2C and LCD TFT has more complex communication bus.
2.2 220x176 TFT LCD
Now starts the better. You can found relatively cheap TFT displays with a big number of pixels and also big color resolution, for example 2.2" and 220x176 and 18 bit color.
Seems to be the key, but... what about the speed? Well to reply this question is necessary to make another question: What bus is used to control the LCD? The answer seems to be fine but nothing is further from reality: SPI. As is known, SPI is a serial bus that carry serialized parallel data between two devices, so, for analyze the data we can remember the length of the words: 18 bit (You can use 12, or some density you found, is the same case). So, serializing 18 bit color plus, for example 4 bit of control data (CS, EN, CLK, RW) need to spend 22 clock pulses to obtain one word. This and also other SPI deficiences denotes SPI as bad choice for large LCD.
Step 2: About E.H.A. Serial Mode
LCD displays, such as the ones used in LCDBPV2, have LCD chip to drive TFT grid pixels, in this case SSD1289 chip. This chip links each pixel with his MCU and provide Serial or parallel control to any external MCU or FPGA/CPLD.
Serial control has two issues: -Common to both serial and parallel control, is that communication has many repetitive actions as drawing filled polygons on screen (it needs to write same color pixel a few times). -Ordinary parallel to serial design, because compatibility issues or lack of wit, only uses the final state of the bit, not the edge, so it is needed one clock pulse to indicate each action, included control actions like starting or ending communication or selecting read or write actions. With integrated design based on a CPLD (ex: 74xx series) and some code modifications has been achieved overcome the drawbacks. You get faster speeds and noise supression because integrated design. Now, I will show the timming diagram of paralell and serial comunication.
As can be seen in the diagrams, parallel communication seems to be (and in fact is) more efficient, but with the disadvantage of taking 16bits of data plus three bits of control, versus the 4 total bits in series mode, what is enough in some applications while video timming is not critical and mcu doesn't have too many free pins.
In both modes, serial and parallel, has been programmed a new mode to improve performance:writedatasec (write sequence of data). This mode can be used because CPLD (in series comunication) and MCU (in parallel comunication) keeps data in his output buffer (to SSD1289), so is not needed to update it, saving time and MCU load. Some other news about serial mode are dual bit data and edge indications: Because CPLD design can parallelize process without losing time, so it uses two separated circuits to obtain data at the same time and later feeds register buffer. Edge indicates almost all actions of the integrated CPLD circuit to save time. In short, E.H.A. serial mode is the fastest mode possible with serial communication and allows low end MCU to drive LCD at good speed and high end LCD to save pins with speed of parallel. In fact, using writedatasec with any MCU (comparec with the same clock speed), parallel and serial mode spend the same ammount of time.
Step 3: Time to Results
This is the LCDBPV2 library implementation for Arduino.
In addition LCDBPV2 comes with touch panel and backlight driver to power on, off, blink and dim backlight.
LCDBPV2 is a very powerfull device, but limited because arduino is underpowered, with only 8bit architecture, limited RAM and various headaches related to limitations when interrupts, I2C serial communication for backlight and touch drivers and other code issues, but now everything is solved with a little wit and works at amazingly speed.
Video: Normal Serial VS EHA
To learn about LCDBPV2 please go here .
We have a be nice policy.
Please be positive and constructive.