## More on Arduino ADC timing

Continuing on the previous thread …

Looking at the timing diagrams in the Atmel SAM3X8e datasheet (Figures 40-2 and 40-3) together with the notes `Analog-to-Digital Converter in the SAM3S4′ for a simlar microntroller, it seems that part of my confusion is due to the way that the terms are described. So

• In one part of the datasheet the conversion time is given as ${20 t_{CP\_ADC}}$, elsewhere it talks about a conversion time of ${15 t_{CP\_ADC}}$. The explanation is that the total conversion time is ${20 t_{CP\_ADC}}$ and this is made up of ${5 t_{CP\_ADC}}$ to transfer the analog iinput from the sample and hold and ${15 t_{CP\_ADC}}$ to do the actual conversion and digitise the data.
• The TRANSFER field in the Mode Register does not control the time to transfer the analog input from the sample and hold to the digitiser, this is always ${5 t_{CP\_ADC}}$. The TRANSFER field in the Mode Register controls the time from the start of the conversion (an ADC\_Start pulse) to the time when the input channel is changed. ${\rm{TRANSFER=1}}$ makes this time equal to the actual transfer time (${5 t_{CP\_ADC}}$) and this is the recommended value. Other values can be used, but they affect other timings and are not recommended.

In Section 45.7.2.1 of the datasheet, titled “Track and Hold Time versus Source Output Impedance”, it says to set ${\rm{TRANSFER=1}}$ and ${\rm{TRACKTIM=0}}$ whatever the tracking time, calculated from the source impedance, works out to be so these fields aren’t significant and are probably only there for backwards compatibility.

If the tracking time is less that ${15 t_{CP\_ADC}}$ the tracking of a selected channel can be carried out while the previous channel is being converted and the total time between ADC_Start pulses is ${20 t_{CP\_ADC}}$. In this case we can calculate the maximum ADC clock frequency as a function of the source impedance. A plot of this is shown below

If the tracking time is greater than ${15 t_{CP\_ADC}}$ the time between ADC_Start pulses must be increased to allow for this.

In either case, to ensure correct tracking for the first channel to be converted the startup time must be greater than or equal to the tracking time.