Intel Microcontroller Microscope & Magnifier User Manual


 
8XC196NP, 80C196NU USER’S MANUAL
10-18
10.5.3 Programming the Capture/Compare Channels
The EPAx_CON register controls the function of its assigned capture/compare channel. The reg-
isters for EPA0 and EPA2 are identical. The registers for EPA1 and EPA3 have an additional bit,
the remap bit (RM), which is used to enable and disable remapping for high-speed PWM gener-
ation (see “Generating a High-speed PWM Output” on page 10-14). This added bit (bit 8) re-
quires an additional byte, so EPA1_CON and EPA3_CON must be addressed as words, while the
others can be addressed as bytes.
To program a compare event, write to EPAx_CON (Figure 10-10) to configure the EPA cap-
ture/compare channel and then load the event time into EPAx_TIME. To program a capture event,
you need only write to EPAx_CON. Table 10-5 shows the effects of various combinations of
EPAx_CON bit settings.
Table 10-5. Example Control Register Settings and EPA Operations
Capture Mode
TB CE MODE RE ROT ON/RT
Operation
765432 1 0
X 0 0 0 0 0 None
X 0 0 1 0 X X Capture on falling edges
X 0 1 0 0 X X Capture on rising edges
X 0 1 1 0 X X Capture on both edges
X 0 X 1 0 1 X Reset opposite timer
X 0 1 X 0 1 X Reset opposite timer
Compare Mode
TB CE MODE RE ROT ON/RT
Operation
765432 1 0
X 1 0 0 X 0 0 None
X 1 0 1 X 0 X X Clear output pin
X 1 1 0 X 0 X X Set output pin
X 1 1 1 X 0 X X Toggle output pin
X 1 X X X 0 0 1 Reset same timer
X 1 X X X 0 1 1 Reset opposite timer
NOTES: — = bit is not used
X = bit may be used, but has no effect on the described operation. These bits cause other oper-
ations to occur.