EasyManua.ls Logo

STC micro STC8A8K64D4 Series - PCA Capture Value;Compare Value Registers (Ccapnl, Ccapnh); PCA PWM Mode Control Registers (Pca_Pwmn); PCA Operation Mode

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- 519 -
CCAPNn: PCAn Capture on falling edge enable bit
MATn: PCAn match function enable bit
TOGn: PCAn high speed pulse output function enable bit
PWMn: PCAn PWM output function enable bit
ECCFn: PCAn match/capture interrupt enable bit
18.2.5 PCA capture value/compare value registers (CCAPnL, CCAPnH)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
CCAP0L
EAH
CCAP1L
EBH
CCAP2L
ECH
CCAP3L
FD55H
CCAP0H
FAH
CCAP1H
FBH
CCAP2H
FCH
CCAP3H
FD56H
When the PCA capture function is enabled, CCAPnL and CCAPnH are used to save the count value (CL and CH) of
the PCA at the time of capture. When the PCA comparison function is enabled, the PCA controller compares the
current value in [CH,CL] and the value in [CCAPnH, CCAPnL], and the comparison result is given. When the
PCA match function is enabled, the PCA controller compares the current value in [CH, CL] with the value stored
in [CCAPnH, CCAPnL], and checks if they match (equal), then gives a match result.
18.2.6 PCA PWM mode control registers (PCA_PWMn)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
PCA_PWM0
F2H
EBS0[1:0]
XCCAP0H[1:0]
XCCAP0L[1:0]
EPC0H
EPC0L
PCA_PWM1
F3H
EBS1[1:0]
XCCAP1H[1:0]
XCCAP1L[1:0]
EPC1H
EPC1L
PCA_PWM2
F4H
EBS2[1:0]
XCCAP2H[1:0]
XCCAP2L[1:0]
EPC2H
EPC2L
PCA_PWM3
FD57H
EBS3[1:0]
XCCAP3H[1:0]
XCCAP3L[1:0]
EPC3H
EPC3L
EBSn[1:0]: PCAn PWM number of bits control
EBSn[1:0]
PWM bits
Reload value
Comparison value
00
8-bits PWM
{EPCnH, CCAPnH[7:0]}
{EPCnL, CCAPnL[7:0]}
01
7-bits PWM
{EPCnH, CCAPnH[6:0]}
{EPCnL, CCAPnL[6:0]}
10
6-bits PWM
{EPCnH, CCAPnH[5:0]}
{EPCnL, CCAPnL[5:0]}
11
10-bits PWM
{EPCnH, XCCAPnH[1:0], CCAPnH[7:0]}
{EPCnL, XCCAPnL[1:0], CCAPnL[7:0]}
XCCAPnH[1:0]: The 9
th
bit and 10
th
bit of reload value of 10-bit PWM
XCCAPnL[1:0]: The 9
th
bit and 10
th
bit of comparison value of 10-bit PWM
EPCnH: The MSB of reload vaule in PWM mode (i.e. the 9
th
bit of 8-bit PWM, the 8
th
bit of 7-bit PWM, the 7
th
bit of 6-bit PWM, the 11
th
bit of 10-bit PWM)
EPCnL: The MSB of comparison vaule in PWM mode (i.e. the 9
th
bit of 8-bit PWM, the 8
th
bit of 7-bit PWM, the
7
th
bit of 6-bit PWM, the 11
th
bit of 10-bit PWM)
Note: When updating the reload value of 10-bit PWM, write the upper two bits of XCCAPnH [1: 0] firstly and
then the lower 8 bits of CCAPnH [7: 0].
18.3 PCA Operation Mode
There are 4 groups of PCA modules in STC12Hseries of microcontrollers, and operation mode of each module can be
set independently. The mode settings are as follows:
CCAPMn
Function of module
-
ECOMn
CAPPn
CAPNn
MATn
TOGn
PWMn
ECCFn
-
0
0
0
0
0
0
0
No operation
-
1
0
0
0
0
1
0
6/7/8/10 bit PWM mode, no interrupt
-
1
1
0
0
0
1
1
6/7/8/10 bit PWM mode, rising edge
interrupt
-
1
0
1
0
0
1
1
6/7/8/10 bit PWM mode, falling edge

Table of Contents

Related product manuals