8XC196NP, 80C196NU USER’S MANUAL
6-36
Figure 6-18. EPA and PTS Operations for the PWM Remap Mode Example
You can change the duty cycle by changing the time that the output is high and keeping the period
constant. After a timer match occurs for EPA1 (when the output falls), schedule the next EPA1
match for T2 + DT, where DT is the time to be added to the on-time. Thereafter, schedule the next
EPA1 match for T2. You can do this by replacing one EPA1 PTS interrupt with a normal interrupt
(clear PTSSEL.8). Have the interrupt service routine add T2 + DT to EPA1_TIME and set
PTSSEL.8 to re-enable PTS service for EPA1. This adjustment changes the duty cycle without
affecting the period.
By using two EPA channels in the PWM remap mode, you can generate duty cycles closer to 0%
and 100% than is possible with PWM toggle mode. For further information about generating
PWM waveforms with the EPA, see “Operating in Compare Mode” on page 10-12.
A2553-01
Timer
Match
?
No
Yes
Toggle TBIT
(TBIT is not used)
Start
EPA
PTS
If EPA0: EPA0_TIME = EPA0_TIME + T2
If EPA1: EPA1_TIME = EPA1_TIME + T2
If EPA0, set the output
If EPA1, clear the output
A2553-01
Timer
Match
?
No
Yes
Toggle TBIT
(TBIT is not used)
Start
EPA
PTS Cycle
If EPA0: EPA0_TIME = EPA0_TIME + T2
If EPA1: EPA1_TIME = EPA1_TIME + T2
If EPA0, set the output
If EPA1, clear the output