EECS 373 Design of Microprocessor-Based Systems

Similar documents
EECS 373 Design of Microprocessor-Based Systems

Advantages of Analog Representation. Varies continuously, like the property being measured. Represents continuous values. See Figure 12.

Outline. Analog/Digital Conversion

EE 421L Digital Electronics Laboratory. Laboratory Exercise #9 ADC and DAC

A-D and D-A Converters

Analog to Digital Converters

PHYS225 Lecture 22. Electronic Circuits

ELG3336: Converters Analog to Digital Converters (ADCs) Digital to Analog Converters (DACs)

The need for Data Converters

Electronics A/D and D/A converters

Analog to Digital Conversion

Lecture 6: Digital/Analog Techniques

Fundamentals of Data Converters. DAVID KRESS Director of Technical Marketing

Based with permission on lectures by John Getty Laboratory Electronics II (PHSX262) Spring 2011 Lecture 9 Page 1

Analog I/O. ECE 153B Sensor & Peripheral Interface Design Winter 2016

System on a Chip. Prof. Dr. Michael Kraft

EE251: Tuesday October 10

UNIT III Data Acquisition & Microcontroller System. Mr. Manoj Rajale

Assoc. Prof. Dr. Burak Kelleci

Data Converters. Dr.Trushit Upadhyaya EC Department, CSPIT, CHARUSAT

The simplest DAC can be constructed using a number of resistors with binary weighted values. X[3:0] is the 4-bit digital value to be converter to an

The counterpart to a DAC is the ADC, which is generally a more complicated circuit. One of the most popular ADC circuit is the successive

Analog-Digital Interface

Analogue to Digital Conversion

University of Pittsburgh

Working with ADCs, OAs and the MSP430

EEE312: Electrical measurement & instrumentation

Data Converters. Lecture Fall2013 Page 1

Chapter 5: Signal conversion

Analog-to-Digital i Converters

UNIVERSITY OF CALIFORNIA College of Engineering Department of Electrical Engineering and Computer Sciences

Linear Integrated Circuits

ME 461 Laboratory #3 Analog-to-Digital Conversion

CHAPTER ELEVEN - Interfacing With the Analog World

Analogue to Digital Conversion

Module 13: Interfacing ADC. Introduction ADC Programming DAC Programming Sensor Interfacing

Chapter 2 Signal Conditioning, Propagation, and Conversion

An 8-bit Analog-to-Digital Converter based on the Voltage-Dependent Switching Probability of a Magnetic Tunnel Junction

Lecture #6: Analog-to-Digital Converter

Analog ó Digital Conversion Sampled Data Acquisition Systems Discrete Sampling and Nyquist Digital to Analog Conversion Analog to Digital Conversion

Analogue Interfacing. What is a signal? Continuous vs. Discrete Time. Continuous time signals

Introduction. These two operations are performed by data converters : Analogue-to-digital converter (ADC) Digital-to-analogue converter (DAC)

ELG4139: Converters Analog to Digital Converters (ADCs) Digital to Analog Converters (DACs)

5. Transducers Definition and General Concept of Transducer Classification of Transducers

10. Chapter: A/D and D/A converter principles

Data Converter Fundamentals

Digital to Analog Converters (DAC) Adam Fleming Mark Hunkele 3/11/2005

Analogue-to-Digital Conversion

Embedded Systems Lecture 2: Interfacing with the Environment. Björn Franke University of Edinburgh

Analog to Digital Conversion

Embedded Control. Week 3 (7/13/11)

EE445L Spring 2018 Final EID: Page 1 of 7

INL PLOT REFIN DAC AMPLIFIER DAC REGISTER INPUT CONTROL LOGIC, REGISTERS AND LATCHES

3. DAC Architectures and CMOS Circuits

Cyber-Physical Systems ADC / DAC

ADC Resolution: Myth and Reality

Environmental ADC Interface P Team Members

Lecture 9, ANIK. Data converters 1

P a g e 1. Introduction

Figure 1.1 Mechatronic system components (p. 3)

8-Bit, high-speed, µp-compatible A/D converter with track/hold function ADC0820

Workshop ESSCIRC. Low-Power Data Acquisition System For Very Small Signals At Low Frequencies With12-Bit- SAR-ADC. 17. September 2010.

EECS 373 Design of Microprocessor-Based Systems

Sensors. Chapter 3. Storey: Electrical & Electronic Systems Pearson Education Limited 2004 OHT 3.1

Tuesday, March 1st, 9:15 11:00. Snorre Aunet Nanoelectronics group Department of Informatics University of Oslo.

SPT BIT, 30 MSPS, TTL, A/D CONVERTER

DATA CONVERSION AND LAB (17.368) Fall Class # 07. October 16, 2008

Data Acquisition & Computer Control

ANALOG-TO-DIGITAL CONVERTERS

ADC0808/ADC Bit µp Compatible A/D Converters with 8-Channel Multiplexer

Page 1. Midterm #2. OpAmp Review. Inverting & Non-inverting Circuits CS/ECE 6780/5780. Al Davis. Almost ubiquitous analog circuit element since ~1968

12-Bit, Low-Power, Dual, Voltage-Output DAC with Serial Interface

MECE 3320 Measurements & Instrumentation. Data Acquisition

Analog to Digital Conversion

DSP Project. Reminder: Project proposal is due Friday, October 19, 2012 by 5pm in my office (Small 239).

UNIT I Circuit Configuration for Linear ICs

Signal Characteristics and Conditioning

Fan in: The number of inputs of a logic gate can handle.

Interface Electronic Circuits

UNITII. Other LICs and Data Converters

Single-channel power supply monitor with remote temperature sense, Part 1

1.8 V to 5 V Auto-Zero, In-Amp with Shutdown AD8563

Microprocessors & Interfacing

Data Conversion and Lab (17.368) Fall Lecture Outline

Last Time. P and N type semiconductors Diode internals Transistors NPN PNP

CMOS 12-Bit Serial Input Multiplying DIGITAL-TO-ANALOG CONVERTER

1.8 V to 5 V Auto-Zero, In-Amp with Shutdown AD8553

Analog/Digital and Sampling

ANALOG TO DIGITAL (ADC) and DIGITAL TO ANALOG CONVERTERS (DAC)

Chapter 2 Analog-to-Digital Conversion...

EE247 Lecture 20. Comparator architecture examples Flash ADC sources of error Sparkle code Meta-stability

Mixed-Signal-Electronics

CRN: MET-487 Instrumentation and Automatic Control June 28, 2010 August 5, 2010 Professor Paul Lin

CHEMICAL ENGINEERING 2I03

ELG3336 Design of Mechatronics System

High-Speed Analog to Digital Converters. ELCT 1003:High Speed ADCs

+2.7V to +5.5V, Low-Power, Triple, Parallel 8-Bit DAC with Rail-to-Rail Voltage Outputs

Lab 2: Discrete BJT Op-Amps (Part I)

SCLK 4 CS 1. Maxim Integrated Products 1

Using Optical Isolation Amplifiers in Power Inverters for Voltage, Current and Temperature Sensing

Transcription:

EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 11: Sampling, ADCs, and DACs Oct 7, 2014 Some slides adapted from Mark Brehob, Jonathan Hui & Steve Reinhardt 1

Outline Announcements Sampling ADC DAC 2

Announcements Exam is a 9 days from today Q&A session on Thursday (10/9) during class Additional Q&A sessions? One page, front and back cheat sheet Practice exam Special Projects Groups 41 signed up 5 missing! sign up today by midnight or receive a zero Group Projects Find group members Brainstorm project ideas! Research projects: let me know ASAP 3

We live in an analog world Everything in the physical world is an analog signal Sound, light, temperature, pressure Need to convert into electrical signals Transducers: converts one type of energy to another Electro-mechanical, Photonic, Electrical, Examples Microphone/speaker Thermocouples Accelerometers 4

Transducers convert one form of energy into another Transducers Allow us to convert physical phenomena to a voltage potential in a well-defined way. A transducer is a device that converts one type of energy to another. The conversion can be to/from electrical, electro-mechanical, electromagnetic, photonic, photovoltaic, or any other form of energy. While the term transducer commonly implies use as a sensor/detector, any device which converts energy can be considered a transducer. Wikipedia. 5

Convert light to voltage with a CdS photocell V signal = (+5V) R R /(R + R R ) Choose R=R R at median of intended range Cadmium Sulfide (CdS) Cheap, low current t RC = (R+R R )*C l Typically R~50-200kΩ" C~20pF So, t RC ~20-80uS f RC ~ 10-50kHz Source: Forrest Brewer 6

Many other common sensors (some digital) Force strain gauges - foil, conductive ink conductive rubber rheostatic fluids Piezorestive (needs bridge) piezoelectric films capacitive force Charge source Sound Microphones Both current and charge versions Sonar Usually Piezoelectric Position microswitches shaft encoders gyros Acceleration MEMS Pendulum Monitoring Battery-level voltage Motor current Stall/velocity Temperature Voltage/Current Source Field Antenna Magnetic Hall effect Flux Gate Location Permittivity Dielectric Source: Forrest Brewer

Going from analog to digital What we want Physical Phenomena Engineering Units How we have to get there Physical Phenomena Voltage or Current ADC Counts Engineering Units Sensor ADC Software 8

Representing an analog signal digitally How do we represent an analog signal? As a time series of discrete values! On MCU: read the ADC data register periodically f (x) V Counts f sampled (x) t T S 9

Choosing the horizontal range What do the sample values represent? Some fraction within the range of values! What range to use? V r+ V r+ V r V r Range Too Small t Range Too Big t V r+ V r Ideal Range t 10

Choosing the horizontal granularity Resolution Number of discrete values that represent a range of analog values MSP430: 12-bit ADC 4096 values Range / 4096 = Step Larger range " less information Quantization Error How far off discrete value is from actual ½ LSB! Range / 8192 Larger range " larger error 11

Choosing the sample rate What sample rate do we need? Too little: we can t reconstruct the signal we care about Too much: waste computation, energy, resources f (x) f sampled (x) t 12

Shannon-Nyquist sampling theorem If a continuous-time signal contains no frequencies higher than f max, it can be completely determined by discrete samples taken at a rate: f (x) Example: f > 2 f samples max Humans can process audio signals 20 Hz 20 KHz Audio CDs: sampled at 44.1 KHz 13

Converting between voltages, ADC counts, and engineering units Converting: ADC counts " Voltage V r+ V in V r N ADC t N ADC V in = = V 4095 V N ADC V in R+ R V V R + V 4095 R R Converting: Voltage " Engineering Units V TEMP TEMP C = = 0.00355(TEMP V 0.986 0.00355 TEMP C ) + 0.986 14

A note about sampling and arithmetic* Converting values in 16-bit MCUs V TEMP V + V 4095 R R = N ADC TEMP C = V 0.986 0.00355 TEMP vtemp = adccount/4095 * 1.5; tempc = (vtemp-0.986)/0.00355;! tempc = 0 Fixed point operations Need to worry about underflow and overflow Floating point operations They can be costly on the node 15

Use anti-aliasing filters on ADC inputs to ensure that Shannon-Nyquist is satisfied Aliasing Different frequencies are indistinguishable when they are sampled. Condition the input signal using a low-pass filter Removes high-frequency components (a.k.a. anti-aliasing filter) 16

Designing the anti-aliasing filter Note ω is in radians ω = 2πf Exercise: Say you want the half-power point to be at 30Hz and you have a 0.1 µf capacitor. How big of a resistor should you use?! 17

Do I really need to condition my input signal? Short answer: Yes. Longer answer: Yes, but sometimes it s already done for you. Many (most?) ADCs have a pretty good analog filter built in. Those filters typically have a cut-off frequency just above ½ their maximum sampling rate. Which is great if you are using the maximum sampling rate, less useful if you are sampling at a slower rate. 18

Oversampling One interesting trick is that you can use oversampling to help reduce the impact of quantization error. Let s look at an example of oversampling plus dithering to get a 1-bit converter to do a much better job (done on board) 19

Can use dithering to deal with quantization Dithering Quantization errors can result in large-scale patterns that don t accurately describe the analog signal Oversample and dither Introduce random (white) noise to randomize the quantization error. Direct Samples Dithered Samples 20

Lots of other issues Might need anti-imaging (reconstruction) filter on the output Cost, speed (, and power): Might be able to avoid analog all together Think PWM when dealing with motors 21

How do ADCs and DACs work? 22

DAC #1: Voltage Divider Vref R Din 2 2-to-4 decoder Fast Size (transistors, switches)? Accuracy? Monotonicity? R R Vout R

Vref DAC #2: R/2R Ladder R R R 2R 2R 2R 2R 2R Iout D3 (MSB) D2 D1 D0 (LSB) Size? Accuracy? Monotonicity? (Consider 0111 -> 1000)

DAC output signal conditioning* Often use a low-pass filter May need a unity gain op amp for drive strength 25

ADC #1: Flash Vref Vin R + _ priority encoder 3 R R + _ + _ 2 1 2 Dout R Vcc 0

ADC #2: Single-Slope Integration Vin Vcc I + _ C done EN* n-bit counter CLK Start: Reset counter, discharge C. Charge C at fixed current I until Vc > Vin. How should C, I, n, and CLK be related? Final counter value is Dout. Conversion may take several milliseconds. Good differential linearity. Absolute linearity depends on precision of C, I, and clock.

ADC #3: Successive Approximation (SAR)* 1 Sample! Multiple cycles Requires N-cycles per sample where N is # of bits Goes from MSB to LSB Not good for high-speed ADCs

Errors and ADCs Figures and some text from: Understanding analog to digital converter specifications. By Len Staller http://www.embedded.com/showarticle.jhtml?articleid=60403334 Key concept here is that the specification provides worst case values.

Integral nonlinearity The integral nonlinearity (INL) is the deviation of an ADC's transfer function from a straight line. This line is often a best-fit line among the points in the plot but can also be a line that connects the highest and lowest data points, or endpoints. INL is determined by measuring the voltage at which all code transitions occur and comparing them to the ideal. The difference between the ideal voltage levels at which code transitions occur and the actual voltage is the INL error, expressed in LSBs. INL error at any given point in an ADC's transfer function is the accumulation of all DNL errors of all previous (or lower) ADC codes, hence it's called integral nonlinearity.

Differential nonlinearity DNL is the worst cases variation of actual step size vs. ideal step size. It s a promise it won t be worse than X.

Sometimes the intentional ½ LSB shift is included here!

Full-scale error is also sometimes called gain error full-scale error is the difference between the ideal code transition to the highest output code and the actual transition to the output code when the offset error is zero.

Errors Once again: Errors in a specification are worst case. So if you have an INL of ±.25 LSB, you know that the device will never have more than.25 LSB error from its ideal value. That of course assumes you are operating within the specification Temperature, input voltage, input current available, etc. INL and DNL are the ones I expect you to work with Should know what full-scale error is