Intel 8XC196MC Microscope & Magnifier User Manual


 
8XC196MC, MD, MH USER’S MANUAL
11-18
11.5.3 Programming the Capture/Compare Channels
The EPAx_CON register controls the function of its assigned capture/compare channel. The reg-
isters are identical with the exception of bit 2. For EPA channels 0, 2, and 4, setting this bit enables
an EPA event to cause a waveform generator reload. For EPA channels 1, 3, and 5, setting this bit
enables an EPA event to cause an A/D conversion. To program a compare event, always write to
EPAx_CON (Figure 11-10) first to configure the EPA capture/compare channel, and then load the
event time into EPAx_TIME. To program a capture event, you need only write to EPAx_CON.
Table 11-6 shows the effects of various combinations of EPAx_CON bit settings for channels 1,
3, or 5.
Table 11-6. Example EPA Control Register Settings for Channels 1, 3, or 5
Capture Mode
TB CE MODE RE
WGR
/AD
ROT ON/RT
Operation
76543 2 1 0
X 0 0 0 0 None
X 0 0 1 X X X Capture on falling edges
X 0 1 0 X X X Capture on rising edges
X 0 1 1 X X X Capture on both edges
X 0 X 1 X 1 X Capture on falling edge and reset opposite timer
X 0 1 X X 1 X Capture on rising edge and reset opposite timer
X 0 0 1 1 X X Start A/D conversion (EPA1, 3, 5) or reload
waveform generator (EPA0, 2, 4) on falling edge
X 0 1 0 1 X X Start A/D conversion (EPA1, 3, 5) or reload
waveform generator (EPA0, 2, 4) on rising edge
Compare Mode
TB CE MODE RE
WGR
/AD
ROT ON/RT
Operation
76543 2 1 0
X 1 0 0 X 0 None
X 1 0 0 X 0 X 0 Generate interrupt only (software timer)
X 1 0 1 X X X X Clear output pin
X 1 1 0 X X X X Set output pin
X 1 1 1 X X X X Toggle output pin
X 1 X X X X 0 1 Reset reference timer
X 1 X X X X 1 1 Reset opposite timer
X 1 X X X 1 X X Start A/D conversion (EPA1, 3, 5) or reload
waveform generator (EPA0, 2, 4)
NOTES:
1. — = bit is not used
2. X = bit may be used, but has no effect on the described operation. These bits cause other operations
to occur.