SN8P2711A
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 85
Version 0.1
8.2.3 TC1X8, TC0X8, TC0GN FLAGS
0D8H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
T0M
- - - -
TC1X8
TC0X8
TC0GN
-
Read/Write
- - - -
R/W
R/W
R/W
-
After
reset
- - - - 0 0 0 -
Bit 1
TC0GN:
TC0 green mode wake-up function control bit.
0 = Disable TC0 green mode wake-up function.
1 = Enable TC0 green mode wake-up function.
Bit 2
TC0X8:
TC0 internal clock source control bit.
0 = TC0 internal clock source is Fcpu. TC0RATE is from Fcpu/2~Fcpu/256.
1 = TC0 internal clock source is Fosc. TC0RATE is from Fosc/1~Fosc/128.
Bit 3
TC1X8:
TC1 internal clock source control bit.
0 = TC1 internal clock source is Fcpu. TC1RATE is from Fcpu/2~Fcpu/256.
1 = TC1 internal clock source is Fosc. TC1RATE is from Fosc/1~Fosc/128.
Note: Under TC0 event counter mode (TC0CKS=1), TC0X8 bit and TC0RATE are useless.
8.2.4 TC0C COUNTING REGISTER
TC0C is an 8-bit counter register for TC0 interval time control.
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
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 TC0C initial value is as following.
TC0C initial value = N - (TC0 interrupt interval time * input clock)
N is TC0 overflow boundary number. TC0 timer overflow time has six types (TC0 timer, TC0 event counter, TC0 Fcpu
clock source, TC0 Fosc clock source, PWM mode and no PWM mode). These parameters decide TC0 overflow time
and valid value as follow table.
TC0CKS TC0X8 PWM0
ALOAD0
TC0OUT
N
TC0C valid
value
TC0C value
binary type
Remark
0
x
x
256
0x00~0xFF
00000000b~11111111b
Overflow per 256 count
1
0
0
256
0x00~0xFF
00000000b~11111111b
Overflow per 256 count
1
0
1
64
0x00~0x3F
xx000000b~xx111111b
Overflow per 64 count
1
1
0
32
0x00~0x1F
xxx00000b~xxx11111b
Overflow per 32 count
0
(Fcpu/2~
Fcpu/256)
1
1
1
16
0x00~0x0F
xxxx0000b~xxxx1111b
Overflow per 16 count
0
x
x
256
0x00~0xFF
00000000b~11111111b
Overflow per 256 count
1
0
0
256
0x00~0xFF
00000000b~11111111b
Overflow per 256 count
1
0
1
64
0x00~0x3F
xx000000b~xx111111b
Overflow per 64 count
1
1
0
32
0x00~0x1F
xxx00000b~xxx11111b
Overflow per 32 count
0
1
(Fosc/1~
Fosc/128)
1
1
1
16
0x00~0x0F
xxxx0000b~xxxx1111b
Overflow per 16 count
1
-
-
-
-
256
0x00~0xFF
00000000b~11111111b
Overflow per 256 count