SN8P2714X_2715
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 68
V1.4
8.3.2 TC1M MODE REGISTER
The TC1M is an 8-bit read/write timer mode register. By loading different value into the TC1M register, users can
modify the timer clock frequency dynamically as program executing.
Eight rates for TC1 timer can be selected by TC1RATE0 ~ TC1RATE2 bits. If TC1X8=1 the TC1 clock will come from
Fosc and the range is from Fosc/1 to Fosc/128. if TC1X8=0 (Initial), the range is from Fcpu(Fosc)/2 to Fcpu(Fosc)/256.
The TC1M initial value is zero and the rate is Fcpu/256. The bit7 of TC1M called TC1ENB is the control bit to start TC1
timer. The combination of these bits is to determine the TC1 timer clock frequency and the intervals.
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 TC1 event counter mode (TC1CKS=1), TC1X8 bit and TC1RATE are useless.
TC1M initial value = 0000 0000
0DCH
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
TC1M
TC1ENB TC1RATE2
TC1RATE1 TC1RATE0
TC1CKS ALOAD1 TC1OUT
PWM1OUT
R/W R/W R/W R/W R/W R/W R/W R/W
Bit 7
TC1ENB:
TC1 counter enable bit.
0 = disable
1 = enable
Bit [6:4]
TC1RATE [2:0]:
TC1 internal clock rate select bits. Only for TC1CKS = 0
TC1Rate
TC1X8=0
TC1X8=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
TC1CKS:
TC1 clock source select bit.
0 = Internal clock source (Fcpu/Fosc)
1 = External clock source input from P0.1 (INT1) pin.
Bit 2
ALOAD1:
Auto-reload control bit.
0 = none auto-reload
1 = auto-reload.
Bit 1
TC1OUT:
TC1 time-out toggle signal output control bit.
Only valid when PWM1OUT = 0
0 = Disable TC1OUT signal output and enable P5.3’s I/O function,
1 = Enable TC1OUT signal output and disable P5.3’s I/O function.