01.04.2014 Views

Preliminary C8051F120/1/2/3 C8051F124/5/6/7 - KEMT FEI TUKE

Preliminary C8051F120/1/2/3 C8051F124/5/6/7 - KEMT FEI TUKE

Preliminary C8051F120/1/2/3 C8051F124/5/6/7 - KEMT FEI TUKE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Preliminary</strong><br />

<strong>C8051F120</strong>/1/2/3<br />

<strong>C8051F124</strong>/5/6/7<br />

24.2.2. Software Timer (Compare) Mode<br />

In Software Timer mode, the PCA0 counter/timer is compared to the module's 16-bit capture/compare register<br />

(PCA0CPHn and PCA0CPLn). When a match occurs, the Capture/Compare Flag (CCFn) in PCA0CN is set to logic<br />

1 and an interrupt request is generated if CCF interrupts are enabled. The CCFn bit is not automatically cleared by<br />

hardware when the CPU vectors to the interrupt service routine, and must be cleared by software. Setting the ECOMn<br />

and MATn bits in the PCA0CPMn register enables Software Timer mode.<br />

Figure 24.5. PCA Software Timer Mode Diagram<br />

Write to<br />

PCA0CPLn<br />

Reset<br />

Write to<br />

PCA0CPHn<br />

0<br />

ENB<br />

ENB<br />

1<br />

PCA0CPMn<br />

P E C C M T P E<br />

W C A A A O W C<br />

M O P P T G M C<br />

1 M P N n n n F<br />

6 n n n n<br />

n<br />

x 0 0 0 0 x<br />

PCA0CPLn<br />

PCA0CPHn<br />

PCA<br />

Interrupt<br />

PCA0CN<br />

C C C C C C C C<br />

F R C C C C C C<br />

F F F F F F<br />

5 4 3 2 1 0<br />

Enable<br />

16-bit Comparator<br />

Match<br />

0<br />

1<br />

PCA<br />

Timebase<br />

PCA0L<br />

PCA0H<br />

© 2002 Cygnal Integrated Products, Inc. DS008-0.8-AUG02 Page 295

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!