DocID13284 Rev 2 375/564
UM0404 Analog / digital converter
ADDAT2 (F0A0h / 50h) ESFR Reset Value: 0000h
A conversion is started by setting bit ADST = ‘1’. The busy flag ADBSY will be set and the
converter then selects and samples the input channel, which is specified by the channel
selection field ADCH in register ADCON. The sampled level will then be held internally
during the conversion.
When the conversion of this channel is complete, the 10-bit result together with the number
of the converted channel is transferred into the result register ADDAT and the interrupt
request flag ADCIR is set.
Field ADCH represents the channel of Port5 when bit ADCMUX in register XMISC is not set
(0h = channel 0, 1h = channel 1, ... , Fh = channel 15); while it represents the channel of
Port1 when ADCMUX is set (0h = channel 16, 1h = channel 17, ... , 7h = channel 23).
If bit ADST is reset via software, while a conversion is in progress, the A/D converter will
stop after the current conversion (fixed channel modes) or after the current conversion
sequence (auto scan modes).
Setting bit ADST while a conversion is running, will abort this conversion and start a new
conversion with the parameters specified in ADCON.
Note: Stop and restart (see above) are triggered by bit ADST changing from ‘0’ to ‘1’, ADST must
be ‘0’ before being set.
While a conversion is in progress, the mode selection field ADM and the channel selection
field ADCH may be changed. ADM will be evaluated after the current conversion. ADCH will
be evaluated after the current conversion (fixed channel modes) or after the current
conversion sequence (auto scan modes).
19.1.1 Fixed channel conversion modes
These modes are selected by programming the mode selection field ADM in register
ADCON to ‘00b’ (single conversion) or to ‘01b’ (continuous conversion). After starting the
converter through bit ADST, the busy flag ADBSY will be set and the channel specified in
bit-field ADCH will be converted. If bit ADCMUX of register XMISC is set, the converted
channel is the one on Port1 (ADCH = 0h for channel 16, ADCH = 1h for channel 17, ... ,
ADCH = 7h for channel 23).
After the conversion is complete, the interrupt request flag
ADCIR will be set.
In single conversion mode the converter will automatically stop and reset bit ADBSY and
ADST.
1514131211109876543210
CHNR - - ADRES
RW RW
Bit Function
ADRES A/D Conversion Result (10 bits)
CHNR
Channel Number
4 bits, identifies the converted analog channel: first eight binary values should be
combined with status of bit ADCMUX of register XMISC to distinguish between
channel(7:0) and channel(23:16).