能帮我看个程序吗,不知道对不对 单片机接8155后再接1602LCD, 为什么判忙的时候要先给P0接口写入“1”? ORG 0000H AJMP BFLED BFLED:NOP NOP NOP MOV SP, #70H NOP NOP RS BIT P1.0 RW BIT P1.1 E BIT P2.6 MOV 50H, #00H ;显示缓存 MOV 51H, #00H MOV 52H, #00H MOV 53H, #00H MOV 54H, #00H MOV 55H, #00H MOV 30H,#01H;清屏 ACALL SEND ACALL WC MOV 30H,#38H;8位2行,5*7矩阵 ACALL SEND ACALL WC MOV 30H,#06H;文字不动,光标自动右移 ACALL SEND ACALL WC MOV 30H,#0C0H;写入显示起始地址,第二行第一个位置 ACALL SEND ACALL WC MOV 31H,R0 MOV R0,#50H;从50H到55H为显示缓存 XH:MOV 30H,@R0 ACALL SEND ACALL WD INC R0 CJNE R0,#56H,XH MOV R0,31H RET;显示完 WC: CLR RS;写入指令子程序 CLR RW CLR E ACALL PD SETB E RET WD: SETB RS;写入数据子程序 CLR RW CLR E ACALL PD SETB E RET PD: MOV 30H,#0FFH;判断显示忙否子程序 ACALL SEND CLR RS SETB RW CLR E NOP SETB E MOV DPTR,#8300H MOV A,#05H MOVX @DPTR,A MOV DPTR, #8302H ;读入数据 MOVX A, @DPTR MOV P0,A JB P0.7,PD RET SEND:MOV DPTR,#8300H;写入8155子程序 MOV A,#07H MOVX @DPTR,A MOV DPTR,#8302H MOV A,30H MOVX @DPTR,A RET END |