SN8P2200 Series
USB 1.1 Low-Speed 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 78
Version 1.7
8.2.3 T0C COUNTING REGISTER
T0C is an 8-bit counter register for T0 interval time control.
0D9H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
T0C
T0C7 T0C6 T0C5 T0C4 T0C3 T0C2 T0C1 T0C0
Read/Write R/W
R/W
R/W R/W R/W R/W R/W R/W
After
reset
0 0 0 0 0 0 0 0
The equation of T0C initial value is as following.
T0C initial value = 256 - (T0 interrupt interval time * input clock)
¾
Example: To set 1ms interval time for T0 interrupt. High clock is internal 6MHz. Fcpu=Fosc/1. Select
T0RATE=010 (Fcpu/64).
T0C initial value = 256 - (T0 interrupt interval time * input clock)
= 256 - (1ms * 6MHz / 1 / 64)
= 256 - (10
-3
* 6 * 10
6
/ 1 / 64)
= 162
= A2H
The basic timer table interval time of T0.
High speed mode (Fcpu = 6MHz / 1)
T0RATE T0CLOCK
Max overflow interval One step = max/256
000
Fcpu/256
10.923 ms
42.67 us
001
Fcpu/128
5.461 ms
21.33 us
010
Fcpu/64
2.731 ms
10.67 us
011
Fcpu/32
1.365 ms
5.33 us
100
Fcpu/16
0.683 ms
2.67 us
101
Fcpu/8
0.341 ms
1.33 us
110
Fcpu/4
0.171 ms
0.67 us
111
Fcpu/2
0.085 ms
0.33 us
Note: In RTC mode, T0C is 256 counts and generatesT0 0.5 sec interval time. Don’t change T0C value in
RTC mode.