MS12864F图形点阵液晶显示模块使用手册

GRAPHICTEXT\\\The relationship of external display RAM address and display position Example: Text home address: 0000H Text area: 00A0H MD2=0, MD3=0: 80 COLUMN DUAL=0, MDS=1, MD0=1, MD1=0: 28 LINES Display plane: 0000H 0001H - - - - - 004EH 004FH 00A0H 00A1H - - - - - 00EEH 00EFH : : : : : : : : : : : : : : : 10E0H 10E1H - - - - - 112EH 112FH 1 Line 2 Line : : : 28 Lines (2) Graphic home address and area set

The starting address of external display RAM for Graphic display is Defined by this command. The graphic home address shows the left end most Upper line.

The relationship of external display RAM address and display position. Example:

Graphic home address: 0000H Graphic area: 0020H

MD2=H, MD3=H: 32 COLUMNS DUAL=H, MDS=L, MD0=H, MD1=H: 2 LINES Example:

Display plane: 0000H 0001H - - - - - 001EH 001FH 0020H 0021H - - - - - 003EH 003FH : : : : : : : : : : : : : : : 01E0H 01E1H 01FEH 01FFH 7.33 MODE SET

The display mode is defined by this command. The display mode don't have changed until to send next this command. Logically \of text and graphic display can be displayed. When internal character generator mode is selected, character code 00H - 7FH are selected from built-in character generator ROM. The character code 80H-FFH are automatically selected external character generator RAM.

NOTE: Only text display is attributed, because attributed data is located. Attribute function

\is written in the graphic area defined by control word set command. The mode set command selects text display only and graphic the mode set command selects text display only and graphic display ST

cannot be displayed. The attribute data of the 1 character in text area

Is written at the IST 1 byte in graphic area, and attribute data of n-th 1byte in graphic area. Attribute function is defined as follow. Attribute RAM 1byte X X X X D3 D2 D1 D0 X: don't care D3 D2 D1 D0 FUNCTION 0 0 0 0 Normal display 0 1 0 1 Reverse display 0 0 1 1 Inhibit display 1 0 0 0 Blink of normal display 1 1 0 0 Blink of reverse display 1 0 1 1 Blink of inhibit display

Data auto write B0HStatus check 2Display data sendStatus check 2Display data sendAuto mode startStatus check 1Low address dataStatus check 1Address pointer set 24HStatus check 1Status check 2Auto reset B2HEND 7.34 DATA AUTO READ/WRITE CODE HEX FUNCTION OPERAND 10110000 B0H Data auto write set - 10110001 B1H Data auto read set - 10110010 B2H Auto reset - This command is convenient to send full screen data from external display RAM. After setting auto mode , \(or read)\command should follow the \pointer set\and address pointer is automatically increment by + 1 after each data. After sending (or receiving) all data

\reset\is necessary to return normal operation because all data is regarded \data\and no command can be accepted in the auto mode.

Note: status check for auto mode(STA2,STA3 should be checked between each Data. Auto reset should be performed after checking (STA3=1 STA2=1)

7.35 DATA READ WRITE CODE HEX FUNCTION OPERAND 11000000 C0H Data write and ADP increment Data 11000001 C1H Data read and ADP increment Data 11000010 C2H Data write and ADP decrement Data 11000011 C3H Data read and ADP decrement Data 11000100 C4H Data write and ADP nonvariable Data 11000101 C5H Data read and ADP nonvariable Data This command is used for data write from MPU to external display RAM, AND data read external display RAM to MPU. Data write/data read should be executed after setting address by address pointer set command. Address Pointer can be automatically increment by setting this command. Note: this command is necessary for each 1 byte data.

Please refer following flow chart. Data write startStatus check 1Low address dataStatus check 1Upper address dataStatus check 1Address pointer set 24HStatus check 1Write data setStatus check 1Data write C0HENDData readAddress pointer set Status check 1Data read C1HENDNOTE: (1) After power on, it is necessary to reset. /RESET is kept \5 CLOCK up(oscillation clock). (2) When /HALT has been \To turn off power supply for LCD, because LCD goes down by DC bias. (3) The HALF function contains the RESET function. (4) After state of RESET/HALT. TERMINAL HALT RESET D0-D7 F F D0-d7 F F R/w H H /ce H (NOTE 1) H (NOTE 1) Ad0-ad15 H (NOTE 2) H (NOTE 2) /ce0,/ce1 H (NOTE 1) H (NOTE 1) ED,HOD Final Data Final Data HSCP L L LP L L CDATA H H FR H H CH1 L K0 CH2 L VEND DSPON L L XO H OSC CLOCK

L: Level L

F: Floating (High impedance)

KO: Internal state (TEXT data access) normally open VEND: End signal of V-counter(Line count) if MDS=H, T2=L, HEND (end signal of H-count) normally open.

Note 1: In Attribute mode, H or L by state of Graphinc pointer. Note 2: In Attribute mode, DATA of Graphinc pointer.

八.应用举例

MS12864F与单片机8031的一种接口如图.所示:

注:V0为液晶驱动电压。此图为模块内自带负压的示例,若外接负压,则接到第4PIN。

利用上图举例介绍编程实例

ORG 0000H AJMP MAIN ORG 0003H AJMP INT ORG 0035H

;********************************************** DATA1 EQU 30H ;第一参数单元

DATA2 EQU 31H ;第二参数/数据单元 COMMAND EQU 32H ;指令代码单元 C_ADD EQU 8100H ;指令通道地址 D_ADD EQU 8000H ;数据通道地址

LI1 EQU 33H LI2 EQU 34H

;*********************************************** BUSY1:

PUSH DPH PUSH DPL

MOV DPTR,#C_ADD MOVX A,@DPTR POP DPL POP DPH RET

;*********************************************** BUSY: LCALL BUSY1

JNB ACC.0, BUSY1 JNB ACC.1, BUSY1 RET

;***************************************** WRITE_COMMAND:PUSH DPH PUSH DPL LCALL BUSY

MOV A,COMMAND MOV DPTR,#C_ADD MOVX @DPTR,A POP DPL POP DPH RET WRITE_DATA:

PUSH DPH PUSH DPL LCALL BUSY MOV A,DATA2

MOV DPTR,#D_ADD MOVX @DPTR,A POP DPL POP DPH RET

MS40: MOV R7,#0E8H MS2: MOV R6,#0FFH MS1: DJNZ R6,MS1 DJNZ R7,MS2 RET

DELAY: MOV R5,#05H DELAY1: LCALL MS40

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4