SN8P2318 Series
C-type LCD, RFC 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 81
Version 1.5
8.2.5 T0 TIMER OPERATION EXAMPLE
T0 TIMER CONFIGURATION:
; Reset T0 timer.
MOV
A, #0x00
; Clear T0M register.
B0MOV
T0M, A
; Set T0 clock source and T0 rate.
MOV
A, #0
nnn
0
0
00b
B0MOV
T0M, A
; Set T0C register for T0 Interval time.
MOV
A, #
value
B0MOV
T0C, A
; Clear T0IRQ
B0BCLR
FT0IRQ
; Enable T0 timer and interrupt function.
B0BSET
FT0IEN
; Enable T0 interrupt function.
B0BSET
FT0ENB
; Enable T0 timer.
T0 works in RTC mode:
; Reset T0 timer.
MOV
A, #0x00
; Clear T0M register.
B0MOV
T0M, A
; Set T0 RTC function.
B0BSET
FT0TB
; Clear T0C.
CLR
T0C
; Clear T0IRQ
B0BCLR
FT0IRQ
; Enable T0 timer and interrupt function.
B0BSET
FT0IEN
; Enable T0 interrupt function.
B0BSET
FT0ENB
; Enable T0 timer.