SN8P2604
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 74
Version 1.1
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 10ms interval time for T0 interrupt. High clock is external 4MHz. Fcpu=Fosc/4. Select
T0RATE=010 (Fcpu/64).
T0C initial value = 256 - (T0 interrupt interval time * input clock)
= 256 - (10ms * 4MHz / 4 / 64)
= 256 - (10
-2
* 4 * 10
6
/ 4 / 64)
= 100
= 64H
The basic timer table interval time of T0.
High speed mode (Fcpu = 4MHz / 4)
Low speed mode (Fcpu = 32768Hz / 4)
T0RATE T0CLOCK
Max overflow interval
One step = max/256
Max overflow interval
One step = max/256
000
Fcpu/256
65.536 ms
256 us
8000 ms
31250 us
001
Fcpu/128
32.768 ms
128 us
4000 ms
15625 us
010
Fcpu/64
16.384 ms
64 us
2000 ms
7812.5 us
011
Fcpu/32
8.192 ms
32 us
1000 ms
3906.25 us
100
Fcpu/16
4.096 ms
16 us
500 ms
1953.125 us
101
Fcpu/8
2.048 ms
8 us
250 ms
976.563 us
110
Fcpu/4
1.024 ms
4 us
125 ms
488.281 us
111
Fcpu/2
0.512 ms
2 us
62.5 ms
244.141 us
Note: T0C doesn’t support read and modify write instructions as “B0ADD M,A . INCMS…”.