P89CV51RB2_RC2_RD2_3 © NXP B.V. 2009. All rights reserved.
Product data sheet Rev. 03 — 25 August 2009 46 of 76
NXP Semiconductors
P89CV51RB2/RC2/RD2
80C51 with 1 kB RAM, SPI
Fig 20. PCA interrupt system
002aaa533
PCA TIMER/COUNTER
MODULE0
CF CR - CCF4 CCF3 CCF2 CCF1 CCF0
MODULE1
MODULE2
MODULE3
MODULE4
ECF
ECCFn
IE.6
EC
IE.7
EA
CCAPMn.0CMOD.0
CCON
(D8H)
to
interrupt
priority
decoder
Table 32. CMOD - PCA counter mode register (address D9H) bit allocation
Not bit addressable; reset value: 00H.
Bit 7 6 5 4 3 2 1 0
Symbol CIDL WDTE - - - CPS1 CPS0 ECF
Table 33. CMOD - PCA counter mode register (address D9H) bit description
Bit Symbol Description
7 CIDL Counter Idle control. CIDL = 0 programs the PCA counter to continue
functioning during Idle mode; CIDL = 1 programs it to be gated off
during Idle mode.
6 WDTE WatchDog Timer Enable. WDTE = 0 disables watchdog timer function
on module 4; WDTE = 1 enables it.
5 to 3 - Reserved for future use. Should be set to 0 by user programs.
2 to 1 CPS1,
CPS0
PCA Count Pulse Select; see
Table 34.
0 ECF PCA Enable Counter overflow interrupt Flag. ECF = 1 enables CF bit
in CCON to generate an interrupt; ECF = 0 disables that function.
Table 34. CMOD - PCA counter mode register (address D9H) count pulse select
CPS1 CPS0 Select PCA input
0 0 0 internal clock, f
osc
/6
P89CV51RB2_RC2_RD2_3 © NXP B.V. 2009. All rights reserved.
Product data sheet Rev. 03 — 25 August 2009 47 of 76
NXP Semiconductors
P89CV51RB2/RC2/RD2
80C51 with 1 kB RAM, SPI
0 1 1 internal clock, f
osc
/6
1 0 2 Timer 0 overflow
1 1 3 external clock at pin P1[2]/ECI (maximum rate = f
osc
/4)
Table 35. CCON - PCA counter control register (address D8H) bit allocation
Bit addressable; reset value: 00H.
Bit 7 6 5 4 3 2 1 0
Symbol CF CR - CCF4 CCF3 CCF2 CCF1 CCF0
Table 36. CCON - PCA counter control register (address D8H) bit description
Bit Symbol Description
7 CF PCA Counter overflow Flag. Set by hardware when the counter rolls
over. CF flags an interrupt if bit ECF in CMOD is set. CF may be set by
either hardware or software but can only be cleared by software.
6 CR PCA Counter Run control. Set by software to turn the PCA counter on.
Must be cleared by software to turn the PCA counter off.
5 - Reserved for future use. Should be set to 0 by user programs.
4 CCF4 PCA Module 4 interrupt Flag. Set by hardware when a match or
capture occurs. Must be cleared by software.
3 CCF3 PCA Module 3 interrupt Flag. Set by hardware when a match or
capture occurs. Must be cleared by software.
2 CCF2 PCA Module 2 interrupt Flag. Set by hardware when a match or
capture occurs. Must be cleared by software.
1 CCF1 PCA Module 1 interrupt Flag. Set by hardware when a match or
capture occurs. Must be cleared by software.
0 CCF0 PCA Module 0 interrupt Flag. Set by hardware when a match or
capture occurs. Must be cleared by software.
Table 37. CCAPMn - PCA modules compare/capture register (address CCAPM0 DAH,
CCAPM1 DBH, CCAPM2 DCH, CCAPM3 DDH, CCAPM4 DEH) bit allocation
Not bit addressable; reset value: 00H.
Bit 7 6 5 4 3 2 1 0
Symbol - ECOMn CAPPn CAPNn MATn TOGn PWMn ECCFn
Table 38. CCAPMn - PCA modules compare/capture register (address CCAPM0 DAH,
CCAPM1 DBH, CCAPM2 DCH, CCAPM3 DDH, CCAPM4 DEH) bit description
Bit Symbol Description
7 - Reserved for future use. Should be set to 0 by user programs.
6 ECOMn Enable Comparator. ECOMn = 1 enables the comparator function.
5 CAPPn Capture Positive, CAPPn = 1 enables positive edge capture.
4 CAPNn Capture Negative, CAPNn = 1 enables negative edge capture.
3 MATn Match. When MATn = 1 a match of the PCA counter with this module’s
compare/capture register causes the CCFn bit in CCON to be set,
flagging an interrupt.
Table 34. CMOD - PCA counter mode register (address D9H) count pulse select
…continued
CPS1 CPS0 Select PCA input
P89CV51RB2_RC2_RD2_3 © NXP B.V. 2009. All rights reserved.
Product data sheet Rev. 03 — 25 August 2009 48 of 76
NXP Semiconductors
P89CV51RB2/RC2/RD2
80C51 with 1 kB RAM, SPI
6.9.1 PCA capture mode
To use one of the PCA modules in the Capture mode (Figure 21), either one or both of the
CCAPM bits CAPN and CAPP for that module must be set. The external CEX input for the
module (on port 1) is sampled for a transition. When a valid transition occurs, the PCA
hardware loads the value of the PCA counter registers (CH and CL) into the module’s
capture registers (CCAPnL and CCAPnH).
2 TOGn Toggle. When TOGn = 1, a match of the PCA counter with this
module’s compare/capture register causes the CEXn pin to toggle.
1 PWMn Pulse Width Modulation mode. PWMn = 1 enables the CEXn pin to be
used as a pulse-width modulated output.
0 ECCFn Enable CCF interrupt. Enables compare/capture flag CCFn in the
CCON register to generate an interrupt.
Table 38. CCAPMn - PCA modules compare/capture register (address CCAPM0 DAH,
CCAPM1 DBH, CCAPM2 DCH, CCAPM3 DDH, CCAPM4 DEH) bit description
Bit Symbol Description
Table 39. PCA module modes (CCAPMn register)
ECOMn CAPPn CAPNn MATn TOGn PWMn ECCFn Module function
0 0 0 0 0 0 0 no operation
X 1 0 0 0 0 X 16-bit capture by a positive-edge trigger on
CEXn
X 0 1 0 0 0 X 16-bit capture by a negative-edge trigger on
CEXn
X 1 1 0 0 0 X 16-bit capture by any transition on CEXn
1 0 0 1 0 0 X 16-bit software timer
1 0 0 1 1 0 X 16-bit high-speed output
1 0 0 0 0 1 0 8-bit PWM
1 0 0 1 X 0 X watchdog timer

P89CV51RD2FA,512

Mfr. #:
Manufacturer:
NXP Semiconductors
Description:
IC MCU 8BIT 64KB FLASH 44PLCC
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union