1. The main parameters of the segment code LCD screen
Material: TN, HTN, STN, BTN (ie VATN), FSTN and other materials
Display mode: positive display, negative display
Polarizer type: fully transparent, semi-transparent, reflective
Connection method: metal pin connection, conductive adhesive strip connection, hot pressing paper connection, FPC flexible wire connection
Working voltage: usually set working voltage between 3~5V, LCD power consumption is about 10μA
Working temperature: The temperature range can be set according to the working environment of the LCD, and the widest temperature is about -35°C~85°C
2. Realization principle of segment code LCD screen
Each segment in the segment code screen is filled with a special liquid crystal. Under the action of the electric field, the arrangement direction of the crystals will be reversed, thereby changing its light transmission, so that the displayed content can be seen; to make the crystals reverse, a voltage greater than the threshold value must be applied across the electrodes. Display content.
So to drive the LCD segment code screen, we need to pay attention to three parameters: operating voltage, Duty (duty cycle) and BIAS (bias ratio).
Working voltage: the maximum allowable voltage for the segment code screen driver; the working voltage is usually set between 3~5V, and the LCD power consumption is about 10μA.
Duty (duty cycle): also known as the number of COMs; since the STN/TN LCD generally adopts the driving mode of time-division dynamic scanning, in this mode, the ratio of the effective gate time of each COM to the entire scanning period is the ratio of The duty ratio (Duty) is fixed, equal to 1/COM number.
BIAS (bias ratio): Generally speaking, Bias is expressed by the ratio of the lowest gear to the highest output voltage. The bias ratio is to adjust the contrast between the displayed black bright characters and the surrounding liquid crystal dots. The threshold voltage is generally equal to the working voltage * bias ratio; for example: 3V working voltage, 1/3 bias ratio, the threshold voltage is about 3V/3=1V. In actual use, in order to ensure a good display effect, the voltage difference applied to both ends of the electrodes is usually close to the working voltage of the LCD; if it is not displayed, the voltage difference applied to both ends of the electrodes is usually close to 0V.
Generally speaking, there is a certain relationship between Bias and Duty. The more the duty, the shorter the scanning time corresponding to each COM, and to achieve the same display brightness and display contrast, the voltage of VON must be increased. The difference between the level and the non-selection level needs to be increased, that is, the Bias needs to be increased. An empirical formula can be found on the Internet
Special attention should be paid to the fact that the liquid crystal molecules need to be driven by AC signals, and the DC voltage cannot be applied to both ends of the electrodes for a long time, otherwise, it will affect the electrochemical characteristics of the liquid crystal molecules, causing blurred display effects and reduced service life. consequences, and its destructiveness is irreversible.
3. Segment code LCD driver implementation
Several common options:
1. MCU + dedicated LCD display driver chip. Commonly used driver chips include HT1621, HT1622, etc., and the corresponding bias ratios are 1/2, 1/3, 1/4. The communication between the MCU and the driver chip is mainly based on the serial port, and you can choose an MCU with fewer pins and fewer resources.
2. MCU comes with LCD driver peripherals. The bias voltage ratio selected by this scheme is usually 1/3, 1/4, mainly depends on the resource allocation of the MCU itself, and the peripheral circuit is very simple.
3. The MCU itself does not have the LCD driver function, and directly uses the IO port to simulate the drive, but the bias ratio can only be selected as 1/2, and it is necessary to add a pull-up resistor and a pull-down resistor to the COM port. At the same time, the IO port of the MCU can be Sets the state for push-pull outputs and floating inputs. It is only suitable for LCD screens with fewer dots.
The following mainly introduces the method of MCU directly using IO port to simulate driving LCD:
Hardware: Peripherals need to add pull-down and pull-down resistors on the COM and SEG ports. The resistance is generally 100K~200K. The IO port of the MCU can be set to the state of push-pull output and floating input.
The LCD screen is not displayed: all COM ports and PIN ports are set as floating inputs.
Let's take the following figure as an example to explain how to drive to display the number '1'.
To display '1', it is to light up the 3B and 3C liquid crystals. As can be seen from the figure below, these two segments are associated with PIN1, COM2 and COM3.
COM switches the input state and output state cyclically according to a certain cycle, and outputs high and low levels for a constant time.
PIN1 defaults to the input state. When COM2 outputs high level, it outputs low level; when COM2 outputs low level, it outputs high level; when COM3 outputs high level, it outputs low level; when COM3 outputs low level, it outputs high level.
Refer to the figure below for the output waveform
Consider the input state, when COM2 outputs high level, it outputs low level; when COM2 outputs low level, it outputs high level; when COM3 outputs high level, it outputs low level; when COM3 outputs low level, it outputs high level level.
The output waveform refers to the following figure