SN8P2714X_2715
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 61
V1.4
8.2.3 TC0C COUNTING REGISTER
TC0C is an 8-bit counter register for the timer counter (TC0). TC0C must be reset whenever the TC0ENB is set “1” to
start the timer counter. TC0C is incremented by one with a clock pulse which the frequency is determined by
TC0RATE0 ~ TC0RATE2. When TC0C has incremented to “0FFH”, it is will be cleared to “00H” in next clock and an
overflow is generated. Under TC0 interrupt service request (TC0IEN) enable condition, the TC0 interrupt request flag
will be set “1” and the system executes the interrupt service routine.
TC0C initial value = xxxx xxxx
0DBH
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
TC0C
TC0C7 TC0C6 TC0C5 TC0C4 TC0C3 TC0C2 TC0C1 TC0C0
R/W R/W R/W R/W R/W R/W R/W R/W
The equation of TC0C initial value is as following.
TC0C initial value = 256 - (TC0 interrupt interval time * input clock)
Â
Example: To set 10ms interval time for TC0 interrupt at 3.58MHz high-speed mode. TC0C value (74H) = 256 -
(10ms * fcpu/256)
TC0C initial value = 256 - (TC0 interrupt interval time * input clock)
= 256 - (10ms * 3.58 * 10
6
/ 256)
= 256 - (10
-2
* 3.58 * 10
6
/ 256)
= 116
= 74H