6-33
STANDARD AND PTS INTERRUPTS
4. Set up EPA0 and EPA1.
— Load EPA0_CON with 68H (timer 1, compare mode, assert output pin, re-enable).
— Load EPA1_CON with 158H (timer 1, compare mode, deassert output pin, re-enable,
remap enabled).
— Load EPA0_TIME with 0000H (selects time 0 as first event time for EPA0).
— Load EPA1_TIME with the value of T1 (selects time T1 as first event time for EPA1).
— Load timer 1 with FFFFH to ensure that the EPA0 event time (time = 0) is matched
first.
— Load T1CONTROL with C2H (enables timer 1, selects up-counting at f/4, and enables
the divide-by-four prescaler).
5. Enable the EPA0 and EPA1 interrupts and select PTS service for them.
— Set INT_MASK.7 and INT_MASK1.0.
— Set PTSSEL.7 and PTSSEL.8.
6. Enable the interrupts and the PTS. The EI instruction enables interrupts; the EPTS
instruction enables the PTS.
Table 6-9. PWM Remap Mode PTSCB
PTSCB0 for EPA0 PTSCB1 for EPA1
Unused Unused
Unused Unused
PTSCONST1 (HI) = T2 (HI) PTSCONST1 (HI) = T2 (HI)
PTSCONST1 (LO) = T2 (LO) PTSCONST1 (LO) = T2 (LO)
PTSPTR1 (HI) = 1FH (EPA0_TIME, HI) PTSPTR1 (HI) = 1FH (EPA1_TIME, HI)
PTSPTR1 (LO) = 82H (EPA0_TIME, LO) PTSPTR1 (LO) = 86H (EPA1_TIME, LO)
PTSCON = 40H (Mode = 010, TMOD = 0) PTSCON = 40H (Mode = 010, TMOD = 0)
Unused Unused