高手们,谁有RT0802B-1的驱动程序啊?只要能点亮其中一个数字就好的 刚写了一个,可怎么也调不通.请高手指教
;RT0802B-1 显示测试部分程序 CS bit p2.0 ;片选信号 下降沿 enable signel RW bit p2.1 ;读写信号 H 读 L 写 RS bit p2.2 ;register selcet input ; DB0 - DB7 select P10 - P17 org 0000h ljmp main org 0003h main: call delay_400ms mov p2, #0f0h mov r0, #03h wait: clr rs clr rw mov p1, #30h setb cs clr cs call delay_400ms djnz r0, wait call delay_400ms
mov a, #38h ;DL=1 8 bit data N=0 1 行 ; F=0 5* 7 dot字形 function set call LCD_sendcmd mov a, #01h ;clear display call LCD_sendcmd
mov a, #07h ; AC IN call LCD_sendcmd
mov a, #10h ; display on D=1 call LCD_sendcmd mov a, #0ch ; display on D=1 call LCD_sendcmd ;mov a, #80h ;ddram address ;call LCD_sendcmd ;---------------------------------------------- call delay_400ms
mov r2, #50h disp_loop: mov a, #0feh call LCD_senddat djnz r2, disp_loop
mov a, #02h ; display return call LCD_sendcmd call delay_400ms mov r2, #50h disp_loop1: mov a, #0FEH call LCD_senddat djnz r2, disp_loop1
mov a, #02h call LCD_sendcmd call delay_400ms
mov r2, #50h disp_loop2: mov a, #0FEH call LCD_senddat djnz r2, disp_loop2
mov a, #02h call LCD_sendcmd call delay_400ms
mov r2, #50h mov a, #20h disp_loop3: inc a call LCD_senddat djnz r2, disp_loop3
mov a, #02h call LCD_sendcmd call delay_400ms
ljmp main
;====================================================== ;------------------------------------------------ LCD_senddat: setb RS setb RS clr RW clr RW setb CS setb CS mov p1, a mov p1, a clr CS clr CS mov r1, #0ffh djnz r1, $ ret
;--------------------------------------- LCD_sendcmd: clr RW ;write clr RW clr RS ;指令寄存器 clr RS setb CS ;片选信号 clear setb CS mov p1, A ; 指令 mov p1, A clr CS ; 片选信号选通 clr CS
mov r0, #02h delay_loop: mov r1, #0ffh djnz r1, $ djnz r0, delay_loop ret ;=============================================== delay_400ms: call delay_130ms call delay_130ms call delay_130ms ret ;------------------------------------------------ delay_130ms: mov r0, #0ffh delay_130ms_loop: mov r1, #0ffh djnz r1, $ djnz r0, delay_130ms_loop ret end |