beautypg.com

Pca interrupt, Pca capture mode – Rainbow Electronics T89C5115 User Manual

Page 69

background image

69

T89C5115

4128A–8051–04/02

PCA Interrupt

Figure 31. PCA Interrupt System

PCA Capture Mode

To use one of the PCA modules in 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 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 reg-
isters (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.

Figure 32. PCA Capture Mode

CF

CR

CCON

0xD8

CCF1

CCF0

Module 1

Module 0

PCA Timer/Counter

To Interrupt

EC

IEN0.6

EA

IEN0.7

ECF

CMOD.0

ECCFn

CCAPMn.0

CEXn
n = 0, 1

PCA Counter

CH

(8bits)

CL

(8bits)

CCAPnH CCAPnL

CCFn

CCON Reg

PCA
Interrupt
Request

-

7

CCAPMn Register (n = 0, 1)

0

ECCFn

CAPNn000

0CAPPn