t89c51rd2-slscl ATMEL Corporation, t89c51rd2-slscl Datasheet - Page 29

no-image

t89c51rd2-slscl

Manufacturer Part Number
t89c51rd2-slscl
Description
0 To 40 Mhz Flash Programmable 8-bit Microcontroller
Manufacturer
ATMEL Corporation
Datasheet
PCA Capture Mode
Figure 9. PCA Capture Mode
16-bit Software Timer/
Compare Mode
4243G–8051–05/03
Cex.n
CF
ECOMn
CR
To use one of the PCA modules in the capture mode either one or both of the CCAPM
bits CAPN and CAPP for that module must be set. The external CEX input for the mod-
ule (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). If the CCFn bit for the module in the CCON-
SFR and the ECCFn bit in the CCAPMn SFR are set then an interrupt will be generated
(Refer to Figure 9).
The PCA modules can be used as software timers by setting both the ECOM and MAT
bits in the modules CCAPMn register. The PCA timer will be compared to the module’s
capture registers and when a match occurs an interrupt will occur if the CCFn (CCON
SFR) and the ECCFn (CCAPMn SFR) bits for the module are both set (See Figure 10).
CAPPn
CAPNn MATn TOGn PWMn ECCFn
CCF4 CCF3 CCF2 CCF1 CCF0
Capture
CCAPMn, n= 0 to 4
0xDA to 0xDE
CCON
0xD8
CCAPnH
PCA Counter/Timer
CH
CCAPnL
CL
T89C51RD2
PCA IT
29

Related parts for t89c51rd2-slscl