beautypg.com

16-bit software timer mode, Preliminary – Rainbow Electronics T89C51CC02 User Manual

Page 106

background image

106

Rev.A - May 17, 2001

Preliminary

T89C51CC02

16.4. 16-bit Software Timer Mode

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.

Figure 107. PCA 16-bit Software Timer and High Speed Output Mode

CCAPnL

CCAPnH

-

ECOMn00MATnTOGn0ECCFn

7

0

CCAPMn Register

(n = 0, 1)

CH

CL

16-Bit
Comparator

Match

Enable

CCFn

CCON reg

PCA
Interrupt
Request

CEXn

Compare/Capture Module

PCA Counter

“0”

“1”

Reset

Write to

CCAPnL

Write to CCAPnH

For software Timer mode, set ECOMn and MATn.
For high speed output mode, set ECOMn, MATn and
TOGn.

Toggle