1. What is LCD?
(1) LCD, commonly known as Liquid Crystal Display.
LCD is a kind of material (2) LCD this material has a characteristic: in the liquid crystal molecules rotate, driven by electrical signals of rotating will affect the transmission of light, so we can behind the LCD panel with Bai Guangzhao (called backlight), can let the liquid crystal molecules through different electrical signals for selective pervious to light, in front of the LCD panel at this time is all sorts of different color, this is the LCD display.
(3) passive and active luminescence.Some displays (such as LED display, CRT display) itself can emit light called active light, some (LCD) itself will not emit light only light, need the assistance of backlight to appear to be luminous, called passive light.
(4) LCD application fields: television, computer display, mobile phone display, industrial display, etc
2. LCD display unit: frame
(1) the content of a whole screen on the display becomes a frame, and the whole display works frame by frame.
(2) a movie is actually playing pictures at 24 frames per second.
(3) in-frame data: a frame is divided into multiple rows, and a row is divided into multiple pixels, so an image is actually a matrix composed of multiple pixels.
(4) out-of-frame data: the whole video is composed of many frames. When finally playing video, each image frame can be played one by one.
3. Six timing parameters for forward compatibility
HSPW horizontal sync signal pulse width
HBPD level synchronization signal on the front shoulder
HFPD level sync signal back shoulder
VSPW vsync signal pulse width
VBPD vsync signal front shoulder
VFPD vsync signal back shoulder
(1) the communication process of a line is as follows: the LCD controller first sends a HSYNC high level pulse (pulse width is HSPW), and the pulse tells the driver that the information below is a line of information.Then start this line of information, which consists of three parts: HBPD+ valid row information +HFPD.The front shoulder and back shoulder belong to timing information (related to the LCD screen), and the effective line information is the horizontal resolution.So you can think of a row as consisting of four parts: HSPW+HBPD+ valid row information +HFPD.
(2) a frame image is actually a column, and a column image is composed of multiple rows, each row is the above mentioned timing sequence.
(3) the communication process of a frame image is as follows: the whole frame image signal is divided into four parts: VSPW+VBPD+ frame effective signal +VFPD.VSPW is the frame synchronization signal width used to tell the drive to start a frame image;VBPD and VFPD are vertical synchronous signals at the front and back shoulder respectively.
(4) must be: the six parameters for LCD monitors was actually it’s no use, the signal is old-fashioned CRT display only need actually, don’t need the LCD itself, but for historical compatibility requirements, LCD chose compatible with CRT monitor the timing requirements, so understanding the LCD display sequence and programming, CRT ways to understand can’t go wrong.
(5) it should be noted that these timing parameters themselves are parameters of the LCD screen itself, and have nothing to do with the LCD controller.Therefore, if the screen connected to the same motherboard is different, the timing parameter setting will also be different.The sources of these parameters are generally: first, the manufacturer will directly give, generally in the form of example code;Second, from the LCD data manual.
The first way is to view the x210v3 nude development tutorial \ SRC \template-framebuffer-font\source\hardware\ s5pv210-fbb.c line 774)
.h_fp = 210, // 160-210-354
. H_bp = 38, // 46
.h_sw = 10, // 1-40
. V_fp = 22, // 7-22-147
V_fpe = 1,
. V_bp = 18, // 23
V_bpe = 1,
.v_sw = 7, // 1-20
Second way, view LCD data manual (X210 CD data \A disk \DataSheet\ at070tn92.pdf)
Key concepts related to LCD display
(1) the whole image is composed of individual pixels, which is a display point.
(1)pitch is the distance between the center of the pixel for two consecutive pixels.Normal pixels are square, so the horizontal pitch is the same as the vertical pitch.But there are differences.
(2) pixel spacing will affect the optimal viewing distance of the screen.Large pixel spacing is good for distance viewing, and small pixel spacing is good for close viewing.
(1) the number of horizontal and vertical pixels of the entire screen is called resolution. For example, the screen used in the X210 development board is 800 480.
(2) the screen size is independent of the resolution, such as the development board screen size is 7 inches (pure screen diagonal size is 7 inches).
(3) there is a correlation between screen size, resolution and pixel spacing.
(1) definition is a subjective concept, which is the human eye’s subjective judgment of the display effect.In plain English, people look and feel unclear.
(2) objectively speaking, the sharpness is determined by the resolution and pixel spacing.In general, when the screen size is fixed, the higher the resolution, the clearer; the lower the resolution, the less clear;Under fixed resolution, the smaller the screen size, the clearer, the larger the less clear.
(3) clarity is also determined by many other factors.
5. Bits per pixel (BPP)
(1) how many bytes of data describe a pixel in the computer.
(2) the computer USES binary bits to represent the data of a pixel. The more data bits used to represent a pixel, the richer and finer color value of the pixel will be, and the deeper color depth will be.
(3) generally speaking, there are several pixel depths: 1 bit, 8 bit, 16 bit, 24 bit and 32 bit.
In order for the LCD to work, a map must be established between the LCD screen and the display memory (this is done by initializing the LCD controller on the CPU).(this is also the first stage of the two stages of the LCD display. In the second stage, we only need to put the corresponding data into the display memory, and the LCD screen will automatically display the corresponding content.)
Copy the code
# define FB_ADDR (0 x23000000)
# define a ROW (600).
# define COL (1024).
# define HOZVAL (COL – 1)
# define LINEVAL (ROW 1)
# define XSIZE COL
# define YSIZE ROW
U32 * PFD = (u32 *).
Draw_xy void draw_xy(u32 x,u32 y, u32 color)
*(PFD + COL * y + x) = color;
Copy the code
Draws a point function that initializes a segment of an address in memory as video memory.Writing a value to an address in memory causes the dot to display color.