![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/0/7e/07eb82d3-d3d8-48da-afaa-05ad4a0db367/07eb82d3-d3d8-48da-afaa-05ad4a0db367-bg8a.png)
6-31
STANDARD AND PTS INTERRUPTS
Figure 6-16. EPA and PTS Operations for the PWM Toggle Mode Example
You can modify the duty cycle without interrupting the PWM operation. To change the duty cycle
during a PWM cycle, the PTS service routine should write new T1 and T2 – T1 values to
CSTORE1 and CSTORE2 and select normal interrupt service for the next EPA0 interrupt. When
the next timer match occurs, the output is toggled, and the device executes a normal interrupt ser-
vice routine, which performs these operations:
1. The routine writes the new value of T1 (in CSTORE1) to PTSCONST1 and the new value
of T1 – T2 (in CSTORE2) to PTSCONST2.
2. It selects PTS service for the EPA0 interrupt.
A2552-02
= 1
Toggle Output
Timer
Match
?
No
Yes
= 0
Toggle TBIT
EPA0_TIME = EPA0_TIME + T1
EPA0_TIME = EPA0_TIME + (T2 - T1)
Start
TBIT
EPA
PTS
A2552-02
= 1
Toggle Output
Timer
Match
?
No
Yes
= 0
Toggle TBIT
EPA0_TIME = EPA0_TIME + T1
EPA0_TIME = EPA0_TIME + (T2 - T1)
Start
TBIT
EPA
PTS Cycle