Oled Marketplace.LCD screen. In the embedded development industry, screen development is essential, the most common screen is the TFT_LCD screen, that is, the liquid crystal display screen, of course, there are IPS screen and OLED screen, these are some common screen types in daily life.
Let’s use the most common LCD screen to talk about how STM32 drives the LCD screen. The 2.8-inch capacitive touch screen is used as an example.
LCD screen is generally composed of backlight, polarizer, liquid crystal layer, filter and other basic parts, so this also determines that other materials of LCD screen can not be made of the same thin screen. Each pixel of the screen is controlled by the corresponding LCD whether the backlight is turned on or not, thus displaying a variety of patterns.
TFT LCD thin film LCD display principle, intuitive animation, clear at a glance, science, popular science, good-looking video (baidu.com).
In addition to the basic physical display part mentioned above, a complete LCD screen also contains a corresponding driver chip to control the display of the screen content, which is stored in the corresponding display memory. Different driver chips show different memory, and the larger the display memory is, the more expensive the chip is. Here we use the ILI9341 driver chip, which supports a screen with a resolution of 240 to 320.
Learn LCD screen from hardware interface and communication mode.
Color depth: 260000 colors 2 ^ 18.
RGB565: red data 5 digits, green 5 digits, blue 5 digits Red: 1111 1000 0000 0000.
There are three modes of common interfaces: MCU interface, RGB interface and VSYNC interface.
MCU interface mode:
Using the internal memory of the drive chip that comes with the screen, MCU first writes the data to the GRAM of the driver IC, and then displays it on the screen.
Advantages: easy to drive, no need for clock and synchronization signal.
Disadvantages: due to its own video memory, high cost and GRAM consumption, it is difficult to achieve a larger screen.
RGB interface mode:
The large screen uses more interfaces, and the screen does not have video memory, so MCU is required to prepare sufficient memory space (because the screen with RGB565480*272 resolution requires video memory 230*240*2=168KB, the general MCU does not have such a large RAM, so add external SRAM or SDRAM). For the screen with RGB interface, the host outputs directly the RGB data of each pixel, which does not need to be transformed (except GAMMA correction, etc.). There needs to be a LCD controller in the host part to generate RGB data and point, row and frame synchronization signals.
Advantages: the RGB screen does not write data to the display memory, but directly writes to the screen, and the reading and writing speed is faster.
Disadvantages: consumption of single-chip microcomputer memory, general single-chip microcomputer main frequency is low, can not drive a larger screen, suitable for high-performance single-chip microcomputer.
VSYNC interface mode:
In fact, this mode adds a VSYNC signal to the MCU mode, which is applied to the motion picture update, which is very different from the above two interfaces. This mode supports the function of animation display directly, and it provides a solution to realize animation display with minimal changes to the MCU interface.
In this mode, the internal display operation is synchronized with the external VSYNC signal. Can achieve higher speed than the internal operation of the animation display. However, due to its different mode of operation, this mode has a limit on the rate, that is, the writing rate of the internal SRAM must be greater than the rate of displaying and reading the internal SRAM.
8080 parallel Interface in MCU Interface Mode.
For the single-chip microcomputer of STM32F1 series, its main frequency is 72Mhz, and its performance is relatively low, so it generally chooses the MCU interface mode when driving the screen, and in order to improve the refresh speed of the screen, it is often driven by 8080 parallel interface. Here we will focus on the 8080 interface in MCU mode.
The interface selection of the screen is determined by the driver chip:
For the ILI9341 driver chip, the choice of interface is determined by the four pins of IM [3:0], which is generally defined when the hardware engineer designs the circuit board. The specific interface mode and pin relationship are as follows:
The 8080 I interface is used this time. 8080-I and 8080-Ⅱ are different in the selection of pins on the screen, and the communication timing is basically the same. Next, let’s take a look at the communication timing corresponding to 8080.