SN8P2977
8-Bit Micro-Controller with Regulator, PGIA, 24-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 69
Version 1.7
8.2 TIMER 0 (T0)
8.2.1
OVERVIEW
The T0 is an 8-bit binary up timer and event counter. If T0 timer occurs an overflow (from FFH to 00H), it will continue
counting and issue a time-out signal to trigger T0 interrupt to request interrupt service.
The main purposes of the T0 timer are as following.
8-bit programmable up counting timer:
Generates interrupts at specific time intervals based on the selected
clock frequency.
RTC timer:
Generates interrupts at real time intervals based on the selected clock source.
RTC function is only
available in code option = "IHRC_RTC".
Green mode wakeup function:
T0 can be green mode wake-up time as T0ENB = 1. System will be wake-up by
T0 time out.
Fcpu
T0 Rate
(Fcpu/2~Fcpu/256)
T0ENB
CPUM0,1
T0C 8-Bit Binary Up Counting Counter
T0 Time Out
Load
Internal Data Bus
T0ENB
RTC
T0TB
Note:
In RTC mode, the T0 interval time is fixed at 0.5 sec and isn’t controlled by T0C.
8.2.2
T0M MODE REGISTER
0D8H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
T0M
T0ENB
T0rate2
T0rate1
T0rate0
-
TC0X8
TC0GN
T0TB
Read/Write
R/W
R/W
R/W
R/W
-
R/W
R/W
R/W
After reset
0
0
0
0
-
0
0
0
Bit 0
T0TB:
RTC clock source control bit.
0 = Disable RTC (T0 clock source from Fcpu).
1 = Enable RTC, T0 will be 0.5 sec RTC (Low clock must be 32768 crystal).
Bit 1
TC0GN:
Enable TC0 Green mode wake up function
0 = Disable.
1 = Enable.
Bit 2
TC0X8:
TC0 internal clock source control bit.
0 = TC0 internal clock source is Fcpu. TC0RATE is from Fcpu/2~Fcpu/256.
1 = TC0 internal clock source is Fosc. TC0RATE is from Fosc/1~Fosc/128.