369
8331B–AVR–03/12
Atmel AVR XMEGA AU
28.15 Synchronous Sampling
The ADC can be configured to do synchronous sampling in three different ways.
1.
Sample two input channels at the same time
2.
Sample two ADCs at the same time
3.
Sample on external trigger
28.15.1
Synchronous sampling of two ADC inputs
The ADC supports sampling of two input channels at the same time. This is achieved by setting
up channel n to use 1x gain and channel n+1 to not use gain. The converted result from the
channel using gain will be ready one ADC clock cycle after the other channel. See
versions on Two ADC Channels, CH1 with Gain” on page 366
for detailed timing diagram.
28.15.2
Synchronous sampling on event
Starting an ADC conversion can cause an unknown delay between the start trigger or event and
the actual conversion start, since conversions of higher priority ADC channels may be pending,
or since the peripheral clock is faster than the ADC clock. To start an ADC conversion immedi-
ately on an incoming event, it is possible to flush the ADC of all measurements, reset the ADC
clock, and start the conversion at the next peripheral clock cycle (which then will also be the next
ADC clock cycle). If this is done, all ongoing conversions in the ADC pipeline will be lost.
The ADC can be flushed from software, or an incoming event can do this automatically. When
this function is used, the time between each conversion start trigger must be longer than the
ADC propagation delay to ensure that one conversion is finished before the ADC pipeline is
flushed and the next conversion is started.
It is also important to clear pending events or start ADC conversion commands before doing a
flush. If not, pending conversions will start immediately after the flush.
28.15.3
Synchronous sampling of two ADCs
In devices with two ADC peripherals, it is possible to start two ADC samples synchronously in
the two ADCs by using the same event channel to trigger both ADC.