
DocID13284 Rev 2
377/564
UM0404
Analog / digital converter
19.1.3
Wait for ADDAT read mode
If in default mode of the ADC a previous conversion result has not been read out of register
ADDAT by the time a new conversion is complete, the previous result in register ADDAT is
lost because it is overwritten by the new value, and the A/D overrun error interrupt request
flag ADEIR will be set.
In order to avoid error interrupts and the loss of conversion results especially when using
continuous conversion modes, the ADC can be switched to “Wait for ADDAT Read Mode”
by setting bit ADWR in register ADCON.
If the value in ADDAT has not been read by the time the current conversion is complete, the
new result is stored in a temporary buffer and the next conversion is suspended (ADST and
ADBSY will remain set in the meantime, but no end-of-conversion interrupt will be
generated). After reading the previous value from ADDAT the temporary buffer is copied into
ADDAT (generating an ADCIR interrupt) and the suspended conversion is started. This
mechanism applies to both single and continuous conversion modes.
While in standard mode continuous conversions are executed at a fixed rate (determined by
the conversion time), in “Wait for ADDAT Read Mode” there may be delays due to
suspended conversions. However, this only affects the conversions, if the CPU (or PEC)
cannot keep track with the conversion rate
.
Figure 161. Wait for read mode example
19.1.4 Channel
injection
mode
Channel Injection Mode allows the conversion of a specific analog channel (also while the
ADC is running in a continuous or auto scan mode) without changing the current operating
mode. After the conversion of this specific channel, the ADC continues with the original
operating mode.
Channel Injection mode is enabled by setting bit ADCIN in register ADCON and requires the
Wait for ADDAT Read Mode (ADWR = ‘1’). The channel to be converted in this mode is
specified in bit-field CHNR of register ADDAT2.
These 4 bits in ADDAT2 are not modified by the A/D converter, but only the ADRES bit-field.
Since the channel number for an injected conversion is not buffered, bit-field CHNR of
ADDAT2 must never be modified during the sample phase of an injected conversion,
#3
#2
#1
#0
#3
Conversion
#x
#3
#2
#0
#1
#x
#3
#2
#1
#0
Write ADDAT
ADDAT Full
Generate Interrupt
Request
Read of ADDAT;
Result of Channel:
Wait
Temp-Latch Full
#3
#1
Hold Result in
Temp-Latch
of Channel: