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

Slides:



Advertisements
Similar presentations
Analog to digital converter
Advertisements

Electronics Design Lab TUTORIAL PIC Microcontrollers Francesco Tenore 2/10/2006.
Mark Neil - Microprocessor Course 1 Device Drivers – Digital Voltmeter.
Analog-to-Digital Converter (ADC) And
EET 2261 Unit 14 INCOMPLETE Analog-to-Digital Conversion (ADC) & Digital-to-Analog Conversion (DAC)  Read.  Homework #13 and Lab #13 due next week. 
Lecture 17: Analog to Digital Converters Lecturers: Professor John Devlin Mr Robert Ross.
Sistemi Elettronici Programmabili13-1 MULTI OSC + CLOCK FILTER LVD POWER SUPPLY CONTROL 8 BIT CORE ALU PROGRAM MEMORY RAM I2CI2C PORT A SPI PORT B 16-BIT.
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.
Digital to Analogue Conversion
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.
Module 4: Analog programming blocks. Module Objectives Analyze a control task that uses analog inputs. Connect a potentiometer to LOGO! controller and.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Lecture 9: D/A and A/D Converters
ECEN 301Discussion #24 – DAC1 Conversion Luke 22:32 32 But I have prayed for thee, that thy faith fail not: and when thou art converted, strengthen thy.
PIC16F bit 8-channel Analog-to-Digital Converter.
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
Interfacing with the Analog World Wen-Hung Liao, Ph.D.
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.
Introduction to Data Conversion
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
Digital to Analog Converters
Digital-to-Analog & Analog-to- Digital Conversion Anuroop Gaddam.
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Module 4: Analog programming blocks. Module Objectives Analyze a control task that uses analog inputs. Connect a potentiometer to LOGO! controller and.
Digital to Analogue Converter
Data Acquisition Systems
Instrumentation (AMME2700) 1 Instrumentation Dr. Xiaofeng Wu.
Analog-to-Digital and Digital-to-Analog Conversion
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
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.
Analog to Digital Conversion - ADC Mark Neil - Microprocessor Course 1 Device Drivers – Measuring Voltages.
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.
Lecture Notes / PPT UNIT III
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.
Chapter 7 ADC, DAC, and Sensor Interfacing 1. Microcontroller Connection to Sensor via ADC 2.
 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
Analog-Digital Conversion
ADC,DAC and sensor interface
EECE.3170 Microprocessor Systems Design I
ADC, DAC, and Sensor Interfacing
EE Embedded Systems Fall 2015
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.
ADC and DAC Programming in AVR
ADC and DAC Data Converter
Device Drivers – Digital Voltmeter
PIC Analog Input Tom Igoe, NYU-ITP
ADC and DAC Data Converter
PIC Microcontroller ADC interfacing Prof. Ashvini Kulkarni
Presentation transcript:

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

 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

 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

Microcontroller Connection to Sensor via ADC

n-bitNo. of stepsStep size (mV) 82 8 = 2565/256 = = 10245/1024 = = 40965/4096 = 1.2 Assuming V REF = 5V * Step Size (Resolution): is the smallest change that can be discerned by an ADC

 V ref : 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, V ref is connected to 4 volts  Digital data output: 8-bit (D0-D7), 10-bit (D0- D9)

V ref (V)V in (V)Step size (mV) to 55/1024 = to /1024 = to 33/1024 = to /1024 = to /1024 = 2 V ref Relation to Vin Range for an 10-bit ADC

D out = V in / Step Size Digital data output (in decimal): 8-bit (D0-D7)= bit (D0-D9) = 1024 Analog Input Voltage Example: V ref = 2.56, V in = 1.7V. Calculate the Do-D9 output? Solution: Step Size = 2.56/1024 = 2.5mV Dout = 1.7/2.5mV = 680 (Decimal) D0-D9 =

 It has 11 analog input channels (AN0 – AN10)  10-bit ADC  Converted values are stored in ADRESH:ADRESL 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

Different from the Book! Example: ADCON0 =

* Different from the Book!

Example: ADCON1 = * Different from the Book!

Example: ADCON2 =

ADFM Bit and ADRESx Registers

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

 Define in term of Tad (Conversion time per bit)  To calculate: F OSC /2, F OSC /4, F OSC /8, F OSC /16, F OSC /32 or F OSC /64

 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

ORG0000H CLRFTRISC CLRF TRISD BSFTRISA, 0 MOVLW0x00 MOVWFADCON0 MOVLW0x0E MOVWFADCON1 MOVLW0xBE MOVWFADCON2 OV ERCALLDELAY BSFADCON0, GO BACKBTFSADCON0, GONE BRABACK MOVFFADRESL, PORTC MOVFFADRESH, PORTD CALLQSEC_DELAY BRAOVER END

InterruptFlag BitRegisterEnable BitRegister ADIF (ADC)ADIFPIR1ADIEPIE1 ADC Interrupt Flag Bits and Associated Registers * Please see Program 13-2 page 514

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

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

Example: Binary input: I out = 2mA (153/256) = 1.195mA and V out = 1.195mA x 5K = 5.975V

Gas Sensor Temperature Sensor Humidity Sensor Sonar Sensor

Characteristic: 1)Precision integrated-circuit 2)Output voltage is linearly proportional to the Celcius 3)Requires no external calibration (Internally calibration) 4)Output: 10mV for each degree

10mV = 1 degree (Minimum) 20mV = 2 degree 30mV = 3 degree. 1000mV = 100 degree (Maximum) Vr ef = ??? 5V Step Size = 4.8mV Step Size = 1mV Vin (max) = 5V Vin (max) = 1.024V Which one suitable? How to set V ref ??

To overcome any fluctuations in power supply. * Please see Program 13-4 page 524

“Things are only impossible until they're not”