Introduction. Reference Documents. AFE Calibration on SAM V/E/S7x Microcontrollers. SMART ARM-based Microcontrollers APPLICATION NOTE

Similar documents
AT15291: Migrating QTouch Designs from SAM D MCUs to SAM C MCUs. Scope. Features. QTouch APPLICATION NOTE

ATF15xx Power-On Reset Hysteresis Feature. Abstract. Features. Complex Programmable Logic Device APPLICATION NOTE

AT14164: User Calibration of Internal Temperature Sensor - SAM R21. Introduction. SMART ARM-based MCUs APPLICATION NOTE

APPLICATION NOTE. AT11009: Migration from ATxmega64D3/128D3/192D3/256D3 Revision E to Revision I. Introduction. Features.

APPLICATION NOTE. ATA6629/ATA6631 Development Board V2.2 ATA6629/ATA6631. Introduction

APPLICATION NOTE. Atmel AVR127: Understanding ADC Parameters. Atmel 8-bit Microcontroller. Features. Introduction

AVR221: Discrete PID Controller on tinyavr and megaavr devices. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR122: Calibration of the AVR's internal temperature reference. 8-bit Microcontrollers. Application Note. Features.

AT02598:Migration from AT86RF212 to AT86RF212B. Description. Features. Atmel MCU Wireless APPLICATION NOTE

QTouch Capacitive Touch Technology Copyright Atmel Atmel Corporation

ATA2526. Low-voltage IR Receiver ASSP DATASHEET. Features. Applications

8Mb (1M x 8) One-time Programmable, Read-only Memory

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny261A. Appendix A. Appendix A ATtiny261A Specification at 105 C

Atmel U6032B. Automotive Toggle Switch IC DATASHEET. Features. Description

AVR1302: Using the XMEGA Analog Comparator. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Atmel LED Driver Technology. Smart LED Power Management for Efficiency, Programmability and Scalability

APPLICATION NOTE. ATA6621, ATA6621N, ATA6622, ATA6622C, ATA6624, ATA6624C, ATA6626, ATA6626C Development Board ATA6621/22/24/26.

APPLICATION NOTE. ATA5279 Application Hints ATAN0003. Features. Description

Atmel ATA6629/ Atmel ATA6631 Development Board V2.2. Application Note. Atmel ATA6629/ATA6631 Development Board V

UHF ASK/FSK Receiver ATA5721 ATA5722. Features

AN Energy Harvesting with the NTAG I²C and NTAG I²C plus. Application note COMPANY PUBLIC. Rev February Document information

AN12232 QN908x ADC Application Note

Low-cost Phase-control IC with Soft Start

8-bit. Application Note. Microcontrollers. AVR077: Opto Isolated Emulation for the DebugWIRE

AN NHS3xxx Temperature sensor calibration. Document information

Flasher IC with 18-mΩ Shunt U6043B

AVR1311: Using the XMEGA Timer/Counter Extensions. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

R_ Driving LPC1500 with EPSON Crystals. Rev October Document information. Keywords Abstract

TA75W01FU TA75W01FU. Dual Operational Amplifier. Features Pin Connection (Top View)

Flasher, 18-mΩ Shunt, Frequency Doubling Disabling U6433B

Current Monitor IC U4793B

AVR42778: Core Independent Brushless DC Fan Control Using Configurable Custom Logic on ATtiny817. Features. Introduction. AVR 8-bit Microcontroller

OM29110 NFC's SBC Interface Boards User Manual. Rev May

TI Designs: Biometric Steering Wheel. Amy Ball TIDA-00292

Evaluation Kit ATA8520-EK1-F and Extension Board ATA8520-EK3-F (US Version) Kit Content ATAN0157 APPLICATION NOTE

TOSHIBA Original CMOS 16-Bit Microcontroller. TLCS-900/H Series TMP95C061BFG TMP95C061BDFG. Semiconductor Company

Flasher IC with U643B

AN4014 Application Note Adjustable LED blinking frequency using a potentiometer and STM8SVLDISCOVERY Application overview

APPLICATION NOTE. AT11849: QTouch Surface Design Guide. Atmel QTouch. Introduction. Features

Flasher, 30 mω Shunt, Pilot Lamp to GND or V Batt U2043B

Digital Window Watchdog Timer U5021M

AN NFC, PN533, demo board. Application note COMPANY PUBLIC. Rev July Document information

PN7120 NFC Controller SBC Kit User Manual

EVAL-RHF310V1. EVAL-RHF310V1 evaluation board. Features. Description

ShortLink Wide Band Antenna Family Models: SLA150-SMA, SLA150-UFL. Wide Band Antenna Family SLA150 Datasheet

Low Voltage Brushed Motor System

Power Efficiency Optimization and Application Circuits Using Dual-power-supply LDO Regulators

UM Description of the TDA8029 I2C Demo Board. Document information

AN NTAG21xF, Field detection and sleep mode feature. Rev July Application note COMPANY PUBLIC. Document information

AN2979 Application note

AN4112 Application note

Chop away input offsets with TSZ121/TSZ122/TSZ124. Main components Single very high accuracy (5 μv) zero drift micropower 5 V operational amplifier

PTN5100 PCB layout guidelines

TC75W57FU, TC75W57FK

Reference Guide & Test Report

ATA6140. Flasher Application Module. Application Note. ATA Flasher Application Module. 1. Description

ES_LPC1114. Errata sheet LPC1114. Document information

TI Designs: TIDA Passive Equalization For RS-485

UM OM29263ADK Quick start guide antenna kit COMPANY PUBLIC. Document information

UM0791 User manual. Demonstration firmware for the DMX-512 communication protocol receiver based on the STM32F103Zx. Introduction

Description. Part numbers Order codes Packages Output voltages

UM User manual for di2c demo board. Document information

W H I T E P A P E R. Analog Signal Chain Calibration

SKY : Direct Quadrature Demodulator GHz Featuring No-Pull LO Architecture

Atmel ATA5791. Embedded AVR Microcontroller Including RF Transmitter and Complete LF Functionality for Passive Entry/Passive Start Keys

Frequency Translation Using Decimation

TC75S56F, TC75S56FU, TC75S56FE

Improving feedback current accuracy when using H-Bridges for closed loop motor control

DATASHEET 4D SYSTEMS. Arduino Display Module Pack TURNING TECHNOLOGY INTO ART. Featuring a 2.4 Display Module ulcd-24-ptu-ar

AN3332 Application note

AN Programming the PCA200x family of watch ICs. Document information

SKY65120: WCDMA PA Bias Method For Lower Junction Temperature

Collin Wells, Jared Becker TI Designs Precision: Verified Design Low-Cost Digital Programmable Gain Amplifier Reference Design

Ultra-Low-Noise Amplifiers

TI Designs TIDA Automotive 1.3M Camera Module Design with OV10640, DS90UB913A and power over Coax Test Data

256K (32K x 8) Unregulated Battery. Programmable, Read-only Memory

AN PR533 USB stick - Evaluation board. Application note COMPANY PUBLIC. Rev May Document information

ANTENNA DESIGN GUIDE. Last updated March 8 th, The information in this document is subject to change without notice.

T5753C. UHF ASK/FSK Transmitter DATASHEET. Features

TOSHIBA Field Effect Transistor Silicon N Channel MOS Type 2SK1829

SJA1105P/Q/R/S. 1 Features and benefits. 1.1 General features. 1.2 Ethernet switching and AVB features. 1.3 Interface features

AN2668 Application note

UM DALI getting started guide. Document information

Fast read access time 70ns Low-power CMOS operation 100μA max standby 30mA max active at 5MHz. JEDEC standard packages 32-lead PDIP 32-lead PLCC

UM Slim proximity touch sensor demo board OM Document information

APPLICATION NOTE. Practical Hints for Enhancing EMC Performance with Atmel ATA6612/ATA6613 ATA6612/ATA6613. Description

2.4 / 5.5 GHz FlexPIFA 3 dbi Antenna w/u.fl Cable, 100mm

TC75S55F, TC75S55FU, TC75S55FE

AN PN7150X Frequently Asked Questions. Application note COMPANY PUBLIC. Rev June Document information

2.4 GHz 2.5 GHz FlexPIFA 2 dbi Antenna w/u.fl Cable, 100mm

SSM3K35CTC SSM3K35CTC. 1. Applications. 2. Features. 3. Packaging and Pin Assignment Rev.3.0. Silicon N-Channel MOS

TC7W04FU, TC7W04FK TC7W04FU/FK. 3 Inverters. Features. Marking TOSHIBA CMOS Digital Integrated Circuit Silicon Monolithic

TOSHIBA Field Effect Transistor Silicon N Channel MOS Type 2SK2009

1Mb (128K x 8) Low Voltage, One-time Programmable, Read-only Memory

If you have a question, or need help with this application note, visit

ATBTLC1000 BLE 4.1 SOC. From kHz crystal or clock Block Diagram

AN3248 Application note

LDO Regulators Glossary

PN7120 NFC Controller SBC Kit User Manual

TED-Kit 2, Release Notes

Transcription:

SMART ARM-based Microcontrollers AFE Calibration on SAM V/E/S7x Microcontrollers APPLICATION NOTE Introduction The Atmel SMART SAM V/E/S7x series are high-performance, power-efficient embedded MCUs based on the ARM Cortex -M7 processor. Analog-to-digital converters translate analog measurements, characteristic of most phenomena in the real world, to digital format, used in information processing, computing, data transmission, and control systems. The purpose of this application note is to propose a method of offset and gain calibration using digital processing including the average and the calibration registers. An efficient way to generate the analog levels used in the calibration is also proposed. Reference Documents Type Title Atmel Lit. No. Datasheet SAM V71 Datasheet 44003 Datasheet SAM V70 Datasheet 11297 Datasheet SAM E70 Datasheet 11296 Datasheet SAM S70 Datasheet 11242

1. Block Diagram Figure 1-1. AFE Block Diagram (BGA144 Package) Pin VREFP Bonding Pad VREFP Pin VDDIN Bonding Mux Pin AD0-AD11 Bonding Vinp Vinn AFE Code 12 bits References Pin GNDANA Bonding Pad VREFN Bonding VREFN The AFE implements a cyclic ADC architecture. After an input sampling, the ADC processes the voltage in 12 steps, using 23 AFE clock cycles. As illustrated in the above figure, the AFE is built as a differential AFE. This capability provides a good common mode noise rejection which is essential in a microcontroller working at high clock frequency. Without this differential design, the ADC aliases the noise of the microcontroller digital activity and drastically reduces performance. From the natural Differential mode of the ADC, a Single-ended mode is implemented. This mode uses all the positive inputs ADx,y for the signal V INP and V DAC as the reference connected to the ADC negative input V INN. 2

Figure 1-2. Functional Diagram of Sample in Single-Ended Mode Vdac0 DAC0 AOFF ADx Rmux C1x C1y Figure 1-3. Functional Diagram of Sample in Differential Mode Vdac0 DAC0 AOFF Rmux C1x Rmux C1y Figure 1-4. Functional Diagram of Hold in Single-Ended and Differential Modes VREFP PGA gain=c2/c1 Buffer VCM=VREFP/2 C1x C2 Buffer To ADC Vinp_ADC Vinn_ADC VREFN C1y C2 Built in this way, the Single-ended mode maintains the good noise rejection feature of Differential mode. The noise immunity is also reinforced with the dedicated power supply rails VDDANA-GNDANA and the dedicated pin for references VREFP-VREFN. 3

2. AFE Processing The AFE is followed by some digital processing (an average, an offset and gain correction, and a sign format output) before going into the AFE Last Converted Data register (AFEC_LCDR) and AFE Channel Data register (AFEC_CDR). Figure 2-1. AFE Digital Processing Register ADC_EMR RES Register ADC_CVR GAINCORR OFFSETCORR Vinp Vinn AFE Average Calibration Sign mode LCDR 12 bits 2 s Complement Data format 12 to 16 bits 2 s Complement Data format 12 to 16 bits 2 s Complement Data format 12 to 16 bits Sign or unsign data The data out of the ADC is in 12-bit 2's Complement format. All the processing until the Sign mode block is based on a signed operation. The Sign mode block adds 2047 to the DATA to obtain not-signed output. The appropriate value of the AFEC_COCR.AOFF field is 512 (the reset value is zero). Different values are possible for each channel. In a sequencer with more than one selected channel, AOFF is read and updated after the first channel in numeric order. If only one channel is selected, AOFF is read during startup time once and cannot be updated. A new value of AOFF can be updated to the condition to restart the AFEC or to run two conversions; the second one will have the correct AOFF. AFEC_ACR.IBCTL should be 10. With AFEC_MR.TRANSFER=2 and AFEC_MR.TRACKTIM=0, the conversion time is 23 cycles of the ADC clock. The available tracking time is always 15 cycles of the ADC clock. Increasing the tracking time can be done only by reducing the ADC clock frequency. IMPORTANT IMPORTANT IMPORTANT It is recommended to run the ADCLOCK at a lower frequency, i.e. avoid 40 MHz. 10 MHz or 20 MHz reduces the risk of altering the output code with noise. IO pull-up resistance is not automatically disabled when a channel is selected, so this operation needs to be performed previously in the PIO Controller. There is no interrupt for a sequence of conversion; there is an interrupt for each channel individually. 4

2.1 ADC Averaging The averaging block filters the ADC 12-bit DATA in order to suppress noise. Not all kinds of noise can be reduced by this technique. The highest efficiency is achieved with white noise, such as thermal noise and quantization noise. The OSR represents the numbers of averaged samples. The final code is the result of the computation: Averaged Code = OSR 1 ---------------- Sample( k) OSR k = 1 The code gets one additional bit of resolution for 4 averaged samples. This result is not true when the noise is not white. This often occurs when parasitic noise is generated by a digital activity or by a clock noise in ground or supply. The gain of resolution can be reduced down to 0.8 each 4 averaged samples. An actual measurement in 12-bit mode gives a resolution of 10.2 bits effective, which is mainly due to digital activity noise and may change from one application to another. An actual achievement would be as follows: OSR Extra Bits Resolution 4 0.8 11 16 1.6 11.8 64 2.4 12.6 256 3.2 13.4 When an average is used, the code is multiplied by the dynamic enhancement factor M: OSR M Code Max 4 2 8191 16 4 16383 64 8 32767 256 16 65535 with R 12 log 2 = + ----------------------------- ( OSR) 2 where R is the resolution of the ADC with averaging (OSR). 5

2.2 ADC Automatic Error Correction This ADC is built as a differential ADC, so offset error is measured at the midpoint ADVREFP/2, even in Singleended mode. As a consequence, all modes have the same definition of offset and gain error and the same corrective method. 2.2.1 Gain and Offset Error For a given offset of E O (LSB) with 12-bit resolution, this offset value is M E O LSB when the OSR is used. For a given gain error E G (%), this gain error remains unchanged whatever the OSR. The AFE introduces an offset error and then multiplies it by the gain. But we consider the final mathematic equation as y=ax+b form. The actual code C A =(1+E G /100) (C i +Offset)=(1+E G /100) C i +E O With E O =(1+E G /100) Offset E G is the gain error, E G (%)=100 E FS / (M 4096) With full-scale gain error E FS = (E FS+ ) - (E FS- ) C i is the ideal code. Figure 2-2. Gain and Offset Error Code (LSB) M 2047 Ci1 EFS+ Ca1 0 V2 Eo ADVREFP/2 V1 ADVREFP Vinp-vinn Ca2 EFS- Ci2-2048 M In Single-ended mode, V INP = input signal, V INN = V DAC. In Differential mode, V INP = positive input signal, V INN = negative input signal. This automatic error correction feature can be very useful for a user to remove offset and gain error coming from an applicative system, and not only the errors internal to the ADC. 6

2.2.2 Hardware Correction The fields OFFSETCORR and GAINCORR in the AFE Correction Values register (AFEC_CVR) need to be filled with corrective data. This data is computed from two measurement points in signed format. The correction is the same for all functional modes. By choosing two input voltages, V1 and V2, giving the actual measured points, C A 1 and C A 2, this data contains offset error and gain error added on the corresponding ideal points, C i 1 and C i 2. Use signed output code to get the data in the correct format. The use of an averaged value is advised to reduce noise disturbance on the calibration values. The gain error is computed E G = 100 (((C A 2-C A 1))/((C i 2-C i 1))-1) The offset error is computed E O = C A 2-(1+E G /100) C i 2) TIP If the code is measured in a nonsigned format, then the computation must be reverted to a signed format like: E O = (C A 2-2047)-(1+E G /100) (C i 2-2047) With the field OFFSETCORR = -E O and the field GAINCORR= rounding of 2 15 (C i 2-C i 1)/(C A 2-C A 1) The automatic correction is calculated as: Corrected code = (Code+OFFSETCORR) GAINCORR/2 15 To obtain a correct calibration, it is essential to have an external stable and accurate voltage to measure, such as a bandgap voltage. This voltage is provided externally to the AFE. If VREFP accuracy is not ensured (for example ±3%), the calibration also corrects this error. This supposes that VREFP is stable over time, temperature and power consumption. Once a calibration is performed for Single-ended mode, it stays valid for Differential mode. 2.2.3 Software Correction The hardware correction can be replaced by a software correction. When using the same equation of E O evaluation and correction as the hardware correction, it is important to pay attention to the Offset and Gain order of correction: In this case Offset is corrected first and the Gain after, not the opposite. 7

3. Creating Two Calibration Points V1 and V2 without External Voltage The AFE features a 10-bit DAC in feedback with all inputs. A calibration method consists of taking advantage of this DAC to create the V1 and V2 voltages used to compute the offset and gain error. However, this method does not correct the inner variations of the VREFP due to the fact that V1 and V2 depend on VREFP. The main error comes from PGA0 or PGA1. An input of PGA0 must be grounded (or any input with a possible zero volt measurement). This is also valid for calibration of PGA1.The 10-bit DAC AFEC_COCR.AOFF field will be programmed with two values, AOFF1 and AOFF2. V1=GND-VAOFF1 V2=GND-VAOFF2 Computation Example: We select AOFF1=100 and AOFF2=400. Assuming VDDIN=3.3V=VREFP (for the example): V1=VREFP AOFF1/1024=0.322266V V2=VREFP AOFF2/1024=1.289063V Table 3-1. Computation Example with an OSR=256, Resolution R=16 bits Step Parameter Value Unit Equations ideal C i 1-6400 LSB 2 R (0-V1) / VREFP ideal C i 2-25600 LSB 2 R (0-V2) / VREFP actual C A 1-6434 LSB Measured signed format actual C A 2-25826 LSB Measured signed format Extraction of Gain and Offset: Error Gain 1.01 Gain=(C A 2-C A 1) / (C i 2-C i 1) Error Offset 30 Offset=C A 2-C i 2 Gain From this point, the correction can be applied: Register OFFSETCORR -30 LSB OFFSETCORR=-Offset Register GAINCORR 32443 LSB GAINCORR=FLOOR(2 15 /Gain,1) Verification corrected C1-6400 LSB C1=FLOOR((C A 1+OFFSETCORR) GAINCORR/2 15,1) corrected C2-25600 LSB C2=FLOOR((C A 2+OFFSETCORR) GAINCORR/2 15,1) Note: 1. Converted data must be in signed format. This method works for all values of VREFP. If VREFP varies ±3%, the calibration data is not affected and the AFEC is compensated for its own error of gain and offset. The DAC INL, gain and offset error introduces an error on the calibration. If the final accuracy is not sufficient, then an external voltage V1 and V2 are required. Unfortunately, the absolute accuracy (including the VREFP variation) is not corrected. To improve it, it is necessary to compensate the VREFP variations. TIP The advantage to this method is that it can be used in-application and compensates for temperature variation of offset and gain error if the calibration is repeated periodically. 8

Revision History Table 3-2. Date 29-Aug-16 Revision History Change First issue. 9

X ARM Connected Logo X X X X X Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(408) 441.0311 F: (+1)(408) 436.4200 www.atmel.com 2016 Atmel Corporation. / Rev.:. Atmel, Atmel logo and combinations thereof, Enabling Unlimited Possibilities, and others are registered trademarks or trademarks of Atmel Corporation in U.S. and other countries. ARM, ARM Connected logo, and others are the registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others. DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death ( Safety-Critical Applications ) without an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive-grade.