SN8P2714X_2715
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 59
V1.4
8.2.2 TC0M MODE REGISTER
The TC0M is the timer counter mode register, which is an 8-bit read/write register. By loading different value into the
TC0M register, users can modify the timer counter clock frequency dynamically when program executing.
Eight rates for TC0 timer can be selected by TC0RATE0 ~ TC0RATE2 and TC0X8 bits. If TC0X8=1 the TC0 clock will
come from Fosc and the range is from Fosc/1 to Fosc/128, if TC0X8=0 (Initial), the range is from Fcpu/2 to Fcpu/256.
The TC0M initial value is zero and the rate is Fcpu/256. The bit7 of TC0M named TC0ENB is the control bit to start
TC0 timer. The combination of these bits is to determine the TC0 timer frequency.
T0M initial value = xxxx 00xx
0D8H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
T0M - -
-
- TC1X8
TC0X8
-
- - - - R/W
R/W
-
Bit3
TC1X8
: Multiple TC1 timer speed eight times. Refer TC1M register for detailed information.
0 = TC1 clock came from Fcpu
1 = TC1 clock came from Fosc
Bit2
TC0X8
: Multiple TC0 timer speed eight times. Refer TC0M register for detailed information.
0 = TC0 clock came from Fcpu
1 = TC0 clock came from Fosc
Note: Under TC0 event counter mode (TC0CKS=1), TC0X8 bit and TC0RATE are useless.
TC0M initial value = 0000 0000
0DAH
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
TC0M
TC0ENB TC0RATE2
TC0RATE1 TC0RATE0
TC0CKS ALOAD0 TC0OUT
PWM0OUT
R/W R/W R/W R/W R/W R/W R/W R/W
Bit 7
TC0ENB:
TC0 counter enable bit.
0 = disable
1 = enable
Bit [6:4]
TC0RATE [2:0]:
TC0 internal clock rate select bits. Only for TC0CKS = 0
TC0Rate
TC0X8=0
TC0X8=1
000 Fcpu/256
Fosc/128
001 Fcpu/128
Fosc/64
010 Fcpu/64
Fosc/32
011 Fcpu/32
Fosc/16
100 Fcpu/16 Fosc/8
101 Fcpu/8 Fosc/4
110 Fcpu/4 Fosc/2
111 Fcpu/2 Fosc/1
Bit 3
TC0CKS:
TC0 clock source select bit.
0 = Internal clock source (Fcpu or Fosc)
1 = External clock source input from P0.0 (INT0) pin.
Bit 2
ALOAD0:
Auto-reload control bit.
0 = None auto-reload
1 = Auto-reload.
Bit 1
TC0OUT:
TC0 time-out toggle signal output control bit.
Only valid when PWM0OUT = 0
0 = Disable TC0OUT signal output and enable P5.4’s I/O function,
1 = Enable TC0OUT signal output and disable P5.4’s I/O function.