ADC timing: find exact samplig time

Hi.

I'm trying to find the exact number of ADC_ clock cycle that arduino DUE take to do a full conversion with ADC_SEQR, to find the sampling frequency, depending of the ADC_MR register.

Base on the Data sheet, p.1321, 1322, on the table 43-2, 43-3, you could find what is the timing.

Where I'm struggle is with is on the conversion/transfer overlap.

The data sheet say:

The tracking phase starts during the conversion
of the previous channel. If the tracking time is longer than the conversion time, the tracking phase is extended to
the end of the previous conversion.

shown on table 43-2, 43-3

But the only place I could find a reference for the conversion time is on the page 1403, on table 45-30.
It say: conversion time, typical 20 ADC clock.

The transfer is set in ADC_MR_TRANSFER, value 0 to 15.

It is calculated:

• TRACKTIM: Tracking Time
Tracking Time = (TRACKTIM + 1) * ADCClock periods.

so the max adc clock of tracktim is 16, less then a conversion...

Is the there anywhere else I could find detail about the conversion time on table 43-2, 43-3.

Thanks.

[UPDATE]

Ok, done some test:
I measure the time between each ISR with micros(), and here what I found:

changing TRACKTIM or TRANSFER to any value do not change the time of the ISR.

The sequencer was in free running mode:
Following the prescaler value, it take 21 ADC_clk/channel enable. The data sheet said 20...

So, for example, I set all 16 ADC channel on, and the prescaler to 255, it gave a sample rate of : 558.03Hz.

if I set 5 channel, with a prescaler of 100: 3.960KHz

If anyone know something about what is transfert ans tracktim, maybe for the precision or something...

Thanks

Nitrof

When the datasheet is too short, try to find auxiliary documents, many manufacturers provide application notes.

I found this document, see if it helps:

All documents must be in the link below, it may be interesting to know about their existence:

https://www.microchip.com/en-us/product/ATSAM3X8E#document-table

P.S.: Also check the Arduino board schematic, some features cannot be used due to hardware layout.

SAM3X/SAM3A Series Datasheet
AN_6327 - AT91-AN01: Using the Two-wire interface (TWI) in Master Mode on AT91SAM Microcontrollers
AN_42279 - AT06864: SAM3/4C/4CM/4CP/4E/4N/4S/G Reset Controller (RSTC) Driver
AN_42128 - AT02346: Using the MPU on Cortex-M3 / Cortex-M4 based Microcontrollers
AN_42141 - AT02333: Safe and Secure Bootloader Implementation for SAM3/4
AN_6349 - AT91-AN02: Signal Integrity and AT91 Products
AN_11098 - Modbus Slave Stack for the Family of SAM3 Microcontrollers
AN_11106 - Analog-to-Digital Converter in the SAM3S4
AN_42284 - AT07337: SAM4 Real-Time Clock (RTC)
AN_42299 - AT07896: Universal Asynchronous Receiver Transceiver (UART)
AN_42316 - AT08642: SAM3A/3N/3S/3U/3X/4E/4N/4S/G Peripheral DMA Controller (PDC) Driver
AN_42318 - AT08220: Universal Synchronous Asynchronous Receiver Transceiver (USART)
AN_42298 - AT06860: SAM3/4S/4C Analog-to-digital Converter (ADC)
AN_42291 - AT07892: SAM3A/3U/3X/4E DMA Controller (DMAC) Driver
AN_42293 - AT07900: SAM4 Digital-to-Analog Converter Controller (DACC)
AN_42706 - AT11483: Quadrature Decoder (QDEC) for SAM3/4 Devices
AN_42294 - AT07906: SAM4 Pulse Width Modulation Controller (PWM)
AN_42476 - AT04155: SAM4L USB Host MSC Bootloader with Optional AES
AN_6229 - Using the Serial Peripheral Interface with AT91SAMxx Devices
AN_42187 - AT03462: ATSAM3X and ATSAM3A Series - Checklist
AN_42204 - AT03289: SAM4L Low Power Design with FreeRTOS
AN_42382 - AT04056: Getting Started with FreeRTOS on SAM Flash MCUs
AN_42209 - AT03197: Thermostat with Touch and Wireless Connectivity - Hardware Users Guide AN_42501 - AT11489: Low Power Techniques for SMART ARM MCUs AN_32199 - AT2200: ZigBee to Ethernet and Wi-Fi Gateway with SAM3X - Hardware Users Guide
AN_11154 - NAND Flash Support on SAM3X Microcontrollers
AN_11153 - How to connect an Ethernet PHY to SAM3X
AN_42336 - AT09331: ASF USB Stack Manual
AN2468 - Production Programming of Microchip AVR and SAM Microcontrollers
AN_42165 - AT02744: Lightweight Mesh to Ethernet Gateway with SAM3X - Software User`s Guide
AN_2669 - Interfacing a 4x4 Keyboard to an AT91 Microcontroller
AN_2682 - Pulse Width Modulation Generation Using the AT91 Timer/Counter
AN2466 - Using Atmel-ICE for AVR Programming In Mass Production
Atmel Studio - Software Development Environment
Atmel Flash Microcontroller Product Portfolio
Atmel SAM3X Series
Atmel-Integrating the Internet of Things
Beyond the IDE
AN_42319 - AT06861: SAM Supply Controller (SUPC)
AN_42282 - AT07336: Common Non-Volatile Memory (NVM) Driver
AN_42438 - AT09423: SAM-BA Overview and Customization Process
AN_42344 - AT09339: USB Host Interface (UHI) for Mass Storage Class (MSC)
AN_42346 - AT09341: USB Host Interface (UHI) for Vendor Class Device
AN_42338 - AT09333: USB Host Interface (UHI) for Communication Class Device (CDC)
AN_42342 - AT09337: USB Host Interface (UHI) for Human Interface Device Mouse (HID Mouse)
AN_42337 - AT09332: USB Device Interface (UDI) for Communication Class Device (CDC)
AN_42345 - AT09340: USB Device Interface (UDI) for Vendor Class Device
AN_42339 - AT09334: USB Device Interface (UDI) for Human Interface Device Generic (HID Generic)
AN_42370 - AT08569: Optimizing ASF Code Size to Minimize Flash and RAM Usage
AN_42341 - AT09336: USB Device Interface (UDI) for Human Interface Device Mouse (HID Mouse)
AN_42343 - AT09338: USB Device Interface (UDI) for Mass Storage Class (MSC)
AN_42340 - AT09335: USB Device Interface (UDI) for Human Interface Device Keyboard (HID Keyboard)
AN_42728 - AT15004:Using SAM-BA for Linux on SAM Devices
Microprocessor or Microcontroller
Computers that You Wear Help Your Work and Play
Designing Feature-Rich User Interfaces for Home and Industrial Controllers
Data Converter Terminology - This Application Note defines a number of key parameters related to data converters (ADC and DAC) and discusses the extent to which they can be tested. Equations are given to evaluate all key values.
SAM3X-EK Design & Manufacturing Files
Next-Generation IDE: Maximizing IP Reuse
What is SSC? How to Configure SSC for Audio Applications

Thanks. I will take a look on that!

P.S.: Also check the Arduino board schematic, some features cannot be used due to hardware layout.

If you refer to ADC08, 09, map to 20,sda0, 21,scl0. I'm aware of that. there is pullup resistor on that 2 pin...

Even if there is a pull-up resistor, if the signal is coming from a low impedance signal source such as an op-amp with good current carrying, the pull-up resistor can even be ignored depending on the accuracy of the design.

Have a good time!

Blockquote @rtek1000
Have a good time!

In this, on section 4, was few usefull information:
Appnotes/doc11106.pdf

It is for SAM3S4, but just some value change, but the workflow seem the same. For example: it said TRACKTIM is disable when using freerun...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.