66
7.3
Timer2
CW6632B Bluetooth 3.0 Audio Player SOC
Version 1.0.0
Copyright ©2015, www.appotech.com. All Rights Reserved.
7.3.1
Timer2 Features
16bits counter
7bits pre-scaler
Counter mode (clock source from system clock or TMR2)
Capture mode (event source from CAP2)
PWM mode (PWM signal output to PWM2)
7.3.2
Timer2 Special Function Registers
Register 7-10 TMR2CON0
– Timer2 control 0
Position
7
6
5
4
3
2
1
0
Name
T2ES
T2M
Reserve
T2IS
Default
0
0
0
0
0
0
0
0
Access
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
T2ES
: Timer2 Capture Edge Select
00 = CAP2 Rising Edge
01 = CAP2 Falling Edge
1X= CAP2 Rising Edge and Falling Edge
T2M:
Timer2 Mode Select
00 = Timer2 is disabled
01 = Timer2 is enabled and works in Counter Mode
10 = Timer2 is enabled and works in PWM Mode
11 = Timer2 is enabled and works in Capture Mode
T2IS
: Timer2 Increase Source
000 = TMR2 Rising Edge
001 = TMR2 Falling Edge
010 = TMR2 Rising and Falling Edge
011 = External 32 KHz crystal oscillator
1xx = System Clock cycle
Register 7-11 TMR2CON1
– Timer2 control 1
Position
7
6
5
4
3
2
1
0
Name
T2TPND
T2CPND
T2TIE
T2CIE
-
T2PSR
Default
0
0
0
0
-
0
0
0
Access
R/W
R/W
R/W
R/W
-
R/W
R/W
R/W
T2TPND
: Timer2 over Flow Pending Bit
0 = Not Pending
1 = Pending
T2CPND
: Timer2 Capture mode Pending Bit