The Successive Approximation Converter Concept - 8 Bit, 5 Volt Example

Similar documents
The 9S12 A/D converter Huang Section ATD_10B8C Block User Guide

Analog-to-Digital Conversion (Part 2) Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

Analog Input & Output

MICROLINK 304x A-D Converter User Manual

Introduction to Embedded Microcomputer Systems Lecture Discrete digital signal. Continuous analog signal

nc... Freescale Semiconductor, I

Introduction to Mechatronics. Fall Instructor: Professor Charles Ume. Analog to Digital Converter

o The 9S12 has a 16-bit free-running counter to determine the time and event happens, and to make an event happen at a particular time

International Islamic University Chittagong (IIUC) Department of Electrical and Electronic Engineering (EEE)

o The 9S12 has a 16-bit free-running counter to determine the time and event happens, and to make an event happen at a particular time

Analog to Digital Conversion

Converters: Analogue to Digital

Interfacing Analog to Digital Data Converters. A/D D/A Converter 1

Section bit Analog-to-Digital Converter (ADC)

Converting between Analog and Digital Domains

B. Sc. III Semester (Electronics) - ( ) Digital Electronics-II) BE-301 MODEL ANSWER (AS-2791)

Data Conversion and Lab (17.368) Fall Lecture Outline

NI-DAQmx Device Considerations

A MISSILE INSTRUMENTATION ENCODER

Analogue Inputs Resolution Assignment

ELCT706 MicroLab Session #3 7-segment LEDs and Analog to Digital Conversion. Eng. Salma Hesham

ES /2 digit with LCD

Analog-to-Digital Converter

Tutorial Introduction

Analog-to-Digital Conversion

Major Differences Between the DT9847 Series Modules

CPE 310L EMBEDDED SYSTEM DESIGN (CPE)

Fig. 1 Analog pins of Arduino Mega

Decade Counters Mod-5 counter: Decade Counter:

Chapter 11 Sections 1 3 Dr. Iyad Jafar

Point System (for instructor and TA use only)

Implementing a Rudimentary Oscilloscope

Agilent 5345A Universal Counter, 500 MHz

LCD Triplex Drive with COP820CJ

FRQM-2 Frequency Counter & RF Multimeter

DT9837 Series. High Performance, USB Powered Modules for Sound & Vibration Analysis. Key Features:

Do the following: a. (12 points) Draw a block diagram of your circuit design, showing and labeling all essential components and connections.

Hello and welcome to this presentation of the STM32L4 Analog-to-Digital Converter block. It will cover the main features of this block, which is used

Ocean Sensor Systems, Inc. Wave Staff, OSSI F, Water Level Sensor With 0-5V, RS232 & Alarm Outputs, 1 to 20 Meter Staff

Experiment 9 Analog/Digital Conversion

TIME RESOLVED XAS DATA COLLECTION WITH AN XIA DXP-4T SPECTROMETER

Tutorial on Technical and Performance Benefits of AD719x Family

Ocean Sensor Systems, Inc. Wave Staff III, OSSI With 0-5V & RS232 Output and A Self Grounding Coaxial Staff

MF 644 MULTIFUNCTION I/O DEVICE USER'S MANUAL

AD16-64(LPCI)LA. Non-isolated high precision analog input board for Low Profile PCI AD16-64(LPCI)LA 1. Ver.1.01

New GRABLINK Frame Grabbers

ECE 4220 Real Time Embedded Systems Final Project Spectrum Analyzer


MBI5152 Application Note

Section Bit ADC with 4 Simultaneous Conversions

A FOUR GAIN READOUT INTEGRATED CIRCUIT : FRIC 96_1

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT /12/14 BIT 10 TO 105 MSPS ADC

Note 5. Digital Electronic Devices

Laboratory Exercise 4

Hello and welcome to this training module for the STM32L4 Liquid Crystal Display (LCD) controller. This controller can be used in a wide range of

DT9834 Series High-Performance Multifunction USB Data Acquisition Modules

TV Synchronism Generation with PIC Microcontroller

WINTER 15 EXAMINATION Model Answer

TXZ Family. Reference Manual 12-bit Analog to Digital Converter (ADC-A) 32-bit RISC Microcontroller. Revision

Hello, and welcome to this presentation of the STM32 system window watchdog. It will cover the main features of this peripheral used to detect

PCI-DAS6034, PCI-DAS6035, and PCI-DAS6036

AI-1204Z-PCI. Features. 10MSPS, 12-bit Analog Input Board for PCI AI-1204Z-PCI 1. Ver.1.04

SPI Serial Communication and Nokia 5110 LCD Screen

B I O E N / Biological Signals & Data Acquisition

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT /12/14 BIT 10 TO 65 MSPS DUAL ADC

VIRTUAL INSTRUMENTATION

AD16-16U(PCI)EV. Features. High-Speed & Resolution Analog Input Board for PCI AD16-16U(PCI)EV 1. Ver.1.02

AI-1616L-LPE. Features. High-precision Analog input board (Low Profile size) for PCI Express AI-1616L-LPE 1. Ver.1.02 Ver.1.01

MTL Software. Overview

University of Illinois at Urbana-Champaign

MF 634 MULTIFUNCTION I/O CARD USER'S MANUAL

AD12-16U(PCI)EV. Features. High-Speed Analog Input Board for PCI AD12-16U(PCI)EV 1. Ver.1.01

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

Scans and encodes up to a 64-key keyboard. DB 1 DB 2 DB 3 DB 4 DB 5 DB 6 DB 7 V SS. display information.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER 2018 EXAMINATION MODEL ANSWER

ANALOG I/O MODULES AD268 / DA264 / TC218 USER S MANUAL

MODULAR DIGITAL ELECTRONICS TRAINING SYSTEM

SigPlay User s Guide

Scanning For Photonics Applications

TZ1000 Series. MCU 12-bit Analog to Digital Converter

Analog to Digital Converter. Last updated 7/27/18

Delta-Sigma ADC

DT8837. High Performance Ethernet Instrument Module for Sound & Vibration. Overview. Key Features

LCD Direct Drive Using HPC

Counter/timer 2 of the 83C552 microcontroller

AI-1664LAX-USB. Features. 100KSPS 16-bit Analog Input Unit for USB AI-1664LAX-USB 1. Ver.1.01


EC14150A AC-Coupled, 14-Bit ExpressCard Digitizer

7 Segment LED CB-035. ElectroSet. Module. Overview The CB-035 device is an, 8-digit 7-segment display. Features. Basic Parameters

M68HC11 Timer. Definition

Experiment: FPGA Design with Verilog (Part 4)

Politecnico di Torino HIGH SPEED AND HIGH PRECISION ANALOG TO DIGITAL CONVERTER. Professor : Del Corso Mahshid Hooshmand ID Student Number:

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR NPTEL ONLINE CERTIFICATION COURSE. On Industrial Automation and Control

PCI-DAS6052 Analog and Digital I/O. User's Guide

SignalTap Plus System Analyzer

Personal Daq/3000 Series USB 1-MHz, 16-Bit Multifunction Modules

VLA-VLBA Interference Memo No. 15

Introduction to PIC Programming

Logic Devices for Interfacing, The 8085 MPU Lecture 4

MBI5050 Application Note

Transcription:

Successive Approximation Converter A successive approximation converter provides a fast conversion of a momentary value of the input signal. It works by first comparing the input with a voltage which is half the input range. If the input is over this level it compares it with three-quarters of the range, and so on. Eight such steps gives 8 bit resolution. While these comparisons are taking place the signal is frozen in a sample and hold circuit. The Successive Approximation Converter Concept - 8 Bit, 5 Volt Example D/A Out = SAR Binary Value x Analog Voltage Range 2 n Where n is the number of bits for A/D - 1

Specifications of Analogue-to-Digital Converters Resolution The resolution of the A-D converter is the number of steps the input range is divided into. The resolution is usually expressed as bits (n) and the number of steps is 2 to the power n. A converter with 8-bit resolution, for in stance, divides the range into 2 8, or 256 steps ( 0 to 255). In this case a 0-5 V range will be resolved to 5/256 or 19.53 mv. Linearity Ideally an A-D converter with n-bit resolution will convert the input range into (2 to the power n)-1 equal steps (255 steps in the case of a 8-bit converter). In practice the steps are not exactly equal, which leads to non-linearity in a plot of A/D output against input voltage. Sample and Hold Acquisition Time A sample and hold circuit freezes the analogue input voltage at the moment the sample is required. This voltage is held constant while the A-D converter digitizes it. The acquisition time is the time between releasing the hold state and the output of the sample circuit settling to the new input voltage value. - 2

Throughput The throughput is the maximum rate at which the A-D converter can output data values. In general it will be the inverse of the (conversion time + the acquisition time) of the A-D converter. Thus a converter that takes 10 microseconds to acquire and convert will be able to generate about 100 000 samples per second. Quantization Error Quantization error is related to resolution and is the error due to the fact that the data from the A/D cannot represent every single analog value. Quantization Error = 2 n above Quantization Error = V R where n is number of data lines and V R is range of A/D. In example 1 x 5 = 0.01953 volts. 256 Transfer Function The transfer equation can be determined from the ratios between the analog input Va to voltage reference V R and digital output to full scale digital. For a linear system the two ratios must be equal. Ratio = Va = code rounded to nearest. V R 2 n or code = Va x 256 rounded to nearest for an 8 bit ADC. V R This equation works for designs in which the minimum voltage is at ground. If the input is bipolar and is level shifted, the general equation is Vin - Vmin = code where Vmin is the minmum input voltage and Vmax Vmin 2 n Vmax is the maximum input voltage. - 3

HCS12 A/D Converter The HCS12's A/D is an 8-channel, 10-bit, multiplexed input successive approximation analog-todigital converter. Features 8/10 Bit Resolution. 7msec, 10-Bit Single Conversion Time. Sample Buffer Amplifier. Programmable Sample Time. Left/Right Justified, Signed/Unsigned Result Data. External Trigger Control. Conversion Completion Interrupt Generation. Analog Input Multiplexer for 8 Analog Input Channels. Analog/Digital Input Pin Multiplexing. 1 to 8 Conversion Sequence Lengths. Continuous Conversion Mode. Multiple Channel Scans. - 4

Registers to Configure/Read From ATD0CTL5 ATD0STAT0 ATD0DR0H ATD0DR1H ATD0DR2H ATD0DR3H ATD0CTL2 ATD0CTL3 ATD0CTL4 ATD Control Register 2 (ATDCTL2) This register controls power down, interrupt and external trigger. Writes to this register will abort current conversion sequence but will not start a new sequence. For Laboratory 10, set bits as follows: ATD Control Register 2 (ATDCTL2) ADPU Power Down - '1' Normal Functionality AFFC Flag clear - '0' Normal AWAI Power down during wait - '0' ETRIGE Disable external trigger - '0' ASCIE Sequence complete interrupt requests disabled - '0' ATD Control Register 3 (ATDCTL3) This register controls the conversion sequence length, FIFO for results registers and behavior in Freeze Mode. Writes to this register will abort current conversion sequence but will not start a new sequence. ATD Control Register 3 (ATDCTL3) - 5

For Laboratory 10, set bits as follows: at reset S4C set to 1 which results in 4 conversions per sequence FIFO conversion result placed in corresponding result register - '0' FRZ1 FRZ2 breakpoint response - continue converting - '0' '0' ATD Control Register 4 (ATDCTL4) This register selects the conversion clock frequency, the length of the second phase of the sample time and the resolution of the A/D conversion (i.e.: 8-bits or 10-bits). Writes to this register will abort current conversion sequence but will not start a new sequence. For Laboratory 10, set bits as follows: ATD Control Register 4 (ATDCTL4) SRES8 10 bit resolution '0' SMP1 SMP0 Sample time select, minimum sample time '0', '0' least accurate PRS0 through PRS4 clock prescaler, max clock freq, '0','0','0','0','0' ATD Control Register 5 (ATDCTL5) This register selects the type of conversion sequence and the analog input channels sampled. Writes to this register will abort current conversion sequence and start a new conversion sequence. For Laboratory 10, set bits as follows: ATD Control Register 5 (ATDCTL5) DJM left justified in result register '0' DSGN Unsigned data representation in result register '0' SCAN Single conversion '0' MULT Sample 1 channel '0' CC, CB, CA Chanel select '0','0','0' - 6

ATD Status Register 0 (ATDSTAT0) This read-only register contains the Sequence Complete Flag, overrun flags for external trigger and FIFO mode, and the conversion counter. ATD Status Register 0 (ATDSTAT0) In Laboratory 10, Examine the SCF bit. That is, wait for SCF (sequence complete flag), do 4 conversions on 1 channel - will be stored in high byte result registers -, then take average of 4 conversions ATD Conversion Result Registers (ATDDRx) The A/D conversion results are stored in 8 read-only result registers. The result data is formatted in the result registers bases on two criteria. First there is left and right justification; this selection is made using the DJM control bit in ATDCTL2. Second there is signed and unsigned data; this selection is made using the DSGN control bit in ATDCTL2. Signed data is stored in 2 s complement format and only exists in left justified format. Signed data selected for right justified format is ignored. - 7

// converts 8 bit A/D on pin 67 (PAD00/AN00) #include <hidef.h> /* common defines and macros */ #include <6812dp256b.h> /* derivative information */ // driver for 6812 8-bit ADC //******** ADCgetSample *************** // perform 4 ADC samples on Chan // return average 4 results // analog input return value // 0.00 0 // 1.25 64 // 2.50 128 // 5.00 255 unsigned char ADCgetSample(unsigned char chan) { ATD0CTL5 = chan; // start sequence //DJM left justified in result register '0' //DSGN Unsigned data representation in result register '0' //SCAN Single conversion '0' //MULT Sample 1 channel '0' // CC, CB, CA Chanel select '0','0','0' while((atd0stat0&0x80)==0){; // wait for SCF (sequence complete) //do 4 conversions on 1 channel - will be stored in high byte result registers // then take average of 4 conversions return (ATD0DR0H+ATD0DR1H+ATD0DR2H+ATD0DR3H)/4; //******** ADCopen *************** // Initialize ADC void ADCopen(void) { ATD0CTL2 = 0x80; // enable ADC //ADPU Power Down - '1' Normal Functionality //AFFC Flag clear - '0' Normal //AWAI Power down during wait - '0' //ETRIGE Disable external trigger - '0' //ASCIE Sequence complete interrupt requests disabled - '0' /* ---------------Register ATD0CTL3 set to defaults 0x00----------- */ // at reset S4C set to 1 which results in 4 conversions per sequence */ // FIFO conversion result placed in corresponding result register - '0' // FRZ1 FRZ2 breakpoint response - continue converting - '0' '0' /* ---------------Register ATD0CTL4 set to defaults 0x00----------- */ // SRES8 10 bit resolution '0' //SMP1 SMP0 Sample time select, minimum sample time '0', '0' least accurate //PRS0 through PRS4 clock prescaler, max clock freq, '0','0','0','0','0' #pragma CODE_SEG NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */ interrupt void RTIisr(void) { /* simple RTI interrupt service routine */ CRGFLG = 0x80; // clear RTIF bit PORTB=~(ADCgetSample(0)); // convert A/D channel 0 and display #pragma CODE_SEG DEFAULT - 8

static void RTIopen(void) { /* setup of the RTI interrupt frequency */ /* adjusted to get 1 millisecond (1.024 ms) with 16 MHz oscillator */ RTICTL = 0x1F; /* set RTI prescaler */ CRGINT = 0x80; /* enable RTI interrupts */ void main(void) { DDRB=0xFF; RTIopen(); ADCopen(); EnableInterrupts; // PORTB outputs for LEDs for(;;) ; /* wait forever */ - 9