MOV B, #10
DIV AB
MOV R7, A
LCALL F_LCD_load ;R6 is the number, which is 1~6, R7 is the number to be displayed
MOV R6, #2 ;LCD_load(2,hour%10);
MOV A, hour
MOV B, #10
DIV AB
MOV R7, B
LCALL F_LCD_load ;R6 is the number, which is 1~6, R7 is the number to be displayed
MOV R6, #3 ;LCD_load(3,minute/10);
MOV A, minute
MOV B, #10
DIV AB
MOV R7, A
LCALL F_LCD_load ;R6 is the number, which is 1~6, R7 is the number to be displayed
MOV R6, #4 ;LCD_load(4,minute%10);
MOV A, minute
MOV B, #10
DIV AB
MOV R7, B
LCALL F_LCD_load ;R6 is the number, which is 1~6, R7 is the number to be displayed
MOV R6, #5 ;LCD_load(5,second/10);
MOV A, second
MOV B, #10
DIV AB
MOV R7, A
LCALL F_LCD_load ;R6 is the number, which is 1~6, R7 is the number to be displayed
MOV R6, #6 ;LCD_load(6,second%10);
MOV A, second
MOV B, #10
DIV AB
MOV R7, B
LCALL F_LCD_load ;R6 is the number, which is 1~6, R7 is the number to be displayed
RET
;************************************************************
T_COM:
DB 008H, 004H, 002H, 001H
F_LCD_scan:
MOV A, scan_index ;j = scan_index >> 1;
CLR C
RRC A
MOV R7, A ;R7 = j
ADD A, #LCD_buff
MOV R0, A ;R0 = LCD_buff[j]
ORL P2M1, #00fH ;All COM outputs are high impedance, and COM
s voltage is the
midpoint
ANL P2M0, #0f0H
MOV A, scan_index
JNB ACC.0, L_LCD_Scan2 ;if(scan_index & 1) // Reverse scan
MOV A, @R0 ;P1 = ~LCD_buff[j];
CPL A