|
LcdDrive_init:
movlw 00001011b
andwf pt1en,1
; movlw 00000000b
; andwf pt5en,1
clrf R_Temp1
clrf R_Temp2
movfw R_LcdDate_Ge
call LcdData_Tab0
btfsc R_TimeFlag,B_FirstOnMode2
movlw FFH
btfsc R_TimeFlag,B_Error_En
movlw FFH
movwf R_Temp1
movfw R_LcdDate_Shi
call LcdData_Tab0
btfsc R_TimeFlag,B_FirstOnMode2
movlw FFH
btfsc R_TimeFlag,B_Error_En
movlw FFH
movwf R_Temp2
btfss R_LcdDate_Bai,0
goto LcdDrive_Deal
bsf R_Temp1,7
bsf R_Temp2,7
LcdDrive_Deal:
movfw R_LcdCom_Cnt
andlw 00001111b
addpcw
goto LcdDrive_Com1 ;1-2 seg - com
goto LcdDrive_Com2 ;2-1
goto LcdDrive_Com3 ;1-3
goto LcdDrive_Com4 ;3-1
goto LcdDrive_Com5 ;1-4
goto LcdDrive_Com6 ;4-1
goto LcdDrive_Com7 ;5-1
goto LcdDrive_Com8 ;2-3
goto LcdDrive_Com9 ;3-2
goto LcdDrive_Com10 ;4-3
goto LcdDrive_Com11 ;4-2
goto LcdDrive_Com12 ;5-2
goto LcdDrive_Com13 ;5-3
goto LcdDrive_Com14 ;5-4
goto LcdDrive_Com15 ;3-4
goto LcdDrive_Com16 ;2-4
LcdDrive_Com1:
btfss R_Temp1,6
return
call Set_Seg1
call Set_Com2
return
LcdDrive_Com2:
btfss R_Temp1,5
return
call Set_Seg2
call Set_Com1
return
LcdDrive_Com3:
btfss R_Temp1,4
return
call Set_Seg1
call Set_Com3
return
LcdDrive_Com4:
btfss R_Temp1,3
return
call Set_Seg3
call Set_Com1
return
LcdDrive_Com5:
btfss R_Temp1,2
return
call Set_Seg1
call Set_Com4
return
LcdDrive_Com6:
btfss R_Temp1,1
return
call Set_Seg4
call Set_Com1
return
LcdDrive_Com7:
btfss R_Temp1,0
return
call Set_Seg5
call Set_Com1
return
LcdDrive_Com8:
btfss R_Temp2,6
return
call Set_Seg2
call Set_Com3
return
LcdDrive_Com9:
btfss R_Temp2,5
return
call Set_Seg3
call Set_Com2
return
LcdDrive_Com10:
btfss R_Temp2,4
return
call Set_Seg4
call Set_Com3
return
LcdDrive_Com11:
btfss R_Temp2,3
return
call Set_Seg4
call Set_Com2
return
LcdDrive_Com12:
btfss R_Temp2,2
return
call Set_Seg5
call Set_Com2
return
LcdDrive_Com13:
btfss R_Temp2,1
return
call Set_Seg5
call Set_Com3
return
LcdDrive_Com14:
btfss R_Temp2,0
return
call Set_Seg5
call Set_Com4
return
LcdDrive_Com15:
btfss R_Temp2,7
return
call Set_Seg3
call Set_Com4
return
LcdDrive_Com16:
btfss R_Temp1,7
return
call Set_Seg2
call Set_Com4
return
Set_Seg1:
bsf PT_Seg1,P_Seg1
bsf PT_Seg1_En,P_Seg1
return
Set_Seg2:
bsf PT_Seg2,P_Seg2
bsf PT_Seg2_En,P_Seg2
return
Set_Seg3:
bsf PT_Seg3,P_Seg3
bsf PT_Seg3_En,P_Seg3
return
Set_Seg4:
bsf PT_Seg4,P_Seg4
bsf PT_Seg4_En,P_Seg4
return
Set_Seg5:
bsf PT_Seg5,P_Seg5
bsf PT_Seg5_En,P_Seg5
return
Set_Com1:
bcf PT_Com1,P_Com1
bsf PT_Com1En,P_Com1
return
Set_Com2:
bcf PT_Com2,P_Com2
bsf PT_Com2En,P_Com2
return
Set_Com3:
bcf PT_Com3,P_Com3
bsf PT_Com3En,P_Com3
return
Set_Com4:
bcf PT_Com4,P_Com4
bsf PT_Com4En,P_Com4
return
LcdData_Tab0:
andlw 0fh
addpcw
retlw 01111110B ;0
retlw 00110000B ;1
retlw 01101101B ;2
retlw 01111001B ;3
retlw 00110011B ;4
retlw 01011011B ;5
retlw 01011111B ;6
retlw 01110000B ;7
retlw 01111111B ;8
retlw 01111011B ;9
retlw 01111011B ;9
retlw 01111011B ;9
retlw 01111011B ;9
retlw 01111011B ;9
retlw 01111011B ;9
retlw 01111011B ;9 |
|