SN8P2977
8-Bit Micro-Controller with Regulator, PGIA, 24-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 74
Version 1.7
JMP
EXIT_CKTT0CVAL:
; If FC = 1, jmp EXIT_CKTT0CVAL
B0BSET
T0IRQFLAG
; Set T0IRQFLAG (T0C counts overflow.).
EXIT_CKTT0CVAL:
MOV
A, NEWT0C
MOV
OLDT0C, A
; Update T0C value
RET
; Exit sub-routing.
CKT_T0FLAG sub-routing (Check T0 timer overflow flag).
CKT_T0FLAG:
B0BTS1
T0IRQFLAG
; Check T0IRQ status.
JMP
EXIT_CKTT0FLAG
; Jmp EXIT_CKTT0FLAG.
B0BCLR
T0IRQFLAG
; Clear T0IRQFLAG.
CALL
DELAY
; Call delay time = over 1/32.768ms (for RTC limit).
B0BCLR
FT0IRQ
; Clear FT0IRQ.
.
CALL
UPDATE_TIME
; Update time.
.
EXIT_CKTT0FLAG:
RET
; Exit sub-routing.
Into green mode before.
CALL
CKT_T0CVAL
; Check T0C value overflow
CALL
CKT_T0FLAG
; Check T0C overflow Flag and update time.
Process green mode after wakeup.
INTO_GREENMODE: .
B0BCLR
FCPUM0
B0BSET
FCPUM1
; Into green mode
WAKEUP:
B0BTS1
FT0IRQ
; Check FT0IRQ
JMP
CKT_OTHER
; Check other trigger wakeup source.
CALL
DELAY
; Call delay time = over 1/32.768ms (for RTC limit).
CLR
T0FLAG
; Clear T0FLAG.
B0BCLR
FT0IRQ
; Clear FT0IRQ.
MOV
A, T0C
MOV
OLDT0C, A
; Update T0C value
CALL
UPDATE_TIME
; Update time.
.
CKT_OTHER:
.
.