LCD1602汇编显示程序.doc
Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-dateLCD1602汇编显示程序LCD1602汇编显示程序;1602显示ABCLCD_RS EQU P2.5LCD_RW EQU P2.6LCD_EN EQU P2.7LCD_DATA EQU P3;- ORG 0000H JMP START ORG 0030H;-LCD: CALL LCD_INIT MOV A, #80H CALL LCD_WCMD MOV A, #'A' CALL LCD_WDATA MOV A, #'B' CALL LCD_WDATA MOV A, #'C' CALL LCD_WDATA AJMP $;-DELAY5MS: MOV R6, #10DL1:DJNZ R7, $ DJNZ R6, DL1 RET;-LCD_INIT: CALL DELAY5MS MOV A, #38H CALL LCD_WCMD CALL DELAY5MS CALL DELAY5MS MOV A, #06H CALL LCD_WCMD MOV A, #01H CALL LCD_WCMD MOV A, #0CH CALL LCD_WCMD RET;=LCD_WCMD: CALL CHECKBUSY CLR LCD_RS JMP W_LCD;-LCD_WDATA: CALL CHECKBUSY SETB LCD_RSW_LCD: CLR LCD_RW MOV LCD_DATA, A SETB LCD_EN NOP CLR LCD_EN RET;-CHECKBUSY: PUSH ACC MOV LCD_DATA, #255 CLR LCD_RS SETB LCD_RWBUSYLOOP: SETB LCD_EN NOP MOV A, LCD_DATA CLR LCD_EN JB ACC.7, BUSYLOOP POP ACC RET;=END-