EET 2261 Unit 14 INCOMPLETE Analog-to-Digital Conversion (ADC) & Digital-to-Analog Conversion (DAC)  Read.  Homework #13 and Lab #13 due next week. 

Slides:



Advertisements
Similar presentations
Interfacing to the Analog World
Advertisements

Interfacing to the Analog World
Thomas L. Floyd Digital Fundamentals, 9e
EET 252 Digital Systems II Professor Nick Reeder.
EET 1131 Unit 7 Arithmetic Operations and Circuits
Analog-to-Digital Converter (ADC) And
Figure 8–1 A 2-bit asynchronous binary counter
Lecture 17: Analog to Digital Converters Lecturers: Professor John Devlin Mr Robert Ross.
EET 252 Unit 6 Analog-to-Digital Conversion
Reinforced Concrete: A Fundamental Approach, Sixth Edition By Edward G. Nawy Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey.
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
Digital Fundamentals Tenth Edition Floyd Chapter 12.
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.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
PIC16F bit 8-channel Analog-to-Digital Converter.
Unit 4 Sensors and Actuators
Explain the introduction to ADC, ADC characteristics, Programming ADC using PIC18, Introduction to DAC and DAC interfacing with PIC18.
EET 252 Unit 7 Digital-to-Analog Conversion
Figure 2–1 Illustration of a simple binary counting application. Thomas L. Floyd Digital Fundamentals, 9e Copyright ©2006 by Pearson Education, Inc. Upper.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 12 Data Acquisition  Read Bishop, Chapter 8.  Lab #12 and Homework #12 due next week.
Figure 6–1 Logic symbol for a half-adder. Open file F06-01 to verify operation. Thomas L. Floyd Digital Fundamentals, 9e Copyright ©2006 by Pearson Education,
Chapter 1 Number Systems and Codes William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle.
Digital Electronics Professor Nick Reeder
EET 252 Unit 2 Integrated Circuit Technologies
Figure 1–1 Graph of an analog quantity (temperature versus time). Thomas L. Floyd Digital Fundamentals, 9e Copyright ©2006 by Pearson Education, Inc. Upper.
Figure 9–1 The flip-flop as a storage element.
Figure 5–1 An example of AND-OR logic. Open file F05-01 to verify the operation. Thomas L. Floyd Digital Fundamentals, 9e Copyright ©2006 by Pearson Education,
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Digital Fundamentals Floyd Chapter 1 Tenth Edition
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ACOE2551 Microprocessors Data Converters Analog to Digital Converters (ADC) –Convert an analog quantity (voltage, current) into a digital code Digital.
©2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected under all copyright laws as they currently exist.
INTERFACE WITH ANALOG WORLD
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals with PLD Programming.
FIGURE 9-1 General Parallel I/O Example Peter Spasov Microcontroller Technology: The 68HC11, Fourth Edition Copyright ©2002 by Pearson Education, Inc.
Number Systems and Codes
Floyd, Digital Fundamentals, 10 th ed Slide 1 Digital Fundamentals Tenth Edition Floyd © 2008 Pearson Education Chapter 1.
Representing Numerical Data Analog Any signal that varies continuously over time Mechanical Pneumatic Hydraulic Electrical Digital Quantities are represented.
CHAPTER 19 Data Conversion. Objectives Describe and Analyze: Analog vs. Digital Signals Resolution Digital-to-Analog Conversion Analog-to Digital Conversion.
Floyd Digital Fundamentals, 9/e Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Slide 1 Digital Fundamentals.
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights Reserved Floyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Figure A--1 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.
Analog to Digital Conversion - ADC Mark Neil - Microprocessor Course 1 Device Drivers – Measuring Voltages.
Introduction to Digital Electronics Lecture 1 : Background.
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.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
Floyd Digital Fundamentals, 9/e Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Slide 1 Digital Fundamentals.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Lecture Notes / PPT UNIT III
Copyright ©2009 by Pearson Higher Education, Inc. Upper Saddle River, New Jersey All rights reserved. Digital Fundamentals, Tenth Edition Thomas.
Networked Embedded Systems Sachin Katti & Pengyu Zhang EE107 Spring 2016 Lecture 13 Interfacing with the Analog World.
MECH 373 Instrumentation and Measurements
Microprocessors Data Converters Analog to Digital Converters (ADC)
EET 2259 Unit 12 Data Acquisition
Floating Point Math & Representation
Quantization and Encoding
EET 2261 Unit 11 Controlling LCD and Keypad
EET 2259 Unit 12 Data Acquisition
EET 2261 Unit 11 Controlling LCD and Keypad
PIC18F458 Analog-to-Digital
EET 2261 Unit 14 INCOMPLETE Analog-to-Digital Conversion (ADC) & Digital-to-Analog Conversion (DAC) Read. Homework #13 and Lab #13 due next week. Quiz.
Conversation between Analogue and Digital System
William Stallings Computer Organization and Architecture 10th Edition
Computer Organization and Architecture Designing for Performance
PIC Analog Input Tom Igoe, NYU-ITP
Presentation transcript:

EET 2261 Unit 14 INCOMPLETE Analog-to-Digital Conversion (ADC) & Digital-to-Analog Conversion (DAC)  Read.  Homework #13 and Lab #13 due next week.  Quiz next week.

Most physical quantities (temperature, pressure, light intensity, etc.) are analog quantities. Transducers are devices that convert one of these physical quantities to an analog voltage or current. Example, a temperature sensor might produce a voltage in mV that is proportional to the temperature in degrees Fahrenheit. Analog Quantities

Before a microprocessor can work on analog information, we must first use an analog-to- digital converter (ADC) to transform the analog values into digital binary values. Conversely, we use a digital-to-analog converter (DAC) to transform digital values from the microprocessor into analog values that can be used to control analog devices. See Chapter 12 of Floyd’s Digital Electronics for details on ADCs and DACs. Interfacing to the Analog World

A Typical Application Transducer Physical variable ADCDAC Actuator Micro- processor Control physical variable Analog input (voltage or current) Digital inputs Digital outputs Analog output (voltage or current)

The ADC periodically samples the analog signal, and converts each sampled value of the analog signal into a binary code. The more bits that are used in this code, the more accurate is the representation of the original signal. The following slides (from Floyd’s Chapter 12) show an example of how using 2 bits results in much less accuracy than using 4 bits. Number of Bits and Accuracy

Copyright ©2009 by Pearson Higher Education, Inc. Upper Saddle River, New Jersey All rights reserved. Digital Fundamentals, Tenth Edition Thomas L. Floyd Figure 12.8 Light gray = original waveform. Blue = Reconstructed waveform using four quantization levels (2 bits).

Copyright ©2009 by Pearson Higher Education, Inc. Upper Saddle River, New Jersey All rights reserved. Digital Fundamentals, Tenth Edition Thomas L. Floyd Figure Light gray = original waveform. Blue = Reconstructed waveform using sixteen quantization levels (4 bits).

Several common ways of specifying an ADC’s resolution: Number of bits, n Number of output codes, = 2 n, or number of steps in the output, = 2 n − 1 Percentage resolution, = 1 / (2 n − 1), expressed as a percentage Step size, = V ref / 2 n Resolution

Resolution: Examples Formula4-bit ADC10-bit ADC Number of bits n 4 Number of output codes 2n2n 16 Number of steps in the output 2 n −1 15 Percentage resolution 1 / (2 n −1) 6.67% Step size (assuming 5 V reference voltage) V ref / 2 n mV

Many analog-to-digital converter chips are available. Example: the ADC0804 is a popular 8-bit ADC chip.ADC0804 Our PIC chip has a built-in 10-bit ADC. ADC Hardware

Seven of the PIC chip’s pins (labeled AN0 through AN7) can be configured as analog inputs to the chip’s internal ADC. The PIC Chip’s Analog Inputs

How do we tell the PIC chip whether we want to use these pins as analog inputs or as digital I/O? Example: How do we tell it whether we want pin 8 to act as AN5 or as bit 0 of PORT E? Configuring the Analog Inputs

On the LAB-X1 board, three of these pins (AN0, AN1, AN3) are permanently connected to the wipers on three potentiometers. Analog Inputs on the LAB-X1

ADCIN command PAUSEUS command / operator // operator New PICBASIC Commands & Operators in Lab #4

Tells the PIC chip to perform an analog-to- digital conversion using its built-in A/D converter, and then saves the result of this conversion. Example: ADCIN 0 result performs an A/D conversion on the voltage present at analog input 0, and stores the result in the variable named result. Don’t confuse the ADCIN command with ADCON0 and ADCON1, which are special function registers on the PIC chip. ADCIN (p. 45 in PICBASIC manual)

Recall that the PAUSE command inserts a time delay into your program. This delay is measured in milliseconds. Example: PAUSE 500 causes a 500 ms delay. The PAUSEUS command is very similar, but the delay is measured in microseconds instead of milliseconds. Example: PAUSEUS 500 causes a 500  s delay. PAUSEUS (p. 113 in PICBASIC manual)

Recall the difference between integers (such as 2 or 47 or 365) and floating-point numbers (such as 3.14 or 1.5 or 16.97). PICBASIC can only deal with integers, not floating-point numbers. All math operations give integer results. This requires us to play some tricks if we need to work with floating-point numbers. Integer Math

We know that 7÷2 = 3.5 Recall that another way to say this is that 7÷2 = 3 with a remainder of 1. In this example, 3 is called the quotient and 1 is called the remainder. Another example: If you take 20÷8, what is the quotient and what is the remainder? Quotient and Remainder

The / operator returns the quotient part of a division. Example: 7 / 2 in a PICBASIC program will return a result of 3. / Operator (p. 35 in PICBASIC manual)

The // operator returns the remainder part of a division (sometimes called the modulus). Example: 7 // 2 in a PICBASIC program will return a result of 1. By using both / and //, we can keep track of both the quotient and the remainder part of a division. // Operator (p. 35 in PICBASIC manual)

Look at program called A-D Conversion3.pbp Recall that for a 10-bit A/D conversion using a reference voltage of 5 V, the step voltage is about 4.9 mV. So to find the voltage (in mV) corresponding to an A/D result, we need to multiply by 4.9. But since PICBASIC can only handle integers, it can’t handle 4.9. So instead, we multiply by 49 and then divide by 10. Integer Math in Lab #4

Now that we have the voltage in mV, we want to print it on the LCD in V. Example: if the voltage = 2141 mV, then we want to print V. To get the part before the decimal point, take 2141 / (This returns an answer of 2.) To get the part after the decimal point, take 2141 // (This returns an answer of 141.) Then print those two answers, separated by a decimal point: Integer Math in Lab #4 (Continued)

For another use of these integer math tricks, see these documents in the “Documents PIC” folder on the R: shared drive: “Convert Celsius to Fahrenheit using Integer Math.docx” “Convert Fahrenheit to Celsius using Integer Math.docx” Another Application