Data acquisition and manipulation

Slides:



Advertisements
Similar presentations
Analog to digital converter
Advertisements

Electronics Design Lab TUTORIAL PIC Microcontrollers Francesco Tenore 2/10/2006.
EET260 Introduction to digital communication
Interfacing to the Analog World
Interfacing to the Analog World
Analog to Digital Conversion (ADC)
Analog-to-Digital Converter (ADC) And
Lecture 17: Analog to Digital Converters Lecturers: Professor John Devlin Mr Robert Ross.
Sensors Interfacing.
Learning Objectives Static and Dynamic Characteristics of Signals
EET 252 Unit 6 Analog-to-Digital Conversion
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
Digital to Analog and Analog to Digital Conversion
Announcements Assignment 8 posted –Due Friday Dec 2 nd. A bit longer than others. Project progress? Dates –Thursday 12/1 review lecture –Tuesday 12/6 project.
Analog to Digital Conversion. Introduction  An analog-to-digital converter (ADC, A/D, or A to D) is a device that converts continuous signals to discrete.
Data Acquisition Concepts Data Translation, Inc. Basics of Data Acquisition.
COMP3221: Microprocessors and Embedded Systems
5/4/2006BAE Analog to Digital (A/D) Conversion An overview of A/D techniques.
Lecture 9: D/A and A/D Converters
Analogue to Digital Conversion
Interfacing Analog and Digital Circuits
Explain the introduction to ADC, ADC characteristics, Programming ADC using PIC18, Introduction to DAC and DAC interfacing with PIC18.
Interfacing with the Analog World Wen-Hung Liao, Ph.D.
1 Dr. Un-ki Yang Particle Physics Group or Shuster 5.15 Amplifiers and Feedback: 3.
ECT 357 Ch 10 Analog to Digital COnversion. Today’s Quote: It’s better to die with a good name than to live with a bad one. It’s better to die with a.
Storey: Electrical & Electronic Systems © Pearson Education Limited 2004 OHT 26.1 Data Acquisition and Conversion  Introduction  Sampling  Signal Reconstruction.
Introduction to Data Conversion
Analog to Digital Converters (ADC)
EET260: A/D and D/A converters
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Starting with serial Chapter Ten 10.1, 10.2,
Analogue Input/Output
Taking timing further Chapter Nine 9.1 – 9.8 Dr. Gheith Abandah1.
Parallel ports, power supply, and the clock oscillator Chapter Three Dr. Gheith Abandah1.
Railway Foundation Electronic, Electrical and Processor Engineering.
PH4705/ET4305: A/D: Analogue to Digital Conversion
Digital to Analog Converters
Digital Communication Techniques
Engineering 1040: Mechanisms & Electric Circuits Winter 2015 Analog & Digital Signals Analog to Digital Conversion (ADC)
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
ACOE2551 Microprocessors Data Converters Analog to Digital Converters (ADC) –Convert an analog quantity (voltage, current) into a digital code Digital.
Analog to Digital Converters (ADC) 1
Digital to Analogue Converter
Analog to Digital conversion. Introduction  The process of converting an analog signal into an equivalent digital signal is known as Analog to Digital.
Data Acquisition Systems
ELN5622 Embedded Systems Class 7 Spring, 2003 Aaron Itskovich
Revised: Aug 1, ECE 263 Embedded System Design Lessons HC12 Analog-to-Digital (ATD) Converter System.
Data Acquisition ET 228 Chapter 15 Subjects Covered Analog to Digital Converter Characteristics Integrating ADCs Successive Approximation ADCs Flash ADCs.
1 Data-Converter Circuits A/D and D/A Chapter 9 1.
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
Analog to Digital Converters
Analog/Digital Conversion
Chapter 11 Data Acquisition and Manipulation The aims of this chapter are to introduce: the main features of a data acquisition system; the characteristics.
Digital to Analog Converter (DAC)
ECE 2799 Electrical and Computer Engineering Design ANALOG to DIGITAL CONVERSION Prof. Bitar Last Update:
0808/0809 ADC. Block Diagram ADC ADC0808/ADC Bit μP Compatible A/D Converters with 8-Channel Multiplexer The 8-bit A/D converter uses successive.
Lecture Notes / PPT UNIT III
CEng3361 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2011 Recitation 06.
MECH 373 Instrumentation and Measurements
Microprocessors Data Converters Analog to Digital Converters (ADC)
Introduction to Discrete-Time Control Systems fall
EE Embedded Systems Fall 2015
Digital Acquisition of Analog Signals – A Practical Guide
Lesson 8: Analog Signal Conversion
PIC18F458 Analog-to-Digital
Conversation between Analogue and Digital System
ADC and DAC Data Converter
Chapter 7 Converters.
ADC and DAC Data Converter
PIC Microcontroller ADC interfacing Prof. Ashvini Kulkarni
Presentation transcript:

Data acquisition and manipulation Chapter Eleven 11.1 - 11.3 Dr. Gheith Abandah

Outline Introduction The main features of a data acquisition system The characteristics of an analog-to-digital converter The characteristics of the 16F873A analog-to-digital converter Summary Dr. Gheith Abandah

Analog vs. Digital Property Analog Digital Representation Continuous voltage or current Binary Number Precision Infinite range of values Limited by the number’s length Resistance to Degradation Weak Tolerant to signal degradation Processing Limited Powerful Storage Impossible Possible Dr. Gheith Abandah

Analog to Digital Conversion Most physical signals are analog. Analog signals are captured by sensors or transducers. Examples: temperature, sound, pressure, … Need to convert to digital signals to facilitate processing by the microcontroller. The device that does this is analog-to-digital converter (ADC). Dr. Gheith Abandah

ADC Types Dual ramp (slow with very high accuracy, for precision measurements) Flash converter (fast, lesser accuracy, for video or radar) Successive approximation (medium speed and accuracy, for general-purpose industrial applications, commonly found in embedded systems) Dr. Gheith Abandah

Conversion characteristic Voltage Range Vr = Vmax – 0 Resolution = Vr / 2n Quantization error = ± Resolution / 2 = Vr / 2n+1 Dr. Gheith Abandah

Conversion Steps Get Sample Start conversion Wait Read digital value (in parallel or serially) Usually need a voltage reference Dr. Gheith Abandah

Elements of a data acquisition system Transducers: physical to electrical Amplify and offset circuits The input voltage should traverse as much of its input range as possible Voltage level shifting may also be required Filter: get rid of unwanted signal components Multiplexer: select one of multiple inputs Sampler: the conversion rate must be at least twice the highest signal frequency (Nyquist sampling criterion) ADC Dr. Gheith Abandah

Elements of a data acquisition system Dr. Gheith Abandah

Sample and hold, and acquisition time Dr. Gheith Abandah

Sample and hold, and acquisition time Dr. Gheith Abandah

Example What should be the acquisition time for a 10-bit ADC? The voltage should rise to ≥ Vs – quantization error = Vs - Vs / 2n+1 ≥ Vs(2047/2048) = 0.9995 Vs VC = Vs {1 − exp(−t/RC)} 0.9995Vs = Vs {1 − exp(−t/RC)} exp(−t/RC) = 1 − 0.9995 −t = RC ln(0.0005) t = 7.6RC Dr. Gheith Abandah

Typical timing requirement of one A-to-D conversion Dr. Gheith Abandah

Data acquisition in the microcontroller environment To operate to a good level of accuracy, an ADC needs a clean power supply and ground and no electromagnetic interference. When an ADC is integrated inside a microcontroller, it will be affected by the noisy internal power sources. So, integrated ADCs are not very accurate, typically 8- or 10-bit. Dr. Gheith Abandah

The PIC 16 Series Device Pins Features 16F873A 16F876A 28 3 parallel ports, 3 counter/timers, 2 capture/compare/PWM, 2 serial, 5 10-bit ADC, 2 comparators 16F874A 16F877A 40 5 parallel ports, 8 10-bit ADC, Dr. Gheith Abandah

The PIC® 16F87XA ADC module Dr. Gheith Abandah

Controlling the ADC The ADC is controlled by two SFRs: ADCON0 (1Fh) The result of the conversion is placed in: ADRESH (1Eh) ADRESL (9Eh) Dr. Gheith Abandah

ADCON0: A/D Control Register 0 (address 1Fh) ADCS1:0: conversion clock select CHS2:0: analog channel select GO/DONE’: conversion status The ADC interrupt flag ADIF and interrupt enable ADIE bits can also be used U: unimplemented ADON: A/D On Dr. Gheith Abandah

A/D Conversion Clock Select bits A full 10-bit conversion takes around 12 TAD cycles TAD should be equal to or just greater than 1.6 μs Minimum 2TAD between two successive conversions Maximum conversion rate is 30 kHz, higher rate by switching to higher TAD after starting the conversion Dr. Gheith Abandah

ADCON1: A/D Control Register 1 (address 9Fh) ADFM: result format select 1 = Right justified 0 = Left justified ADCS2: conversion clock select U: unimplemented PCFG3:0: port configuration control Dr. Gheith Abandah

A/D result format Dr. Gheith Abandah

A/D Port Configuration Control Dr. Gheith Abandah

The analog input model Dr. Gheith Abandah

Calculating acquisition time tac = Amplifier settling time + Hold capacitor charging time + Temperature coefficient tac = 2 μs + 7.6RC for 10-bit accuracy + (Temperature − 25◦C)(0.05 μs/◦C) Dr. Gheith Abandah

Calculating acquisition time - Example RSS = 7kΩ, RIC = 1kΩ (VDD = 5V), RS = 0, Temp = 35 ◦C, TAD = 1.6 μs tac = 2 μs + 7.6(7kΩ + 1kΩ + 0)(120pF) + (35 − 25)(0.05 μs/◦C) = 2 + 7.3 + 0.5 = 9.8 μs Total time = tac + 12TAD = 9.8 + 19.2 μs = 29 μs Dr. Gheith Abandah

A/D Example – Page 1 ... bsf status,rp0 movlw B'00001011' ;set port A bits, movwf trisa ;ADC set as inputs movlw B'10000100' ;bits 0,1,3 analog input movwf adcon1 ;right justify result Dr. Gheith Abandah

A/D Example – Page 2 ... bcf status,rp0 movlw B'01000001' ;set up ADC: clock Fosc/8, ;switch ADC on but not converting, ;channel selection now is irrelevant movwf adcon0 Dr. Gheith Abandah

A/D Example – Page 3 main_loop movlw B'01000001' ;select channel 0 movwf adcon0 call delay20u ;acquisition time bsf adcon0,go ;start conversion btfsc adcon0,go_done ;conversion ended? goto $-1 movf adresh,0 ;read ADC output data high movwf ldr_left_hi bsf status,rp0 movf adresl,0 ;read ADC output data low bcf status,rp0 movwf ldr_left_lo Dr. Gheith Abandah

Summary - 1 Most signals produced by transducers are analog in nature, while all processing done by a microcontroller is digital. Analog signals can be converted to digital form using an analog-to-digital converter (ADC). The ADC generally forms just one part of a larger data acquisition system. Considerable care needs to be taken in applying ADCs and data acquisition systems, using knowledge among other things of timing requirements, signal conditioning, grounding and the use of voltage references. Dr. Gheith Abandah

Summary - 2 The 16F873A has a 10-bit ADC module that contains the features of a data acquisition system. Data values, once acquired, are likely to need further processing, including offsetting, scaling and code conversion. Standard algorithms exist for all of these, and Assembler libraries are published. A simple interface between the analog and digital world is the comparator, which is commonly used to classify an analog signal into one of two states. Dr. Gheith Abandah