EasyManua.ls Logo

SONIX SN8P2501D - T0 Timer Operation Explame

Default Icon
96 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SN8P2501D
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 71 Version 1.5
8.2.5 T0 TIMER OPERATION EXPLAME
T0 TIMER CONFIGURATION:
; Reset T0 timer.
MOV
A, #0x00
; Clear T0M register.
B0MOV
T0M, A
; Set T0 clock source and T0 rate.
MOV
A, #0nnn0000b
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.

Table of Contents

Related product manuals