Initialization based on LCD liquid crystal display module

Solution: Liquid crystal display is abbreviated as LCD (Liquid Crystal Diodes), which is a passive display, that is, the liquid crystal itself does not emit light. After the liquid crystal is processed, it can change the light transmission direction to achieve the purpose of displaying characters or graphics.

There are two types of LCD monitors: pen-segment type and dot matrix type. The dot matrix type can be divided into character type and image type. The pen-segment LCD display is similar to the LED digital tube display. The segment electrode of each display includes seven strokes (segments) and a back electrode BP (or COM). It can display numbers and simple characters, and each number and character corresponds to its glyph code (segment code).

The segment electrodes and the back electrodes of the dot matrix LCD display are distributed in orthogonal strips, and the liquid crystal is located between the orthogonal strip electrodes. The control of the dot matrix LCD generally adopts the line scanning mode, and the scanned dots are controlled through two shift registers.

The basic interface circuit of 80C51 and liquid crystal display module LCM is shown as in Fig. 1.

Initialization based on LCD liquid crystal display module

Liquid crystal display module initialization subroutine (set the system to display 2 lines of characters, 5×7 dot matrix, open display, display cursor, flashing characters, clear screen, cursor in moving mode, automatic address in incremental mode.):

After the power is turned on, after the power rises to 4.5V and maintains for 15ms, write the function setting control word, select the number of data interface bits, etc.; wait for 5ms, check the busy flag, and then perform other function settings if it is not busy ; Check the busy sign and turn off the display if it is not busy; check the busy sign, and clear the screen if it is not busy; check the busy sign, and set the input mode when it is not busy, and the initialization ends. The procedure is as follows:

LCD: MOV A, #38H; 8-bit data, 2-line display, 5×7 dot matrix

MOV DPTR, #8000H; LCD port address

MOVX @DPTR, A LCALL BUSY

MOV A, #01H; Clear screen MOV DPTR, #8000H MOVX @DPTR, A LCALL BUSY

MOV A, #07H; AC automatically increases by 1, the overall display moves

MOV DPTR, #8000H

MOVX @DPTR, A LCALL BUSY

MOV A, #0FH; Turn on display, turn on the cursor, and the characters flash

MOV DPTR, #8000H

MOVX @DPTR, A RET

BUSY: PUSH DPH; protect the scene

PUSH DPL

PUSH PSW

PUSH ACC

LOOP: MOV DPTR, #8001H; read BH and AC MOVX A, @DPTR JB ACC.7, LOOP; busy, continue to wait

POP ACC; not busy, return to the scene

POP PSW

POP DPL

POP DPH

RET

Ningbo Autrends International Trade Co.,Ltd. , https://www.supermosvape.com