350 likes | 539 Views
ID A14C: Getting Optimal Performance from your ADC. Jim Page. Senior Applications Engineer. 12 October 2010. Version: 1.1. Jim Page. Senior Applications Engineer 14 years experience with variety of Renesas tools R8C/M16C/740 series processor primary support
E N D
ID A14C: Getting Optimal Performance from your ADC Jim Page Senior Applications Engineer 12 October 2010 Version: 1.1
Jim Page • Senior Applications Engineer • 14 years experience with variety of Renesas tools • R8C/M16C/740 series processor primary support • Member of Renesas Technical Support Staff for web customer support • Key support and development role for several successful projects being used in-field today using broad variety of Renesas and 3rd party tools • B.S. EET from Western Carolina University • Go Catamounts!! • Expert in USB and other serial technologies • Co-patent holder/developer of original Renesas Flash-Over-USB technology • Expert in I2C, SPI, and other serial protocol interfaces using Renesas MCUs
Renesas Technology and Solution Portfolio Microcontrollers& Microprocessors#1 Market shareworldwide * SolutionsforInnovation Analog andPower Devices#1 Market sharein low-voltageMOSFET** ASIC, ASSP& MemoryAdvanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 ** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).
Renesas Technology and Solution Portfolio Microcontrollers& Microprocessors#1 Market shareworldwide * SolutionsforInnovation Analog andPower Devices#1 Market sharein low-voltageMOSFET** ASIC, ASSP& MemoryAdvanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 ** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis). 4
Microcontroller and Microprocessor Line-up • Up to 1200 DMIPS, 45, 65 & 90nm process • Video and audio processing on Linux • Server, Industrial & Automotive Superscalar, MMU, Multimedia • Up to 500 DMIPS, 150 & 90nm process • 600uA/MHz, 1.5 uA standby • Medical, Automotive & Industrial High Performance CPU, Low Power • Up to 165 DMIPS, 90nm process • 500uA/MHz, 2.5 uA standby • Ethernet, CAN, USB, Motor Control, TFT Display High Performance CPU, FPU, DSC • Legacy Cores • Next-generation migration to RX R32C H8S H8SX M16C General Purpose Ultra Low Power Embedded Security • Up to 25 DMIPS, 150nm process • 190 uA/MHz, 0.3uA standby • Application-specific integration • Up to 10 DMIPS, 130nm process • 350 uA/MHz, 1uA standby • Capacitive touch • Up to 25 DMIPS, 180, 90nm process • 1mA/MHz, 100uA standby • Crypto engine, Hardware security 5
Microcontroller and Microprocessor Line-up • Up to 1200 DMIPS, 45, 65 & 90nm process • Video and audio processing on Linux • Server, Industrial & Automotive Superscalar, MMU, Multimedia All Of Them! • Up to 500 DMIPS, 150 & 90nm process • 600uA/MHz, 1.5 uA standby • Medical, Automotive & Industrial High Performance CPU, Low Power • Up to 165 DMIPS, 90nm process • 500uA/MHz, 2.5 uA standby • Ethernet, CAN, USB, Motor Control, TFT Display High Performance CPU, FPU, DSC • Legacy Cores • Next-generation migration to RX R32C H8S H8SX M16C General Purpose Ultra Low Power Embedded Security • Up to 25 DMIPS, 150nm process • 190 uA/MHz, 0.3uA standby • Application-specific integration • Up to 10 DMIPS, 130nm process • 350 uA/MHz, 1uA standby • Capacitive touch • Up to 25 DMIPS, 180, 90nm process • 1mA/MHz, 100uA standby • Crypto engine, Hardware security 6
Agenda • Successive Approximation and Delta-Sigma Converters • Basic Concepts • Advantages and Disadvantages • ADC Key Terms and Concepts • Source resistance limitations • Discussions of how often to sample
Successive Approximation (SAR) ADC ADC Register 1 0 1 1 0 0 1 0 0 1 0 Vref DAC (R2R Ladder) AVss AN0 Comparator AN1 AN2 AN3 AN4 AN5 AN6 AN7 Sample and Hold Circuit Input Analog Mux
Advantages and Disadvantages of SAR • Advantages of Successive Approximation • Easy to multiplex • Relatively fast • R2R ladder does not require precision parts • Disadvantages of Successive Approximation • Analog circuitry required • Not easy to get high resolution
Delta Sigma Converter 5V 0V +V ∫ H ∑ H Digital Filter Vin D Ref 4V CK
Advantages and Disadvantages of Delta Sigma • Advantages of Delta Sigma • Digital circuits set resolution • No sample & hold circuit • Digital filtering controls noise very effectively • Digital filter can be tailored to application • Disadvantage • High speed digital circuits required • Delay in first code (signal is phase delayed) • Not easy to multiplex
Agenda • Successive Approximation and Delta-Sigma Converters • Basic Concepts • Advantages and Disadvantages • ADC Key Terms and Concepts
ADC Specifications - Errors Full Scale Error Full Scale Non-Linearity Error Ideal Curve ADC Counts Corrected Curve Absolute Error Real Curve 0V Vfull Scale Input Voltage Offset Error
10 bit ADC facts • Resolution is 1 part in 1024 • Can resolve 0C to 250C (480F) within ¼ degree C • Inherent Accuracy is 0.1% • If Vref = 5V each step is equal to 4.88 mV (5V/1024) • If Vref is decreased to 2.5V each step is 2.44 mV • ± 3 LSB error means 3 counts of the reading may be off • For example: Voltage in should result in count of 100 • Real count could be from 97 to 103 • Does not mean that the A/D is a 7 bit A/D converter
+V +Vref Vcc Vref R1 MCU 10 bit AD Input R2 R1=R2 Answer Now What is the ADC reading for the circuit below? • Depends on Vref • Depends on Vcc • Need to know resistor values • 512 • Ask the HW engineer
Ratiometric and Non-Ratiometric conversions +V +V +V +V +Vref +Vref Vcc Vcc Vcc Vcc Vref Vref Vref Vref MCU MCU MCU MCU AD Input AD Input AD Input AD Input a) ratiometric b) ratiometric d) non-ratiometric c) non-ratiometric
Advantage of Ratiometric conversions • Since Vref is the voltage driving the resistor divider • 1) Vm = Vref * (Rk/(Rx+Rk)) • ADC reading = Vm/Vref * max ADC counts • Substituting Equation 1 into Equation 2 • ADC reading/max counts = Rk/(Rx+Rk) • *** Notice there are no voltages left in the relationship +V Vcc Vref Rx MCU Vm AD Input Rk a) ratiometric
Sensing Error Considerations Vcc • Ratiometric Errors • ADC error • Divider errors • Sensor error • Non-Ratiometric errors • Ratiometric errors plus Vref errors • Tolerance error can be calibrated out • Drift components typically cannot be calibrated out Vref MCU Vm AD In Vcc Vref MCU AD In
Agenda • Successive Approximation and Delta-Sigma Converters • Basic Concepts • Advantages and Disadvantages • ADC Key Terms and Concepts • Source resistance limitations
Source Resistance Errors From M16C/62P Manual If you solve this you will see the source resistance can be approximately 13.9K
Source Resistance Errors RC time constant of source resistance and sampling cap can cause error Vref ADC Input Ckt Equivalent 10k Rs To AD Converter Block S1 Req 10k Ceq For M16C/62P Req = 7.8k Ceq = 1.5 pF S1 closed for 3 fAD cycles
Source Resistance Limitation (An intuitive approach) • Since we want the error much less than 1/1024 (0.1%) let’s allow 10 time constants (0.005%) • Sampling occurs for 300 nSec • (3 cycles of 10 MHz AD clock) • 10 time constants = 300 nSec 1 TC = 30 nSec • C = 1.5 pF so Rtotal (Rs + Req) must be 20Kohm or less • (300 nSec/1.5 pF) • Rsource can not be greater than 12.2 K ohms • Equivalent resistance of the AD circuit is 7.8K • (Strict analysis indicated 13.8 kOhm)
Source Resistance Errors What can we do? Vref • Decrease Rs • Increase sampling time (decrease fAD) 40k To AD Converter Block Rs • 3. Q = C * E • If Ctotal changes by <1/1000 then E will change by <1/1000 • Ceq = 1.5 pF so make C1 1500 pf S1 Req C1 30k Ceq For M16C/62P Req = 7.8k Ceq = 1.5 pF S1 closed for 3 fAD cycles
Effect of Adding Capacitor to Input Pin Adding capacitor creates a low pass filter fc To AD Converter Block Rs S1 Req C1 Ceq Gain Freq fc = 1/2πRC 20k Rs and .0015 uF = 5.3 kHz corner
Agenda • Successive Approximation and Delta-Sigma Converters • Basic Concepts • Advantages and Disadvantages • ADC Key Terms and Concepts • Source resistance limitations • Sampling Rate Considerations
How often should I sample if: • Example: you are measuring outside air temperature to display on a gauge • How often should you monitor • What is the update rate on the display ? • Oversample and filter at least 8:1 • Consider taking 10 samples, throw out high and low and average rest • Evenly spaced measurements tend to minimize noise affects I am just providing a data reading (not closed loop control)?
How often should I sample if: I am using the value in a control loop • Example: you are controlling a fan with an integrated BLDC controller • How fast can the fan respond to a change in input • If speed response time to a prompt step is 100 mSec • No need to close loop every mSec • Probably want to consider sampling many times near the update time Response Time Command Change Fan Speed Time
Approximating an Integral (Riemann Sum) 100V X 99V X 70V X 54V X 28V x 99 70 54 28 0V (54 +70 +28 +99 + 0)/5= 50.2
When should I remember Nyquist • When you want to impress your friends • Filtering algorithms (FIR, IIR) • Transforms involved (Fourier and many Codecs)
Summary of Topics Discussed • Block diagrams of Successive Approximation and Delta-Sigma Converters • Major Characteristics • Advantages/Disadvantages • Key Terms and Concepts • Resolution • Accuracy • Ratiometric/Non-Ratiometric • Source resistance limitations • “Calculating Maximum Source Resistance” • Alternatives for source resistance limitations • Discussions of how often to sample