25.2. Capture/Compare Modules
Each module can be configured to operate independently in one of six operation modes: Edge-triggered Capture,
Software Timer, High Speed Output, Frequency Output, 8-Bit Pulse Width Modulator, or 16-Bit Pulse Width Modu-
lator. Each module has Special Function Registers (SFRs) associated with it in the CIP-51 system controller. These
registers are used to exchange data with a module and configure the module's mode of operation.
Table 25.2 summarizes the bit settings in the PCA0CPMn registers used to select the PCA0 capture/compare mod-
ule's operating modes. Setting the ECCFn bit in a PCA0CPMn register enables the module's CCFn interrupt. Note:
PCA0 interrupts must be globally enabled before individual CCFn interrupts are recognized. PCA0 interrupts are glo-
bally enabled by setting the EA bit (IE.7) and the EPCA0 bit (EIE1.3) to logic 1. See Figure 25.3 for details on the
PCA interrupt configuration.
Table 25.2. PCA0CPM Register Settings for PCA Capture/Compare Modules
PWM16 ECOM CAPP CAPN
X
X
1
X
X
0
X
X
1
X
1
0
X
1
0
X
1
0
0
1
0
1
1
0
X = Don't Care
(for n = 0 to 5)
PCA0CPMn
PCA0CN
P
E
C
C
M
T
P
E
C
C
C
C
C
W
C
A
A
A
O
W
C
F
R
C
C
C
M
O
P
P
T
G
M
C
F
F
F
1
M
P
N
n
n
n
F
5
4
3
6
n
n
n
n
n
PCA Counter/
Timer Overflow
PCA Module 0
(CCF0)
PCA Module 1
(CCF1)
PCA Module 2
(CCF2)
PCA Module 3
(CCF3)
PCA Module 4
(CCF4)
PCA Module 5
(CCF5)
MAT
TOG
0
0
0
1
0
0
1
0
0
0
1
0
0
1
1
0
0
1
0
0
0
0
0
0
Figure 25.3. PCA Interrupt Block Diagram
PCA0MD
C
C
C
C
C
C
C
E
C
C
C
I
P
P
P
C
F
F
F
D
S
S
S
F
2
1
0
L
2
1
0
0
1
ECCF0
0
1
ECCF1
0
1
ECCF2
0
1
ECCF3
0
1
ECCF4
0
1
ECCF5
0
1
C8051F120/1/2/3/4/5/6/7
PWM ECCF Operation Mode
Capture triggered by positive edge on
0
X
Capture triggered by negative edge on
0
X
Capture triggered by transition on
0
X
0
X
0
X
High Speed Output
1
X
1
0
8-Bit Pulse Width Modulator
1
0
16-Bit Pulse Width Modulator
EPCA0
(EIE.3)
Rev. 1.2
CEXn
CEXn
CEXn
Software Timer
Frequency Output
EA
(IE.7)
Interrupt
0
0
Priority
1
1
Decoder
303
Need help?
Do you have a question about the C8051F120 and is the answer not in the manual?