Analog-to-Digital Converters. Transducers



Similar documents
Programing the Microprocessor in C Microprocessor System Design and Interfacing ECE 362

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

Lesson 16 Analog-to-Digital Converter (ADC)

Analog Representations of Sound

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Note monitors controlled by analog signals CRT monitors are controlled by analog voltage. i. e. the level of analog signal delivered through the

CHAPTER 3: DIGITAL IMAGING IN DIAGNOSTIC RADIOLOGY. 3.1 Basic Concepts of Digital Imaging

SAMPLE CHAPTERS UNESCO EOLSS DIGITAL INSTRUMENTS. García J. and García D.F. University of Oviedo, Spain

PHY-2464 Physical Basis of Music

Application Report. 1 Introduction. 2 Resolution of an A-D Converter. 2.1 Signal-to-Noise Ratio (SNR) Harman Grewal... ABSTRACT

S4000TH HART. HART Communication Manual

Analog to Digital Conversion of Sound with the MSP430F2013

MECE 102 Mechatronics Engineering Orientation

Analog to Digital Converters. By: Dapeng Zhu Todd Sifleet Travis Nunnally Yachun Huang

Microcontroller to Sensor Interfacing Techniques

Analog/Digital Conversion. Analog Signals. Digital Signals. Analog vs. Digital. Interfacing a microprocessor-based system to the real world.

LEVERAGING FPGA AND CPLD DIGITAL LOGIC TO IMPLEMENT ANALOG TO DIGITAL CONVERTERS

76-77 GHz RF Transmitter Front-end for W-band Radar Applications

Department of Electrical and Computer Engineering Ben-Gurion University of the Negev. LAB 1 - Introduction to USRP

Digital to Analog and Analog to Digital Conversion

AVR125: ADC of tinyavr in Single Ended Mode. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

PCM Encoding and Decoding:

Microcomputers. Analog-to-Digital and Digital-to-Analog Conversion

Software Manual RS232 Laser Merge Module. Document # SU Rev A

Analog signals are those which are naturally occurring. Any analog signal can be converted to a digital signal.

AVR126: ADC of megaavr in Single Ended Mode. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

Automation System TROVIS 6400 TROVIS 6493 Compact Controller

Programming Logic controllers

Interfacing Analog to Digital Data Converters

SMS GSM Alarm Messenger

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Conversion Between Analog and Digital Signals

Chapter 6: From Digital-to-Analog and Back Again

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

Dyeing Programmer DP - 01

Design of Strong-motion Monitoring System for Dam-reservoir D s e i s gn of Stro r ng-mo m tion Monito t ri r ng Syst s em

Android based Alcohol detection system using Bluetooth technology

Spike-Based Sensing and Processing: What are spikes good for? John G. Harris Electrical and Computer Engineering Dept

AC : PRACTICAL DESIGN PROJECTS UTILIZING COMPLEX PROGRAMMABLE LOGIC DEVICES (CPLD)

Section bit A/D Converter

MP85 / MP85DP. Data sheet. Special features MP85 / MP85DP. B en

Satellite Telemetry, Tracking and Control Subsystems

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

1/22/16. You Tube Video. Definitions. Duty Cycle: on-time per period (specified in per cent)

AN2658 Application note

Using Arduino Microcontrollers to Sense DC Motor Speed and Position

Atmel Norway XMEGA Introduction

STEPPER MOTOR SPEED AND POSITION CONTROL

FFT Frequency Detection on the dspic

PCI/PC Bus Operation ACR8020. ACR8020 Exclusives. ACR8020 (1- to 8-Axes) Ordering. 11 Parker Hannifin Corporation. Catalog 8180/USA Motion Controllers

PC BASED PID TEMPERATURE CONTROLLER

Section 3. Sensor to ADC Design Example

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar

Lecture 2 Outline. EE 179, Lecture 2, Handout #3. Information representation. Communication system block diagrams. Analog versus digital systems

Tire pressure monitoring

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

Product Information S N O. Portable VIP protection CCTV & Alarm System 2

DS1621 Digital Thermometer and Thermostat

Voice---is analog in character and moves in the form of waves. 3-important wave-characteristics:

Analog-to-Digital Converters

Microprocessor & Assembly Language

2.0 Command and Data Handling Subsystem

Design of an Insulin Pump. Purpose of an Insulin Pump:

Analog to Digital Converter

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

Technical Manual. FAN COIL CONTROLLER COOLING or HEATING ANALOG or PWM Art A

Sampling Theorem Notes. Recall: That a time sampled signal is like taking a snap shot or picture of signal periodically.

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

ABB i-bus EIB Logic Module LM/S 1.1

Advanced Electronic System for Human Safety (Smart Watch)

GSM HOME SECURITY SYSTEM

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Section bit A/D Converter

DS1621 Digital Thermometer and Thermostat

QAM Demodulation. Performance Conclusion. o o o o o. (Nyquist shaping, Clock & Carrier Recovery, AGC, Adaptive Equaliser) o o. Wireless Communications

Disturbance Recoder SPCR 8C27. Product Guide

Zigbee-Based Wireless Distance Measuring Sensor System

INTRODUCTION: ABSTRACT:

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

If an occupancy of room is zero, i.e. room is empty then light source will be switched off automatically

AN3998 Application note

Parallel Port Interfacing with Switches, Keypad and Rotatory encoder

ADS9850 Signal Generator Module

PART B QUESTIONS AND ANSWERS UNIT I

4-Channel Thermometer / Datalogger

EVAL-UFDC-1/UFDC-1M-16

13-1. This chapter explains how to use different objects.

CATHODIC PROTECTION TRANSFORMER RECTIFIER (CPTR)

Basics of Digital Recording

Lesson 10: Video-Out Interface

Scanning Comparator (ScanComp) Features. General Description. Input/Output Connections. When to Use a Scanning Comparator. clock - Digital Input* 1.

Analog-to-Digital conversion

Analog Inputs and Outputs

AN1229. Class B Safety Software Library for PIC MCUs and dspic DSCs OVERVIEW OF THE IEC STANDARD INTRODUCTION

How To Use A Sound Card With A Subsonic Sound Card

Introduction to graphics and LCD technologies. NXP Product Line Microcontrollers Business Line Standard ICs

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz MHCI Lab, LMU München

Transcription:

Analog-to-Digital Converters Terminology analog-to-digital converter = ADC = A/D = AtoD Function transform an analog signal into a digital signal for use (calculation, storage, decision making) in an digital system e.g., a microcontroller Motivation the real world is analog A/D needed to interface real world to digital systems monitoring of real world events/phenomena electronic intelligent feedback control of real world real world transducer A/D monitoring i control digital system microcontroller ECE 331, Prof. A. Mason Analog-to-Digital System.1 Transducer Transducers a device that converts a primary form of energy into a corresponding signal with a different energy form Primary Energy Forms: take form of a or an actuator Sensor (e.g., thermometer) a device that detects/measures a signal or stimulus acquires information from the real world Actuator (e.g., heater) a device that generates a signal or stimulus real world actuator intelligent feedback system Analog-to-Digital System.2

Common Transducers Conventional Transducers large, but generally reliable; based on older technology thermocouple: temperature t difference compass (magnetic): direction Microelectronic Sensors millimeter sized; highly sensitive; less robust photodiode/phototransistor: p photon energy (light) infrared detectors, proximity/intrusion alarms piezoresisitve pressure : air/fluid pressure microaccelerometers: vibration, Δ-velocity l (car crash) chemical senors: O 2, CO 2, Cl, Nitrates (explosives) DNA arrays: match DNA sequences Analog-to-Digital System.3 Sensor Systems Generally interested in electronic convert desired parameter into electrically measurable signal Typical Electronic Sensor System input signal (measurand) data analog/digital microcontroller signal processing communication network display Example Sensor System Configurations digital within an instrument microcontroller signal timing, data storage analog analyzed by a PC multiple s displayed over internet internet µc interface A/D, communication signal processing keypad signal timing memory display handheld instrument e.g., RS232 PC comm. card processor comm. bus PC comm. card bus processor comm. Analog-to-Digital System.4

A/D Basic Concepts Analog signal characteristics Digital sample feature maximum voltage voltage reference high: minimum voltage voltage sensitivity frequency components analog digital... sample times Analog-to-Digital System.5 Sampling rate A/D Conversion Process What is sampling? strobe light example Nyquist criterion: minimum sample frequency (f s ) should be twice the highest frequency content (f h ) of the sampled signal Time interval between samples: Anti-aliasing filter: use LPF with Example: sample human voice at 8KHz, use 4KHz LPF to prevent aliasing Encoding Provides unique binary code for every discrete voltage step between V RH and V RL n = #steps = 2 b, b=#bits EXAMPLE: What voltage is encoded by 101? 5V 3-bit encoding example Analog-to-Digital System.6

A/D Conversion Process Quantization: number of discrete levels the analog signal is divided into between V RH and V RL #steps = 2 b more levels (steps) better representation of sampled signal Resolution: voltage per step Resolution = (V RH -V RL )/number of steps = EXAMPLE: V RH = 5 V, V RL = 0 V, quantization = 256 levels # bits =? Resolution =? Analog value: Data rate: # of A/D result bits per second, d = f s bb Analog-to-Digital System.7 Common A/D Architectures/Structures Flash: bank of comparators sample input signal in parallel l very fast (GHz+), size limits resolution: number of comparators needed, 2 N - 1, doubles with each additional bit Integrating: g measures the time it takes to integrate a reference signal to match input value common in digital voltmeters because of linearity and flexibility Sigma-Delta: oversamples signal by a large factor and filters the desired signal band slow but high resolution Successive-approximation: constantly compares input voltage to reference value; reference value moves closer to input value each cycle #cycles = #bits resolution Pipelined: combines successive approximation and flash fast, high resolution, small die (chip) size Example: Best choice for: High speed? High resolution? Analog-to-Digital System.8

Successive Approximation A/D Constantly compares input voltage to reference value set by an internal DAC DAC value cuts voltage range in half each cycle to approach input value each cycle one more bit of resolution Final binary value stored in a successive approximation register (SAR) bit3 bit4 bit2 bit1 Example: What is 3b ADC result for 1.75V? bit 1? bit 2? bit 3? Analog-to-Digital System.9 68HC12 ATD System Eight ATD analog inputs on Inputs fed to analog multiplexer Single signal fed to successive approximation converter Initiate conversion by writing to control register Upon conversion complete, flags set in status registers Results available in results register Analog-to-Digital System.10

HC12 ATD Registers Control registers - configures ATD for specific operation (ATDCTL0 - ATDCTL5) used to tailor an ATD conversion sequence Status registers - two-byte register containing ATD status flags (ATDSTAT) Result registers - contains binary weighted result after conversion (ADR0H - ADR7H) Test registers - used in special modes Analog-to-Digital System.11 ATDCTL2: memory address: $0062 ATD Control Registers ADPU: on/off switch 0: off, 1: on (0 after processor reset) must wait 100 us after on prior to using ATD AFFC: ATD Fast Flag Clear 0: normal clearing - write to ATDCTL5 1: fast clearing - cleared when first result register read ATDCTL4: memory address: $0064 controls sample timing for conversion sequence Example: What is the max ATD sampling frequency? Analog-to-Digital System.12

ATD Control Registers ATDCTL5: memory address: $0065 configure conversion mode for ATD S8CM: select 8 channel mode 0: four, 1: eight conversions SCAN: enable continuous scan 0: single 1: continuous conversion MULT: enable multiple channel conversion 0: single channel, 1: multiple channels CD,CC,CB,CA: set channels for conversion Example: How many different input channels can be selected? Analog-to-Digital System.13 ATD Status Registers ATDSTAT: memory address: $0066,0067 two bytes SCF: Sequence Complete Flag indicates specified conversion sequence is complete CCx: indicates channel currently undergoing conversion CCFx: Conversion Complete Flag for each result register Analog-to-Digital System.14

ATD Results Registers ADRxH: memory address: $0070 007E eight bytes after conversion, results placed in ADR0H-7H unsigned, weighted binary result 1/2FS,1/4FS,1/8FS, 1/256FS., FS=full scale V DC = V RL + ([contents ADRxH]/256) (V RH -V RL ) Example: If V RH = 2.2, V RL = 0.5, what analog value is represented by ADR2H = 00110110? Analog-to-Digital System.15 ATD Programming Example /* File Name: voltmeter.c * File Created: 04-14-02 * File Modified: * Author(s): Abbie Wells * Carrie Hernandez, LCD Portions */ /* This program will create a simple voltmeter using the onboard * analog to digital converter in the HC12. It will perform one * conversion and then the user will have to manually restart the * program to convert another voltage. The voltage will then be * displayed to the LCD. */ #include <hc12.h> #include <stdio.h> #define DECIMAL 0x2E // define macro for a decimal point in ASCII #define V 0x56 // define macro for a "V" in ASCII void delay_100us(void); void ADC_convert(void); void delay_5ms(void); void main(void) printf("hello\n"); ATDCTL2 = 0x80; // power up the ADC and disable interrupts printf("adc2\n"); delay_5ms(); // wait for ADC to warm up printf("warmed up\n"); ATDCTL3 = 0x00; // select active background mode ATDCTL4 = 0x01; // select sample time = 2 ADC clks and set // prescaler to 4 (2 MHz) printf("ready\n"); ADC_convert(); // perform conversion and change to usable // value /* void ADC_convert(void): function to perform a single conversion */ void ADC_convert() unsigned int sumadr; unsigned int avg_bin_voltage; unsigned int int_voltage; unsigned int ones_int; unsigned int tenths_int; unsigned int hundreths_int; char ones; char tenths; char hundreths; ATDCTL5 = 0x03; // sets up ADC to perform a single conversion, // 4 conversions on a single channel, // and store the results ADR0H - ADR3H. while((atdstat & 0x8000)!= 0x8000) // Wait for conversion to finish ; /************************************************************/ //printf("%x %x %x %x\n", ADR0H, ADR1H, ADR2H, ADR3H); /*100us delay based on an 8MHz clock */ sumadr = ADR0H + ADR1H + ADR2H + ADR3H; /************************************************************/ avg_bin_voltage = sumadr/4; void delay_100us(void) int_voltage = (100*avg_bin_voltage/256)*5; ones_int = int_voltage/100; int i; ones = (char)(ones_int + 48); for (i=0; i<400; i++) tenths_int = (int_voltage - ones_int*100)/10; tenths = (char)(tenths_int + 48); asm("nop"); hundreths_int = (int_voltage - ones_int*100 - tenths_int*10)/1; hundreths = (char)(hundreths_int + 48); printf("%c.%c%cv\n", ones, tenths, hundreths); /***********************************************************/ /*5 ms delay based on an 8MHz clock */ /***********************************************************/ void delay_5ms(void) int i; for (i=0; i<800; i++) delay_100us(); Analog-to-Digital System.16