Intel 80C196NU User Manual

Page of 471
8XC196NP, 80C196NU USER’S MANUAL
6-28
5.
Configure P1.0 to serve as the EPA0 output.
— Clear P1_DIR.0 (selects output).
— Set P1_MODE.0 (selects the EPA0 special-function signal).
— Set P1_REG.0 (initializes the output to “1”).
6.
Set up EPA0.
— Load EPA0_CON with 0078H (timer 1, compare, toggle output pin, re-enable).
— Load EPA0_TIME with the value in PTSCONST1 (selects T1 as first event time).
— Load T1CONTROL with C2H (enables timer 1, selects up counting at f/4, and enables
the divide-by-four prescaler).
7.
Enable the EPA0 interrupt and select PTS service for it.
— Set INT_MASK.7.
— Set PTSSEL.7.
8.
Enable the interrupts and the PTS. The EI instruction enables interrupts; the EPTS
instruction enables the PTS.
Table 6-8.  PWM Toggle Mode PTSCB
PTSCONST2 (HI) = T2 – T1 (HI)
PTSCONST2 (LO) = T2 – T1 (LO)
PTSCONST1 (HI) = T1 (HI)
PTSCONST1 (LO) = T1 (LO)
PTSPTR1 (HI) = 1FH
PTSPTR1 (LO) = 82H
PTSCON = 43H (Mode = 010, TMOD = 1, TBIT = 1)
Unused