Analog to Digital Conversion. Gary J. Minden October 1, 2013

Similar documents
Mark Redekopp, All rights reserved. Lecture 1 Slides. Intro Number Systems Logic Functions

NPSAT1 Solar Cell Measurement System

Computer organization

GR16. Technical Manual. 10 M SPS, 16-bit Analog Signal Digitizer up to 8MB FIFO

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

From Sequential Circuits to Real Computers

Analog to Digital Conversion

Digital Circuits, Binary Numbering, and Logic Gates Cornerstone Electronics Technology and Robotics II

Analog to Digital Converters (ADCs)

CS/COE0447: Computer Organization

ADC Analogue to Digital Conversion

14.1. Unit 14. State Machine Design

A Nonuniform Quantization Scheme for High Speed SAR ADC Architecture

Nyquist-Rate A/D Converters

Software Engineering 2DA4. Slides 8: Multiplexors and More

CS/COE0447: Computer Organization

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING QUESTION BANK

Department of Electrical and Computer Engineering University of Wisconsin Madison. Fall Final Examination

Behavioral Model of Split Capacitor Array DAC for Use in SAR ADC Design

CSE370: Introduction to Digital Design

Realization of programmable logic array using compact reversible logic gates 1

BEHAVIORAL MODEL OF SPLIT CAPACITOR ARRAY DAC FOR USE IN SAR ADC DESIGN

IMPERIAL COLLEGE OF SCIENCE, TECHNOLOGY AND MEDICINE UNIVERSITY OF LONDON DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATIONS 2005

ECE/CS 250 Computer Architecture

! Charge Leakage/Charge Sharing. " Domino Logic Design Considerations. ! Logic Comparisons. ! Memory. " Classification. " ROM Memories.

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

Measurement and Instrumentation. Sampling, Digital Devices, and Data Acquisition

Successive Approximation ADCs

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

Differential Pressure Sensor

ECE260: Fundamentals of Computer Engineering

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Four-Channel Thermistor Temperature-to-Pulse- Width Converter

The influence of parasitic capacitors on SAR ADC characteristics

ir. Georgi Radulov 1, dr. ir. Patrick Quinn 2, dr. ir. Hans Hegt 1, prof. dr. ir. Arthur van Roermund 1 Eindhoven University of Technology Xilinx

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

CS470: Computer Architecture. AMD Quad Core

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

Floating Point Representation and Digital Logic. Lecture 11 CS301

Howto make an Arduino fast enough to... Willem Maes

From Sequential Circuits to Real Computers

Digital- or Logic Circuits. Outline Logic Circuits. Logic Voltage Levels. Binary Representation

Introduction to Digital Signal Processing

Assignment 6: A/D-Converters and PID Controllers

Grabber. Technical Manual

ECE290 Fall 2012 Lecture 22. Dr. Zbigniew Kalbarczyk

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

Keywords: sensor compensation, integrated circuit, ic, compensation algorithm, piezoresistive, prt, pressure sensors, temperature

Intro To Digital Logic

Digital or Analog. Digital style. Old school. or analog? q. digitally: q q 7 q 6 q 5 q 4 q 3 q 2 q 1 q 0. binary coded funnels

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Lecture 3, Performance

ww.padasalai.net

A novel Capacitor Array based Digital to Analog Converter

Homework #4. CSE 140 Summer Session Instructor: Mohsen Imani. Only a subset of questions will be graded

,- # (%& ( = 0,% % <,( #, $ <<,( > 0,% #% ( - + % ,'3-% & '% #% <,( #, $ <<,(,9 (% +('$ %(- $'$ & " ( (- +' $%(& 2,#. = '%% ($ (- +' $ '%("

Digital Integrated Circuits A Design Perspective. Semiconductor. Memories. Memories

Extremely small differential non-linearity in a DMOS capacitor based cyclic ADC for CMOS image sensors

9. Datapath Design. Jacob Abraham. Department of Electrical and Computer Engineering The University of Texas at Austin VLSI Design Fall 2017

Lecture 7: Logic design. Combinational logic circuits

Chapter 1. Binary Systems 1-1. Outline. ! Introductions. ! Number Base Conversions. ! Binary Arithmetic. ! Binary Codes. ! Binary Elements 1-2

DESIGN AND IMPLEMENTATION OF ENCODERS AND DECODERS. To design and implement encoders and decoders using logic gates.

CMP 338: Third Class

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

Realization of 2:4 reversible decoder and its applications

SERIALLY PROGRAMMABLE CLOCK SOURCE. Features

Digital Logic and Design (Course Code: EE222) Lecture 1 5: Digital Electronics Fundamentals. Evolution of Electronic Devices

Chapter 8. Low-Power VLSI Design Methodology

Design of Digital Circuits Reading: Binary Numbers. Required Reading for Week February 2017 Spring 2017

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

5-BIT PROGRAMMABLE VOLTAGE REFERENCE P R O D U C T I O N D ATA S H E E T

AN-1301 APPLICATION NOTE

Lecture 13: Sequential Circuits, FSM

ME224 Lab 6 Viscosity Measurement

Chapter 1 :: From Zero to One

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

D/A-Converters. Jian-Jia Chen (slides are based on Peter Marwedel) Informatik 12 TU Dortmund Germany

PGA309 Programmable Sensor Signal Conditioner. Bringing Linearity to a Non-Linear Pressure Sensor World

Semiconductor Memories

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

ECE/CS 250: Computer Architecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Benjamin Lee

INSTRUMENTAL ENGINEERING

Numbers and Arithmetic

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

ENGIN 112 Intro to Electrical and Computer Engineering

FPGA Resource Utilization Estimates for NI crio LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

CMPE12 - Notes chapter 2. Digital Logic. (Textbook Chapters and 2.1)"

ECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks

Analog Digital Sampling & Discrete Time Discrete Values & Noise Digital-to-Analog Conversion Analog-to-Digital Conversion

CHAPTER VI COMBINATIONAL LOGIC BUILDING BLOCKS

NAME SID EE42/100 Spring 2013 Final Exam 1

A Gray Code Based Time-to-Digital Converter Architecture and its FPGA Implementation

Lecture 3, Performance

Logic Design Combinational Circuits. Digital Computer Design

Moore s Law Technology Scaling and CMOS

Transcription:

Analog to Digital Conversion Gary J. Minden October 1, 2013 1

Mapping Input Voltage to Digital Value Vhigh 0.999 1,023 Vin Vlow 0.0 0 2

Analog to Digital Conversion Analog -- A voltage between Vlow and Vhigh Digital -- A fraction between 0.0 and 1.0 with K bits In the case of the LM3S1968, K = 10 and there are 1,024 steps. Fraction: Values between 0.0 and 0.999023 Binary Point 2-10 Integer: Values between 0 and 1,023 with scale factor of 2-10 Binary Point 3

Challenge #1 -- Compare Voltage Vhigh Vin is input Voltage Range is Vlow to Vhigh Vin V<i> is test Voltage V<i> How to compare Vin to V<i>? That is, is Vin < V<i> or not? Vlow 4

Comparator If Vin > V<i>, then VT<i> is True (1) Vin V<i> + - VT<i> A logic signal 5

Array of Comparators Vin V<9> V<8> + - + - VT<9> VT<8> Set up array of comparators Each comparator tests Vin Each has a different V<i> V<1> + - VT<1> Each comparator generates a logic value, 0 or 1 V<0> + - VT<0> 6

Results VT<i> Output of Comparators Logic R<i> Mark Index V<9> V<8> V<7> V<6> V<5> V<4> V<3> V<2> V<1> V<0> R<3> R<2> R<1> R<0> 0 0 0 0 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7

Problems and Approach This does not scale for a large number of steps E.g. 1,024 or 4,096 Successively generate V<i>, a test Voltage, over several trials What sequence of V<i> to use How do you generate V<i>? 8

Successive Approximation Approach #1 1.0 V Vin is input Voltage Vin Range is 0.0-1.0 V Assume 1,024 steps 0.0 V V<0> = 0.5 V V<0> is first test Voltage Start in the middle If Vin < V<0>, decrease test voltage If Vin >= V<0>, increase test voltage Vin > V<0>, increase 9

Successive Approximation Approach #2 Vin 1.0 V 0.0 V V<1> = 0.75 V Vin is input Voltage Range is 0.0-1.0 V Assume 1,024 steps V<1> is test voltage If Vin < V<1>, decrease test voltage If Vin >= V<1>, increase test voltage Vin < V<1>, decrease test voltage 10

Successive Approximation Approach #3 1.0 V Vin is input Voltage Vin Range is 0.0-1.0 V Assume 1,024 steps V<2> = 0.625 V V<2> is test voltage Start in the middle If Vin < V<2>, decrease V<i> If Vin >= V<2>, increase V<i> 0.0 V Vin >= V<2>, increase 11

Successive Approximation Approach #10 1.0 V Vin is input Voltage Vin Range is 0.0-1.0 V Assume 1,024 steps V<9> = 0.645 V V<9> is test Voltage If Vin < V<9>, decrease test voltage If Vin >= V<9>, increase test voltage Done 0.0 V 12

Successive Approach with DAC Vin Vt + - Compare Generate V<i> with a Digital to Analog Converter (DAC) Convert a binary number to a Voltage DAC log 2 (R)-bits SAR Update SAR FSM 13

Example with Vin = 0.644 V i S<9> S<8> S<7> S<6> S<5> S<4> S<3> S<2> S<1> S<0> V<i> Comp 0 1 0 0 0 0 0 0 0 0 0 0.5 1 1 1 1 0 0 0 0 0 0 0 0 0.75 0 2 1 0 1 0 0 0 0 0 0 0 0.625 1 3 1 0 1 1 0 0 0 0 0 0 0.688 0 4 1 0 1 0 1 0 0 0 0 0 0.656 0 5 1 0 1 0 0 1 0 0 0 0 0.641 1 6 1 0 1 0 0 1 1 0 0 0 0.648 0 7 1 0 1 0 0 1 0 1 0 0 0.645 0 8 1 0 1 0 0 1 0 0 1 0 0.643 1 9 1 0 1 0 0 1 0 0 1 1 0.644 1 D 1 0 1 0 0 1 0 0 1 1 0.644 Compare == 1 if Vin >= V<i> 14

Example with Vin = 0.644 V i S<9> S<8> S<7> S<6> S<5> S<4> S<3> S<2> S<1> S<0> V<i> Comp 0 1 0 0 0 0 0 0 0 0 0 0.5 1 1 1 1 0 0 0 0 0 0 0 0 0.75 0 2 1 0 1 0 0 0 0 0 0 0 0.625 1 3 1 0 1 1 0 0 0 0 0 0 0.688 0 4 1 0 1 0 1 0 0 0 0 0 0.656 0 5 1 0 1 0 0 1 0 0 0 0 0.641 1 6 1 0 1 0 0 1 1 0 0 0 0.648 0 7 1 0 1 0 0 1 0 1 0 0 0.645 0 8 1 0 1 0 0 1 0 0 1 0 0.643 1 9 1 0 1 0 0 1 0 0 1 1 0.644 1 D 1 0 1 0 0 1 0 0 1 1 0.644 Compare == 1 if Vin >= V<i> 15

Example with Vin = 0.644 V i S<9> S<8> S<7> S<6> S<5> S<4> S<3> S<2> S<1> S<0> V<i> Comp 0 1 0 0 0 0 0 0 0 0 0 0.5 1 1 1 1 0 0 0 0 0 0 0 0 0.75 0 2 1 0 1 0 0 0 0 0 0 0 0.625 1 3 1 0 1 1 0 0 0 0 0 0 0.688 0 4 1 0 1 0 1 0 0 0 0 0 0.656 0 5 1 0 1 0 0 1 0 0 0 0 0.641 1 6 1 0 1 0 0 1 1 0 0 0 0.648 0 7 1 0 1 0 0 1 0 1 0 0 0.645 0 8 1 0 1 0 0 1 0 0 1 0 0.643 1 9 1 0 1 0 0 1 0 0 1 1 0.644 1 D 1 0 1 0 0 1 0 0 1 1 0.644 Compare == 1 if Vin >= V<i> 16

Example with Vin = 0.644 V i S<9> S<8> S<7> S<6> S<5> S<4> S<3> S<2> S<1> S<0> V<i> Comp 0 1 0 0 0 0 0 0 0 0 0 0.5 1 1 1 1 0 0 0 0 0 0 0 0 0.75 0 2 1 0 1 0 0 0 0 0 0 0 0.625 1 3 1 0 1 1 0 0 0 0 0 0 0.688 0 4 1 0 1 0 1 0 0 0 0 0 0.656 0 5 1 0 1 0 0 1 0 0 0 0 0.641 1 6 1 0 1 0 0 1 1 0 0 0 0.648 0 7 1 0 1 0 0 1 0 1 0 0 0.645 0 8 1 0 1 0 0 1 0 0 1 0 0.643 1 9 1 0 1 0 0 1 0 0 1 1 0.644 1 D 1 0 1 0 0 1 0 0 1 1 0.644 Compare == 1 if Vin >= V<i> 17

Example with Vin = 0.644 V i S<9> S<8> S<7> S<6> S<5> S<4> S<3> S<2> S<1> S<0> V<i> Comp 0 1 0 0 0 0 0 0 0 0 0 0.5 1 1 1 1 0 0 0 0 0 0 0 0 0.75 0 2 1 0 1 0 0 0 0 0 0 0 0.625 1 3 1 0 1 1 0 0 0 0 0 0 0.688 0 4 1 0 1 0 1 0 0 0 0 0 0.656 0 5 1 0 1 0 0 1 0 0 0 0 0.641 1 6 1 0 1 0 0 1 1 0 0 0 0.648 0 7 1 0 1 0 0 1 0 1 0 0 0.645 0 8 1 0 1 0 0 1 0 0 1 0 0.643 1 9 1 0 1 0 0 1 0 0 1 1 0.644 1 D 1 0 1 0 0 1 0 0 1 1 0.644 Compare == 1 if Vin >= V<i> 18

Result Value Format Scale Factor 2^-1 2^-2 2^-3 2^-4 2^-5 2^-6 2^-7 2^-8 2^-9 2^-10 1/2 1/4 1/8 1/16 1/32 1/64 1/128 1/256 1/512 1/1024 1 0 1 0 0 1 0 0 1 1 Binary Point R = 1/2 + 1/8 + 1/64 + 1/512 + 1/1024 = 0.644

ADC Architecture Analog Sources LPF Mux S ADC Results FIFO To CPU C 20

Successive Approach with DAC Vin Vt + - Compare Generate V<i> with a Digital to Analog Converter (DAC) Convert a binary number to a Voltage DAC log 2 (R)-bits SAR Update SAR FSM 21

Measured Voltage V Measured = (K/4096) * V Ref VRef Internal V Ref = 3.3 V Vin E.g. if K = 472 then V Measured = 0.380 V Vi 0.0 V

TM4C1294 ADC Features Two ADCs, ADC0 and ADC1 Twenty (20) analog input channels shared by the ADCs 12-bit Successive Approximation Register for each ADC On-chip internal temperature sensor Sample rate of up to two million samples/second Four programmable sample conversion sequences from one to eight entries long, with corresponding conversion result FIFOs Flexible trigger control Controller (software), Timers, Analog Comparators, PWM, GPIO Hardware averaging of up to 64 samples for improved accuracy Converter uses a 3.3V reference Power and ground for the analog circuitry is separate from the digital power and ground 23

ADC Top-Level Block Diagram 24

LM3S1968 ADC Block Diagram Seq. Ctrl. ADC Analog Mux Ctrl./Status FIFOs Trigger 25

Tiva ADC Architecture Results ADC FIFO Seq. FIFO Seq. FIFO Seq. FIFO Seq. To CPU 26

ADC Control Enable Interrupt generation DMA operation Sequence prioritization Each sequencer has a priority, 0-3, 0 is highest Trigger configuration Processor (default), analog comparators, an external signal on GPIO PB4, a GP Timer, a PWM generator, and continuous sampling. Comparator configuration External voltage reference Sample phase control 27

ADC Sequencer Characteristics 28

ADC Initialization unsigned long ulvalue; Enable ADC0 // // Configure ADC<9> to read potentiometer voltage. The // TM4C1294 Tiva processor has two ADCs. We'll use ADC0. // SysCtlPeripheralEnable( SYSCTL_PERIPH_ADC0 ); Config. ADC0/Seq0 Prog. Trig. ADCSequenceConfigure( ADC0_BASE, 0, ADC_TRIGGER_PROCESSOR, 1 ); ADCSequenceStepConfigure( ADC0_BASE, 0, 0, ADC_CTL_IE ADC_CTL_END ADC_CTL_CH9 ); ADCSequenceEnable( ADC0_BASE, 0 ); void ADCSequenceConfigure(unsigned long ulbase, unsigned long ulsequencenum, unsigned long ultrigger, unsigned long ulpriority) Priority void ADCSequenceStepConfigure(unsigned long ulbase, unsigned long ulsequencenum, unsigned long ulstep, unsigned long ulconfig) 29

ADC Trigger, Wait, Read Result // // Trigger the sample sequence. // ADCProcessorTrigger(ADC0_BASE, 0); // // Wait until the sample sequence has completed. // while(!adcintstatus(adc0_base, 0, false)) { } // // Read the value from the ADC. // ADCSequenceDataGet(ADC0_BASE, 0, &ulvalue); Start Wait Read Date 30

Sensor Value Mapping Sensor is electronic device Thermistor, Photo-Transistor, Microphone,... Each sensor has a physical measurement range E.g. -40 C to 120 C Each sensor maps measurement range a voltage range based on sensor and electronic circuit E.g. Map -40 C to 120 C to 0.0 V to 2.5 V Micro-controller measures voltage E.g. Voltage between 0.0 V and 3.0 V on LM3S1968 Program has to interpret voltage measurement 31

Sensor to Voltage Mapping 2.5 2.0 Voltage 1.5 1.0 0.5 50 100-40 C -> 0.0 V Temp C 120 C -> 2.5 V 32

ADC Voltage to Value Mapping 1000 Value (Int.) 800 600 400 200 0.5 1.0 1.5 2.0 2.5 3.0 Voltage 33

Sensor to Voltage Mapping 2.5 2.0 Voltage 1.5 1.0 0.5 50 100 Temp C -40 C -> 0.0 V 24 C -> 1.0 V 120 C -> 2.5 V 34

ADC Voltage to Value Mapping 1000 Value (Int.) 341 800 600 400 200 0.5 1.0 1.5 2.0 2.5 3.0 1.0 V Voltage Assumes V Ref = 3.0 V and 10-bit ADC 35

TM4C1294 Temperature Sensor TEMP = 147.5 - ((75 * (VREFP - VREFN) ADCCODE ) / 4096) TM4C1294 Datasheet, pg. 1,068 36

TM4C1294 Temperature Sensor 37

ADC Voltage to Value Mapping Value (Int.) 557 1000 800 600 400 200 0.5 1.0 1.5 2.0 2.5 3.0 1.633 V Voltage Assumes V Ref = 3.0 V and 10-bit ADC 38

ADC Value to Voltage Mapping Value (Int.) 666 1000 800 600 400 200 0.5 1.0 1.5 2.0 2.5 3.0 1.95 V Voltage 666/1024 * 3.0 V = 0.6504 * 3.0 = 1.95 V = V Sensor 39

TM4C1294 Temperature Sensor V Sensor = 1.95 V V Sensor = 1.95 V Temp = 1.25 C. Temp = - (((V Sensor - 2.7 V) * 75) + 55) = 1.25 C 40

Non-Linear Sensors Voltage 1.0 0.5-4 -2 2 4-0.5 Temp C -1.0 41

BMP 180 -- Reading Raw Values 42

BMP 180 -- Calculate Temperature 43

BMP 180 -- Calculate Pressure 44

BMP 180 -- Altitude 45