ADC and DAC Data Converter

Slides:



Advertisements
Similar presentations
Analog to digital converter
Advertisements

Electronics Design Lab TUTORIAL PIC Microcontrollers Francesco Tenore 2/10/2006.
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.
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
Chapter 12 Data Converters.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2014 Lecture 32: PIC example programs: Analog to digital conversion.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
5-1 Analogue Input/Output Many sensors/transducers produce voltages representing physical data.  To process transducer data in a computer requires conversion.
PIC16F bit 8-channel Analog-to-Digital Converter.
V 0.21 Digital Signal Processing Vref 0 Time Analog signal (time varying, continuous) Analog-to- Digital Converter (ADC) 0x030, 0x4A, 0x12, 0xAF, etc.
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.
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.
Analog to Digital Converters (ADC)
Interface & Instrumentation. ADC Sensor Interfacing Gas Sensor Temperature Sensor Humidity Sensor Sonar Sensor.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Analogue Input/Output
Railway Foundation Electronic, Electrical and Processor Engineering.
Railway Foundation Electronic, Electrical and Processor Engineering.
Smart-grid Interface with Photovoltaic Installation – Phase 2 PP-01 Team members: Matt Koresh Ivan Mills Matt Martin Advisor: Dr. Aliprantis.
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Digital to Analogue Converter
Data Acquisition Systems
ELN5622 Embedded Systems Class 7 Spring, 2003 Aaron Itskovich
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
Chapter 11 Data Acquisition and Manipulation The aims of this chapter are to introduce: the main features of a data acquisition system; the characteristics.
ECE 2799 Electrical and Computer Engineering Design ANALOG to DIGITAL CONVERSION Prof. Bitar Last Update:
Analog to Digital Converter (ADC)
Embedded Systems Design 1 Lecture Set C Interfacing the MCS-51 to: –D/A Converter –A/D Converter.
Microcontrollers session. What is Microcontroller? Microcontroller is composed of microprocessor,ram, flash memory,EEPROM and some modules like timers,
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.
ECET 340 Entire Course (All ilabs and Homework) For more classes visit ECET 340 Week 1 HomeWork 1 ECET 340 Week 1 iLab 1 ECET 340.
Criteria for choosing a microcontroller A microcontroller must meet the task at hand efficiency and cost effectively. Speed. What is highest speed of.
By: Shivanshi pandya(30) Ayushi chourasia (3) Pranavi chhikniwala(6)
CEng3361 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2011 Recitation 06.
Microcontrollers Part II BME 201. Overview ADC Serial.
 Mini-Computer ◦ Microprocessor  The Brains  Arithmetic Logic Unit (ALU)  Control Unit  Program/ Data Storage  Peripherals (Input/Output)  Low-Cost.
Digital to analog converter [DAC]
MECH 373 Instrumentation and Measurements
Data Acquisition ET 228 Chapter
What is a DAC? A digital to analog converter (DAC) converts a digital signal to an analog voltage or current output DAC.
Analog-Digital Conversion
EI205 Lecture 13 Dianguang Ma Fall 2008.
Chapter 10 PIC18 Serial Port Programming in Assembly
ADC,DAC and sensor interface
Interfacing of LCD with µP
Principles & Applications
ADC, DAC, and Sensor Interfacing
ADC, DAC, and Sensor Interfacing
EE Embedded Systems Fall 2015
ECET 340 Competitive Success/snaptutorial.com
ECET 340 Education for Service-- snaptutorial.com.
ECET 340 Teaching Effectively-- snaptutorial.com.
Engineering 4862 Microprocessors Lecture 25
ADC, DAC, and Sensor Interfacing
ECE 354 Computer Systems Lab II
ADC, DAC, and Sensor Interfacing
Lesson 8: Analog Signal Conversion
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
ADC and DAC Programming in AVR
ADC and Sensor Programming
EECE.3170 Microprocessor Systems Design I
PIC Serial Port Interfacing
ADC and DAC Data Converter
PIC Microcontroller ADC interfacing Prof. Ashvini Kulkarni
PIC Serial Port Interfacing
Presentation transcript:

ADC and DAC Data Converter Explain the introduction to ADC, ADC characteristics, Programming ADC using PIC18, Introduction to DAC and DAC interfacing with PIC18. ADC and DAC Data Converter

Objectives Discuss the ADC of the PIC18 Explain the process of data acquisition using ADC Program the PIC18’s ADC in assembly Describe the basic operation of DAC Interface a DAC chip to the PIC18

Introduction to ADC Digital Computer: Binary (discrete) values Physical World: Analog (continuous) values Example: Temperature, Humidity, Pressure Output: Voltage or Current Microcontroller? -----> Digital Therefore, ADC is needed to translate (convert) the analog signals to digital numbers

Introduction to ADC (Cont’d) Microcontroller Connection to Sensor via ADC

ADC Resolution n-bit No. of steps Step size (mV) 8 28 = 256 5/256 = 19.53 10 210 = 1024 5/1024 = 4.88 12 212 = 4096 5/4096 = 1.2 Assuming VREF = 5V * Step Size (Resolution): is the smallest change that can be discerned by an ADC

ADC Reference Voltage (Vref) Vref: Input voltage used for the reference voltage The voltage connected to this pin , with the resolution of the ADC chip, dictate the step size Example: If we need the analog input to be 0 to 4 volts, Vref is connected to 4 volts Digital data output: 8-bit (D0-D7), 10-bit (D0-D9)

ADC Reference Voltage (Vref) (Cont’d) Vref (V) Vin (V) Step size (mV) 5.00 0 to 5 5/1024 = 4.88 4.096 0 to 4.096 4.096/1024 = 4 3.0 0 to 3 3/1024 = 2.93 2.56 0 to 2.56 2.56/1024 = 2.5 2.048 0 to 2.048 2.048/1024 = 2 Vref Relation to Vin Range for an 10-bit ADC

ADC Digital Data Output Dout = Vin / Step Size Analog Input Voltage Digital data output (in decimal): 8-bit (D0-D7)= 256 10-bit (D0-D9) = 1024 Example: Vref = 2.56, Vin = 1.7V. Calculate the Do-D9 output? Solution: Step Size = 2.56/1024 = 2.5mV Dout = 1.7/2.5mV = 680 (Decimal) D0-D9 = 1010101000

Parallel versus Serial ADC

PIC18F4580 ADC Features

PIC18F4580 ADC Features (cont’d) It has 11 analog input channels (AN0 – AN10) 10-bit ADC Converted values are stored in ADRESH:ADRESL registers

ADC: Important Registers A/D Control Register 0 (ADCON0) Controls the operation of the A/D module A/D Control Register 1 (ADCON1) Configures the functions of the port pins A/D Control Register 2 (ADCON2) Configures the A/D clock source, programmed acquisition time and justification

A/D Control Register 0 (ADCON0) Example: ADCON0 = 00101001 Different from the Book!

A/D Control Register 1 (ADCON1) * Different from the Book!

ADC PCFGs Example: ADCON1 = 00001110 * Different from the Book!

A/D Control Register 2 (ADCON2) Example: ADCON2 = 10000110 * Different from the Book!

ADFM Bit and ADRESx Registers ADC ADFM Bit ADFM Bit and ADRESx Registers

Example 1 For a PIC18-based system, we have Vref = Vdd = 5V. Find a) The step size and b) The ADCON1 value if we need 3 channels. The step size = 5/1024 = 4,8mV ADCON1 = 00001100

ADC Conversion Time Define in term of Tad (Conversion time per bit) To calculate: FOSC/2, FOSC/4, FOSC/8, FOSC/16, FOSC/32 or FOSC/64

Steps in Programming the ADC using Pooling TURN ON the ADC module (BSF ADCON0, ADON) Make the ADC channel pin as input pin Select voltage reference and ADC channel Select the conversion speed Wait for the required acquisition time Activate the start conversion bit of GO/DONE Wait for the conversion to be completed by pooling the end-of-conversion GO/DONE bit After the GO/DONE bit has gone LOW, read the ADRESL and ADRESH register

Example 2 OV ER CALL DELAY ORG 0000H BSF ADCON0, GO CLRF TRISC BACK BTFS ADCON0, GONE BRA BACK MOVFF ADRESL, PORTC MOVFF ADRESH, PORTD CALL QSEC_DELAY BRA OVER END ORG 0000H CLRF TRISC CLRF TRISD BSF TRISA, 0 MOVLW 0x00 MOVWF ADCON0 MOVLW 0x0E MOVWF ADCON1 MOVLW 0xBE MOVWF ADCON2

Programming ADC using Interrupts Flag Bit Register Enable Bit ADIF (ADC) ADIF PIR1 ADIE PIE1 ADC Interrupt Flag Bits and Associated Registers * Please see Program 13-2 page 514

Introduction to DAC Covert digital pulses to analog pulses DAC0808 chip: Use R/2R method, 8-bit DAC Block Diagram

DAC Application

Iref = Generally set to 2.0mA DAC 0808 The digital inputs are converted to current (Iout) Connecting a resistor to the Iout pin, we convert the result to voltage This will course inaccuracy because the Resistance will affect the reading Iout = Iref (D7/2 + D6/4 + D5/8 + D4/16 + D3/32 + D2/64 + D1/128 + D0/256) Iref = Generally set to 2.0mA

PIC18 Connection to DAC0808 and Op-Amp Example: Binary input: 10011001 Iout = 2mA (153/256) = 1.195mA and Vout = 1.195mA x 5K = 5.975V

ADC Sensor Interfacing Gas Sensor Sonar Sensor Humidity Sensor Temperature Sensor

ADC Sensor Interfacing (Cont’d) Characteristic: Precision integrated-circuit Output voltage is linearly proportional to the Celcius Requires no external calibration (Internally calibration) Output: 10mV for each degree

ADC Sensor Interfacing (Cont’d) 10mV = 1 degree (Minimum) 20mV = 2 degree 30mV = 3 degree . 1000mV = 100 degree (Maximum) How to set Vref?? 5V Step Size = 4.8mV Vin (max) = 5V Which one suitable? Vref = ??? 1.024 Step Size = 1mV Vin (max) = 1.024V

ADC Sensor Interfacing (Cont’d) To overcome any fluctuations in power supply. * Please see Program 13-4 page 524

“Things are only impossible until they're not” End of Chapter