Chapter 11 Data Acquisition and Manipulation The aims of this chapter are to introduce: the main features of a data acquisition system; the characteristics.

Slides:



Advertisements
Similar presentations
Analog to digital converter
Advertisements

Interfacing to the Analog World
Interfacing to the Analog World
Analog-to-Digital Converter (ADC) And
Analogue to Digital Conversion By Cap’n Tim Johnson, PE Prepared 11/12/2013.
Lecture 17: Analog to Digital Converters Lecturers: Professor John Devlin Mr Robert Ross.
Sensors Interfacing.
Data Acquisition ET 228 Chapter
Digital to Analogue Conversion Chapter 13. Why is conversion needed? Most signals in the world are analogue. Microprocessors and most computers computers.
EET 252 Unit 6 Analog-to-Digital Conversion
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
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.
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
5-1 Analogue Input/Output Many sensors/transducers produce voltages representing physical data.  To process transducer data in a computer requires conversion.
Slides created by: Professor Ian G. Harris Inputs and Outputs PIC Vcc RA3 RA4 RA5  Make an LED toggle state when button is pressed  Need to read RA3,
Data acquisition and manipulation
Explain the introduction to ADC, ADC characteristics, Programming ADC using PIC18, Introduction to DAC and DAC interfacing with PIC18.
Data Acquisition Systems ACES Presentation Brad Ellison March 11, 2003.
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.
Storey: Electrical & Electronic Systems © Pearson Education Limited 2004 OHT 26.1 Data Acquisition and Conversion  Introduction  Sampling  Signal Reconstruction.
Analogue to Digital Conversion
Introduction to Data Conversion
EET260: A/D and D/A converters
H. Huang Transparency No.11-1 The 68HC11 Microcontroller Chapter 11: 68HC11 Analog to Digital Converter The 68HC11 Microcontroller Han-Way Huang Minnesota.
Introduction to Analog-to-Digital Converters
Analogue Input/Output
Railway Foundation Electronic, Electrical and Processor Engineering.
PH4705/ET4305: A/D: Analogue to Digital Conversion
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
EKT314/4 Electronic Instrumentation
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
DATA ACQUISITION Today’s Topics Define DAQ and DAQ systems Signals (digital and analogue types) Transducers Signal Conditioning - Importance of grounding.
Digital to Analogue Converter
Data Acquisition Systems
SIGMA-DELTA ADC SD16_A Sigma-Delta ADC Shruthi Sujendra.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
Chapter 7 Larger Systems and the PIC 16F873A The aims of this chapter are to introduce: The architecture of the 16F873A microcontroller; The 16F873A memory.
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.
Digital Control CSE 421.
Chapter 12 Some PIC Microcontroller Advances The aims of this chapter are to introduce: To introduce in overview two microcontrollers which show some enhanced.
Chapter 3 Parallel Ports, Power Supply and the Clock Oscillator The aims of this chapter are to introduce: Why we need parallel input/output; How simple.
Digital-to-Analog Analog-to-Digital Week 10. Data Handling Systems  Both data about the physical world and control signals sent to interact with the.
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.
Components of a typical full-featured microcontroller.
 Sensor (S)–converts arbitary physical quantity into electric signal  Adaptor (A)–provides signal amplification to a required level; expands a dynamic.
5-2-3 Analogue to Digital Converters (ADC). Analogue to Digital Conversion The process is now the opposite of that studied in Topic Now we wish.
Lecture Notes / PPT UNIT III
Basics of Bypass Capacitor, Its Functions and Applications.
CEng3361 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2011 Recitation 06.
MECH 373 Instrumentation and Measurements
SIGNAL CONDITIONING Signal conditioning is stage of instrumentation system used for modifying the transduced signal into a usable format for the final.
Introduction to Discrete-Time Control Systems fall
For further information
EE Embedded Systems Fall 2015
Tiny Computers, Hidden Control
Digital Acquisition of Analog Signals – A Practical Guide
ECE 354 Computer Systems Lab II
Lesson 8: Analog Signal Conversion
PIC18F458 Analog-to-Digital
Introducing the PIC Mid-Range Family and the 16F84A
ADC and DAC Data Converter
MSP432™ MCUs Training Part 6: Analog Peripherals
ADC and DAC Data Converter
Presentation transcript:

Chapter 11 Data Acquisition and Manipulation The aims of this chapter are to introduce: 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; how the 16F873A analog-to-digital converter can be applied; some simple data manipulation techniques; the use of comparators and the 16F873A comparator capability. Instructors using Designing Embedded Systems with PIC Microcontrollers are welcome to use or change these slides as they see fit. Feedback, to is The copyright to all diagrams is held by Microchip Technology, or T. Wilmshurst, unless otherwise stated Designing Embedded Systems with PIC Microcontrollers: Principles and Applications. 2 nd Edition. Tim Wilmshurst

A Data Acquisition System Transducer Generates signal Filter Removes unwanted signal components, usually foranti- aliasing purposes Amplify and Offset Amplifies signal and adds DC offset, to match ADC input range. Multiplexer Selects which input channel is connected to its output ADC Converts its AnalogInput to a Digital Output Sample & Hold Samples its input signal, and holds that voltage as a steady value at its output Voltage Reference Digital Output CPU Control Sample Input Select Start Conversion Output Result Conversion Complete When converting an analog signal to digital form, it is usually not enough just to find a suitable ADC (Analog to Digital Converter). Usually, more than one input is required and the signal needs processing before it can be converted. In most cases, therefore, it is necessary to build up a complete data acquisition system. The elements of such a system are shown below. This shows, in block diagram form, a system with multiple inputs, amplification, filtering, source selection, sample and hold, and finally the ADC itself. The different elements are outlined in the sections which follow.

The ADC accepts an input voltage that is infinitely variable, and converts this to one of a fixed number of output values. An example ADC conversion characteristic is shown, where the input voltage is represented on the horizontal axis, and digital output on the vertical. For an n-bit ADC, the maximum output value will be (2 n – 1). For example, for an 8-bit ADC, the maximum value will be (2 8 – 1), or (256 – 1), i.e. 255 decimal or binary. The Analog to Digital Converter (ADC) V max Digital Output Analogue Input 0 (2 - 1) n (2 - 2) n 0 Input Range

The Sample and Hold Circuit Because most ADCs work better converting a stationary voltage, a Sample and Hold circuit is commonly used. In this type of circuit a capacitor is charged from a source which inevitably has some resistance. Further resistance comes from internal resistance of the solid-state switch used in the S&H, and/or in the multiplexer. Therefore the capacitor takes finite time to charge, with a charging characteristic as shown. A Simple Form of Sample and Hold Circuit Charging Characteristic of Sample & Hold

Typical Timing Requirement of one A to D Conversion Configure & enable ADC SelectMultiplexer input Delay for signal acquisition Start Conversion Delay for conversion to complete Read Data “Sample” Input Signal “Hold” Input Signal These stages merge ifmultiplexerforms part of S&H

Integrating an ADC onto the Microcontroller It is now possible to integrate much of a data acquisition system onto a single chip, and/or into a microcontroller. But note - ADCs don’t easily integrate onto microcontrollers, mainly because there is the risk of massive digital interference, both radiated, and through shared earth and supply lines. A partial solution is to separate the ADC earth and supply from that of the microcontroller, and to minimise interference during conversion - by synchronising conversion to internal clock transitions, and minimising all other switching at this time. Ultimately, you will only find ADCs of limited resolution (generally 8- or 10-bit) integrated onto a microcontroller.

The 16F873A ADC The 16F873A has a versatile 10-bit ADC module, shown below. This provides a subset of the overall data acquisition system. The particular ADC design used incorporates the function of Sample and Hold. The input multiplexer, seen to the right, has 5 channels for the 16F873A. The inputs are shared with five of the six Port A bits. Port A bit four is not used, as it already shares with the Timer 0 input. Port bits can be allocated in a flexible way to analog or digital input. An external voltage reference can be used for applications requiring reasonable accuracy. Provision of the negative connection means that the reference does not have to be referred to system ground, or it can at least be connected to a “clean” ground. For lower cost, lower accuracy conversions, the power supply voltage can be used as reference. The input range is equal to whatever voltage reference is chosen.

The ADCON0 Register The ADC is controlled by two SFRs, ADCON0 and ADCON1. The result of the conversion is placed in two further SFRs, ADRESH and ADRESL. These four registers can all be seen in the SFR Memory Map. Any bits used for analog input must also be set as inputs in TRISA.

The ADCON1 Register

The ADC Clock Operation of the ADC is governed by the ADC clock, which has a period T AD. A full 10-bit conversion takes around 12 T AD cycles, depending slightly on which clock source is chosen. The user can select the clock frequency from a number of options. Although one generally wants a conversion to take place as quickly as possible, there is an upper limit to the clock frequency, specified as a period of 1.6  s. At the other extreme, if conversion is too slow, charge leaks from the storage capacitance, and the conversion becomes inaccurate. Best practice is therefore to set the ADC clock frequency such that it has a period equal to or just more than 1.6  s. Selection of the ADC clock source is controlled by bits ADCS2 in ADCON1, and ADCS1 and ADCS0 in ADCON0. The RC oscillator has a typical period of 4  s, but may range from 2 to 6  s. If the system clock is fast, it is usually appropriate to use it to derive the clock source. If the system clock is slow however, it is better to use the RC oscillator.

Formatting the Result The 10-bit conversion result is stored in registers ADRESH and ADRESL. What are the advantages of the two possible result formats?

Analogue Input Model The acquisition time, i.e. the time for the hold capacitor to charge to acceptable final value, called tac, is given by: t ac = Amplifier Settling Time + Hold Capacitor Charging Time + Temperature Coefficient The Amplifier settling time is specified as 2  s. The Temperature Coefficient applies only when temperatures is above 25 o C, and is specified as: Temperature Coefficient = (Temperature - 25 o C)(0.05  s/ o C) It can be seen that this creates a time delay of only 0.5  s for every 10 o C above 25 o, so its impact in most cases is slight.

Example If a signal source has a resistance of 1k, the microcontroller is supplied from 5V, and 10-bit accuracy is required, what will the acquisition time be? If the main clock oscillator is 4MHz, propose a value for T AD, and hence for the relevant ADCONX bits. Estimate the overall time to convert one value.

bsfstatus,rp0 movlwB' ‘ ;set port A bits according to their function, movwftrisa ;ADC channels set as inputs movlwB' ' ;select port A bits 0,1,3 for analog input movwfadcon1 ;right justify result... bcfstatus,rp0 movlwB' ‘ ;set up ADC: clock Fosc/8, switch ADC on but not ;converting, movwfadcon0 ;input channel selection currently irrelevant... ;read and store ldrs main_loop movlw B' ' ;select channel 0 as input (left front ldr) movwfadcon0 call delay20u;acquisition time bsfadcon0,go;start conversion btfscadcon0,go_done ;wait for conversion to complete goto$-1 movfadresh,0;read and store ADC output data, high byte movwfldr_left_hi bsfstatus,rp0 movfadresl,0 ;read and store ADC output data, low byte bcfstatus,rp0 movwfldr_left_lo … Some Sample Code Configure & enable ADC Select MUX input Delay for signal acquisition Start Conversion Delay for conversion to complete Read Data

End of Lecture Note One of the simplest interfaces between the analog and digital world is the comparator. This acts like a 1-bit ADC. It is usually used to compare an input voltage with a reference. If the input is higher than the reference, the output goes high, if it is lower, the output goes low, as seen below. The 16F87XA has two comparators, which share inputs with the ADC inputs. Comparator 1 has inputs on AN0 and AN3, and comparator 2 on AN1 and AN2. They are controlled by the CMCON register. The Comparator Module