Intel 8XC196NT User Manual page 137

Table of Contents

Advertisement

8XC196NT USER'S MANUAL
PWM Toggle Mode
Uses a single EPA channel.
Reads the location specified by PTSPTR1
(usually EPA x _TIME).
Adds one of two values to the location specified by
PTSPTR1. If TBIT is clear, it adds the value in
PTSCONST1. If TBIT is set, it adds the value in
PTSCONST2.
Stores the sum back into the location specified by
PTSPTR1.
Toggles TBIT.
Figure 5-15 illustrates a generic PWM waveform. The time the output is "on" is T1; the time the
output is "off" is T2 – T1. The formulas for frequency and duty cycle are shown below. In most
applications, the frequency is held constant and the duty cycle is varied to change the average val-
ue of the waveform.
Frequency, in Hertz =
T1
× 100%
------ -
Duty Cycle =
T2
Output Value
1
on
0
0
T1
On-time = T1
The PWM modes do not use a PTSCOUNT register to specify the number of consecutive PTS
cycles. To stop producing the PWM output, clear the PTSSEL.x bit to disable PTS service for the
interrupt and reconfigure the EPA channel in the interrupt service routine.
5-32
Table 5-12. Comparison of PWM Modes
1
------ -
T2
off
Off-time = T2 - T1
Figure 5-15. A Generic PWM Waveform
PWM Remap Mode
Uses two EPA channels.
Reads the location specified by PTSPTR1
(usually EPA x _TIME).
Adds the value in PTSCONST1 to the location
specified by PTSPTR1.
Stores the sum back into the location specified by
PTSPTR1.
Toggles the unused TBIT.
on
T2
T2 + T1
off
Time, t
A0263-02

Advertisement

Table of Contents
loading

Table of Contents