LCD universal interface circuit design
Source: InternetPublisher:通通 Keywords: LCD lcd circuit interface circuit diagram Updated: 2020/02/17
What are the LCD interfaces?
There are many kinds of LCD interfaces, and the classification is very detailed. It mainly depends on the driving method and control method of the LCD. Currently, there are generally several connection methods for color LCDs on mobile phones: MCU mode, RGB mode, SPI mode, VSYNC mode, MDDI mode, and DSI mode. MCU mode (also written as MPU mode). Only the TFT module has RGB interface.
But the most widely used ones are MUC mode and RGB mode. The differences are as follows:
1. MCU interface: It can decode commands, generate timing signals from TIming generator, and drive COM and SEG drivers.
RGB interface: When writing LCD register setTing, there is no difference from the MCU interface. The difference is only in how the image is written.
2. When using MCU mode, since the data can be stored in the IC's internal GRAM before being written to the screen, the LCD in this mode can be directly connected to the MEMORY bus.
It is different when using RGB mode. It does not have internal RAM. HSYNC, VSYNC, ENABLE, CS, RESET, and RS can be directly connected to the GPIO port of MEMORY and use the GPIO port to simulate waveforms.
3.MPU interface mode: display data is written to DDRAM, often used for still picture display.
RGB interface mode: Display data is not written to DDRAM, but written directly to the screen. It is fast and often used to display videos or animations.
The main differences between the MCU interface and the RGB interface are:
MCU interface mode: display data is written to DDRAM, often used for still picture display.
MCU mode
It is named because it is mainly used in the field of microcontrollers. Later, it was widely used in mid-to-low-end mobile phones, and its main feature is that it is cheap. The standard terminology of the MCU-LCD interface is the 8080 bus standard proposed by Intel, so I80 is used to refer to the MCU-LCD screen in many documents. It can be mainly divided into 8080 mode and 6800 mode. The main difference between the two is timing. Data bit transmission includes 8 bits, 9 bits, 16 bits, 18 bits, and 24 bits. The connections are divided into: CS/, RS (register selection), RD/, WR/, and then the data line. The advantages are: simple and convenient control, no clock and synchronization signals required. The disadvantage is: it consumes GRAM, so it is difficult to achieve a large screen (3.8 or above). For LCM with MCU interface, the internal chip is called LCD driver. The main function is to transform the data/commands sent by the host into RGB data of each pixel, so that it can be displayed on the screen. This process does not require point, line, or frame clocks.
The Driver IC of the MCU interface LCD all has GRAM. The Driver IC serves as a co-processor of the MCU. It accepts the Command/Data sent from the MCU and can work relatively independently. For the LCM (LCD Module) with MCU interface, the internal chip is called the LCD driver. The main function is to transform the data/commands sent by the host into RGB data of each pixel, so that it can be displayed on the screen. This process does not require point, line, or frame clocks.
M6800 mode
M6800 mode supports selectable bus width 8/9/16/18-bit (default is 8-bit). Its actual design idea is the same as that of I80. The main difference is that the bus control read and write signal combination in this mode is On a pin (/WR), a latch signal (E) is added. Data bits are transmitted in 8-bit, 9-bit, 16-bit and 18-bit.
I8080 mode
I80 mode connections are divided into: CS/, RS (register selection), RD/, WR/, and then the data line. The advantages are: simple and convenient control, no clock and synchronization signals required. The disadvantage is: it consumes GRAM, so it is difficult to achieve a large screen (QVGA or above).
The standard name of the MCU interface is I80, and there are 5 control pins:
CS chip select signal
RS (set to 1 to write data, set to 0 to write command)
/WR (0 means writing data) data command distinguishes signal
RESET resets the LCD (use fixed command series 0 1 0 to reset)
VSYNC mode
This mode actually adds a VSYNC signal to the MCU mode and is used for moving picture updates, which is very different from the above two interfaces. This mode supports the function of direct animation display. It provides a solution for realizing animation display with minimal changes to the MCU interface. In this mode, the internal display operation is synchronized with the external VSYNC signal. Enables animation at higher rates than internal operations. However, due to its different operating methods, this mode has a limit on the rate, that is, the write rate to the internal SRAM must be greater than the display read rate to the internal SRAM.
RGB mode
Large screens use more modes, and data bit transmission is also divided into 6-bit, 16-bit, 18-bit, and 24-bit. The connections generally include: VSYNC, HSYNC, DOTCLK, CS, RESET, some also require RS, and the rest are data lines. Its advantages and disadvantages are exactly the opposite of the MCU mode.
The main difference between MCU-LCD screen and RGB-LCD screen is the location of the video memory. The video memory of RGB-LCD is served by system memory, so its size is only limited by the size of system memory. In this way, RGB-LCD can be made in larger sizes. For example, 4.3" can only be considered entry-level now, while 7" in MID , 10" screens have begun to be widely used. At the beginning of the design of MCU-LCD, only the memory of the microcontroller was small, so the video memory was built into the LCD module. Then the software updated the video memory through special display commands, so the MCU screen Often it cannot be made very large. At the same time, the display update speed is slower than that of RGB-LCD. The display data transmission mode is also different. The RGB screen only needs the video memory to organize the data. After starting the display, LCD-DMA will automatically transfer the data in the video memory through RGB The interface is sent to the LCM. The MCU screen needs to send a command to draw points to modify the RAM inside the MCU (that is, the RAM of the MCU screen cannot be written directly). Therefore, the RGB display speed is obviously faster than the MCU, and in terms of video playback, the MCU-LCD also slower.
For LCM with RGB interface, the host outputs directly the RGB data of each pixel without conversion (except for GAMMA correction, etc.). For this kind of interface, an LCD controller is required in the host part to generate RGB data and Dot, line and frame synchronization signals.
Color TFT LCD screens mainly have two interfaces: TTL interface (RGB color interface) and LVDS interface (packaging RGB colors into differential signal transmission). The TTL interface is mainly used for small-size TFT screens below 12.1 inches, and the LVDS interface is mainly used for large-size TFT screens above 8 inches. The TTL interface has many lines and the transmission distance is short; the LVDS interface has a long transmission distance and the number of lines is small. Large screens use more modes. The control pins are VSYNC, HSYNC, VDEN, and VCLK. S3C2440 supports up to 24 data pins, and the data pin is VD[23-0].
The image data sent by the CPU or graphics card is a TTL signal (0-5V, 0-3.3V, 0-2.5V, or 0-1.8V). The LCD itself also receives a TTL signal. Since the TTL signal is transmitted at a high rate over a long distance The performance was poor and the anti-interference ability was relatively poor. Later, various transmission modes were proposed, such as LVDS, TDMS, GVIF, P&D, DVI and DFP, etc. They actually just encode the TTL signal sent by the CPU or graphics card into various signals for transmission, and decode the received signal on the LCD side to obtain the TTL signal.
But no matter which transmission mode is used, the essential TTL signal is the same.
Note: TTL/LVDS are two signal transmission modes respectively. TTL is a mode in which high level represents 1 and low level represents 0. LVDS has two corresponding waveforms, positive and negative. The difference between the two waveforms is used to indicate the current state. 1 or 0
SPI mode
There are less used ones, there are 3-wire and 4-wire ones, the connections are CS/, SLK, SDI, SDO. There are few connections but the software control is more complicated.
MDDI mode (MobileDisplayDigitalInterface)
The interface MDDI proposed by Qualcomm in 2004 can improve the reliability of mobile phones and reduce power consumption by reducing connections. It will replace the SPI mode and become a high-speed serial interface in the mobile field. The main connections are host_data, host_strobe, client_data, client_strobe, power, and GND.
DSI mode
This mode is a serial bidirectional high-speed command transmission mode, and the connections are D0P, D0N, D1P, D1N, CLKP, and CLKN.
How to tell the type of microcontroller from LCD electrodes:
Picking up the measured signal through a measuring instrument is a commonly used data acquisition method in the forward channel design of single-chip microcomputer. Usually, the interface circuit obtains relevant analog signals from the instrument circuit and sends them to the microcontroller through A/D conversion or V/F conversion; or it obtains a frequency signal and sends it to the microcontroller after shaping. However, such a signal may not be found in some measuring instrument circuits. Take the capacitive pressure sensor sphygmomanometer as an example. Although a frequency signal linearly related to the pressure can be obtained from its oscillation circuit and sent to the microcontroller to measure the pressure, this pressure is not the systolic blood pressure, diastolic blood pressure and heart rate to be picked up. ; An ordinary blood pressure monitor does not have a communication interface like a smart instrument to communicate with a microcontroller. Obviously, the only way to pick up the measured signal through such an instrument is to directly read the reading on its display screen.
This article takes a fully automatic blood pressure monitor as an example to introduce the interface circuit for reading LCD display readings into a microcontroller. The sphygmomanometer display is a 61/2-digit LCD display, with 3 digits showing systolic blood pressure and 3 digits showing diastolic blood pressure. The l/2 digit is in the middle of the two sets of numbers and displays 4 indicator symbols.
1 LCD electrode connection structure and operating waveform
1.1 LCD electrode connection structure
Figure 1 shows the electrode connection structure and equivalent circuit of the blood pressure monitor LCD. Among them, Figure 1(a) shows the common electrode connection arrangement, and Figure 1(b) shows the segment electrode connection arrangement. It has a total of 4 common electrodes COM0~COM3, and each digit has 2 segment electrodes Sx-0 and Sx-1. Its equivalent circuit is a matrix with 4 rows and 2 columns, as shown in Figure 1(c) .
1.2 LCD working waveform
Use a dual-trace oscilloscope to observe the working waveform of the blood pressure monitor LCD, as shown in Figure 2. It is driven by the time division driving method, with a bias ratio of 1/3, a duty cycle of 1/4, and type B. The signal waveforms of the common electrodes COM0~COM3 always remain unchanged, and the signal waveforms of the segment electrodes Sx-0 and Sx-1 change as the displayed numbers change. The Sx-1 and Sx-1 waveforms in Figure 2 are the operating waveforms when the number "O" is displayed.
It can be seen from Figure 2 that regardless of the DC component of the signal, the first half period t1~t4 and the second half period t5~t8 of all waveforms are equal in size and opposite in polarity. The signal voltages of COM0~COM3 reach their peak values within four periods of time from t1 to t4. Time t1 is the scanning time of segments f and a on the first line, the common electrode COM0, Sx-0 is the segment electrode of segment f, and Sx-1 is the segment electrode of segment a. During the time t1, the voltage on segment f is COM0-Sx-0=V0, and the voltage on segment a is COM0-Sx-1=V0. Both segments f and a are in the selected state and are displayed. The voltage and display status of the remaining segments during their scanning time are listed in Table 1. Among the 7 segments, only the voltage on segment g is V0/3, which is in a non-selected state and is not displayed. The remaining 6 segments are all selected and displayed. Therefore, the number "O" is displayed.
It can be seen that as long as the voltage COMx-Sx-y (x=0, 1, ..., 6; y) on each segment of f, a, g, b, e, c, d during the four periods of time t1 to t4 is checked, =O, 1) Whether it is V0 or V0/3, you can get the glyph code of each LCD digit, and then convert the glyph code into the measurement result.
2 Microcontroller reading interface circuit
Figure 3 shows the 805l microcontroller reading interface circuit designed based on the above working principle. In the figure, the LCD is the liquid crystal display of the sphygmomanometer. The 6-digit numbers are numbered O~5 from right to left, and the middle half digit is numbered 6. It has 13 segment electrodes, 4 COM electrodes, and GND is the ground terminal of the blood pressure monitor. The PC port of 805l is the extended parallel port of 805l.
2.1 Display status reading circuit
The display status reading circuit is composed of CD4067, CD3405l, and LM324 (UA, UB) to read the display status of each LCD digital segment. The CD41367 multi-channel analog switch selects one Sx-x channel from the 13 segment electrode signals of the LCD and outputs it to the inverting input pin 2 of the LM324 (UA). The CD405l multi-channel analog switch selects one COMx from the 4 COM signals of the LCD and outputs it to the non-inverting input pin 3 of the LM321(UA). LM324(UA) is connected as an analog subtractor, and pin 1 outputs the signal COMx-Sx-x. UB is used as a voltage comparator, and the reference voltage VR is adjusted between V0/3 and V0 by the potentiometer W1, and the segment voltage COMx-Sx-x is compared with VR. The comparison result is the display status of the segment. A high level indicates that the segment is displayed, and a low level indicates that the segment is not displayed. The display status is sent to the P1.6 pin of 8051. R1 and C1 form an RC filter to filter out high-frequency interference.
For example, to read the display status of segment a of digital number 0, as shown in Figure 1, the segment electrode of segment a of digital number 0 is S0-1, and the common electrode is COM0. It is controlled by the program to set PC1PC0=00 within t1 time, so that CD405l selects COM0, sets PC5~PC2=0001, and makes CD4067 select S0-1. The two signal voltages of COM0 and S0-1 are subtracted by the UA subtractor, and then passed through UB After voltage comparison, the display status of segment a is obtained, and 8051 reads the most displayed status from pin P1.6.
2.2 INT0 interrupt signal generation circuit
UC and UD form the INT0 interrupt signal generating circuit. UC is connected as a voltage follower to reduce the impact of the circuit on the COM0 signal. R2 and C2 form an RC filter to filter out high-frequency interference. UD is used as a voltage comparator, the reference voltage VR is added to the non-inverting input terminal, and the VR size is adjusted from 2V0/3 to V0 by the potentiometer W2. The voltage comparator converts the COM0 signal into an INT0 negative pulse signal, and the working waveform is shown in Figure 4. The falling edge of the negative pulse is the starting moment of the LCD drive signal period T. This negative pulse is connected to the INT0 pin of 8051, and an external interrupt 0 is generated on the falling edge of the negative pulse.
3Programming
Enable external interrupt 0 and timer T0, and read the glyph code of each LCD digit in interrupt mode. The main program reads the glyph code in query mode, and then converts the glyph code into readings through reading verification, decoding the glyph code to BCD code, reading recognition, etc.
3.1 Read glyph code
Read the glyph code of a certain number on the LCD in interrupt mode through external interrupt O and timer T0. As shown in Figure 5, the negative pulse of INT0 causes an external interrupt O at the beginning of the period T. The INT0 interrupt service routine starts the T0 timer, sequentially f, a, g, b, e within the half cycle of t1 to t4. , c, and d generate T0 interrupts at each moment, read the display status of each segment, and obtain the glyph code. The T0 timer is set to working mode 2, the automatic reload timing time is T/16, and the initial timing time is T/32. The flow of INT0 and T0 interrupt service routines is shown in Figure 6.
Among them, PC port data format: PC5~PC3 are the LCD digital numbers to be read, PC2 is the segment electrode number, and PC1PC0 is the COM electrode number.
3.2 Glyph code conversion
The main program reads the glyph codes of each digit collected by the interrupt service program in query mode, looks up the table to convert the glyph code into a BCD code, and then converts the BCD code of several digits into a numerical value.
3.3 Reading verification
Reading a one-digit glyph code requires 1 cycle T (actually only the first half cycle is used). After measurement, T=16.318ms. It takes at least 7 cycles, about 114ms, to read all the digits. Considering that during the reading process of the microcontroller, the LCD reading may change and lead to reading errors, the program uses two consecutive readings to verify the correctness of the readings. If two consecutive readings are the same, the reading is correct; if two consecutive readings are different, the reading may be wrong and should be read again.
3.4 Reading identification
In addition to systolic blood pressure, diastolic blood pressure and heart rate, the blood pressure monitor displays instantaneous pressure during inflation and deflation as well as some status information. The middle half of the LCD (number 6) is used to display the four symbols of standby (Reay to measure), inflation (CUFF Inf1aTIng), deflation (CUFF Deflating) and battery replacement (Replace Battcries). In addition, when the number 4 displays "E", it indicates a measurement error. When it displays "P", the numbers displayed on the right three digits (numbers 0 to 2) are the heart rate. When both left and right display contents are numbers, the three digits on the left (numbers 3 to 5) are systolic blood pressure, and the three digits on the right are diastolic blood pressure. Blood pressure and heart rate are displayed alternately. The main program uses this information to identify the content displayed on the LCD.
4 Conclusion
Using this interface circuit to collect data eliminates the need to consider the details and technical specifications associated with the measurement of picked-up signals. In this way, when the measurement of the picked-up signal is complicated, the development cycle can be effectively shortened. At the same time, it does not have the problem that the data collected by the microcontroller and the instrument reading are not completely consistent with the secondary A/D conversion or V/F conversion method.
The program is designed to read one digit in one driving signal cycle. This reading speed is sufficient for a blood pressure monitor whose readings do not change very quickly. If the LCD reading of the measuring instrument changes quickly, you can modify the programming to read several digits at the same time in one cycle, or even modify the circuit design so that the second half of the cycle is also used for reading, so that all digits can be read in one signal cycle. Digital.
How to use a multimeter to determine LCD pins?
Turn on the multimeter and connect it to the resistor, preferably the one with a buzzer. One test lead touches the antenna shell of the set-top box, and one test lead gradually releases each needle. When a beep appears, or the test lead does not move away, it always beeps continuously, indicating that the needle is ground (GND). Continue to measure other needles. When the test lead touches The short beep of the needle corner is VCC. In this way, GND and VCC are determined. The remaining two pins of the three pins are RX and TX. The remaining two pins of the same four pins are also RX and TX. The judgment of the five-pin is to turn the multimeter to the 20V position, connect one pin to GND, and gradually measure the voltage. There are two situations at this time. The first one: there may be almost no voltage. At this time, looking at the board, I found that there are two SMD transistors near the pin seats. I just considered using 2-3-5 of the RS232 serial port to connect them. . Second, if you measure the voltage on five pins, remove the two pins with the highest and lowest voltage, and the rest are RX and TX. Because the one with the highest voltage is VCC and the one with the lowest voltage is BT.
/RD (0 means reading data)
- LED acceleration and deceleration motion display composed of CD4017
- DCD-1240 multifunctional rechargeable lighting
- Lighting sound-activated switch circuit using thyristors Part 3
- Gift lamp music box circuit
- Simple light-controlled street light circuit (7)
- Mains undervoltage and overvoltage protection circuit 2
- Electronic music dimming desk lamp circuit
- Microwave Doppler warning circuit
- Two-way electronic music doorbell circuit
- Touch lighting switch circuit three
- Ultra-low power consumption LCD liquid crystal display circuit module design circuit diagram
- LCD boost circuit for MP3 player
- Siemens S7-200PLC internal S485 interface circuit diagram
- MAX16834 driver LED circuit diagram
- fsk modulation and power line interface circuit diagram
- SAA1064 serial I2C bus LED dynamic driver interface circuit diagram
- LCD power bias circuit diagram
- Interface between LCD 7-segment display and microcontroller
- 4-digit LCD static display circuit
- MPX5100 LCD pressure gauge circuit