English
Language : 

P89V51RD2 Datasheet, PDF (50/75 Pages) NXP Semiconductors – 8-bit 80C51 5 V low power 64 kB Flash microcontroller with 1 kB RAM
Philips Semiconductors
P89V51RD2
8-bit microcontrollers with 80C51 core
7.8.4 Pulse width modulator mode
All of the PCA modules can be used as PWM outputs (Figure 25). Output frequency
depends on the source for the PCA timer.
CCAPnH
enable
CCAPnL
8-BIT COMPARATOR
CL
PCA timer/counter
0
CL<CCAPnL
CL≥CCAPnL
1
CEXn
CCAPMn, n = 0 to 4
-
ECOMn CAPPn CAPNn MATn TOGn PWMn ECCFn
(C2H to C6H)
1
0
0
0
0
1
1
Fig 25. PCA PWM mode.
002aaa541
All of the modules will have the same frequency of output because they all share one
and only PCA timer. The duty cycle of each module is independently variable using
the module’s capture register CCAPnL.When the value of the PCA CL SFR is less
than the value in the module’s CCAPnL SFR the output will be low, when it is equal to
or greater than the output will be high. When CL overflows from FF to 00, CCAPnL is
reloaded with the value in CCAPnH. this allows updating the PWM without glitches.
The PWM and ECOM bits in the module’s CCAPMn register must be set to enable
the PWM mode.
7.8.5 PCA Watchdog timer
An on-board Watchdog timer is available with the PCA to improve the reliability of the
system without increasing chip count. Watchdog timers are useful for systems that
are susceptible to noise, power glitches, or electrostatic discharge. Module 4 is the
only PCA module that can be programmed as a Watchdog. However, this module can
still be used for other modes if the Watchdog is not needed. Figure 25 shows a
diagram of how the Watchdog works. The user pre-loads a 16-bit value in the
compare registers. Just like the other compare modes, this 16-bit value is compared
to the PCA timer value. If a match is allowed to occur, an internal reset will be
generated. This will not cause the RST pin to be driven high.
user’s software then must periodically change (CCAP4H,CCAP4L) to keep a match
from occurring with the PCA timer (CH,CL). This code is given in the WATCHDOG
routine shown above.
In order to hold off the reset, the user has three options:
9397 750 12964
Product data
Rev. 01 — 01 March 2004
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
50 of 75