SlideShare ist ein Scribd-Unternehmen logo
1 von 41
INTERFACING OF ADC, DAC &
SENSOR WITH PIC18F
MICROCONTROLLER
Basics of A/D Conversion
•Can convert only electrical voltages to digital
values.
• A transducer is needed to convert a non-electric
quantity into an electrical voltage.
• Different names of transducers are used for
different physical quantities.
• A data acquisition system is used to referred to
those systems that perform A/D conversions.
Characteristics of ADC
 Resolution
 Conversion time
 Vref
 Digital data output
Dout = Vin/step size
Parallel VS Serial ADC
 Parallel in serial ou
shift register
 Speed is slow
•8 bit & 16 bit o/p line
•Speed is fast
The PIC18f A/D Converter
-The PIC18 has a 10-bit A/D converter.
-The number of analog inputs varies
among difference PIC18 devices.
-The contents of these registers vary
with the PIC18 members.
-Early PIC18 (PIC18FXX2) members
have only ADCON0 and ADCON1
registers.
A/D Registers
-The A/D converter has the following
registers:
•A/D Result High Register (ADRESH)
•A/D Result Low Register (ADRESL)
•A/D Control Register 0 (ADCON0)
•A/D Control Register 1 (ADCON1)
Three control registers are
used to:
•Set up the I/O pins for analog signals from ports A, B,
and E that are used as inputs for A/D conversion.RA5
•Select a channel: AN4
•Set up pins RA2 and RA3 to connect external VREF +
and VREF - if specified in the control register ADCON1.
•Select an oscillator frequency divider through the
control register ADCON1.
•Select an acquisition time through the control register
ADCON2.
A/D Control Register 0 (ADCON0)
• Primary function of the ADCON0
register:
– Select a channel for input analog
signal
– Start a conversion
– Indicate the end of the conversion
• Bit2 is set to start the
conversion, and at the end of
the conversion this bit is reset.
A/D Control Register 1
(ADCON1)
 ADCON1 is primarily used to set up the
I/O pins either for analog signal or for
digital signals and select VREF voltages.
 An input to be converted must be an
analog input.
 The ADFM bit of the ADCON1 is used for
making it Right-justified or Left-justified
because we need 10 out of 16 bits.
ADFM bit
 Alignment to the left – the eight MSB bits
are stored in the ADRESH, and the two LSB
bits are stored in ADRESL. In this case, the
remaining six bits appear as - "0".
• Alignment to the right – the eight LSB bits are
stored in ADRESL, and two MSB bits are stored in
the ADRESH. In this case six highest bits appear
as - "0".
A/D Acquisition Requirements
 The A/D converter has a sample-and-hold
circuit for analog input.
 The sample-and-hold circuit keeps the
voltage stable when it is converted.
 The sample-and-hold circuit is shown in
Figure.
Automatic Acquisition Time
 For earlier PIC18 members, when the
GO/DONE bit is set, sampling is stopped
and conversion begins.
 The user is responsible for making sure
enough acquisition time is provided.
 For newer PIC18 members, the A/D
module will continue to sample after the
GO/DONE bit is set for the selected
acquisition time.
 The automatic acquisition time makes
A/D programming a little easier.
Selecting the A/D Conversion
Clock
 The per bit A/D conversion time is defined
as TAD.
 Each 10-bit A/D conversion takes 12 TAD
to complete.
 For some devices, the options for TAD
are defined in ADCON0. For others, the
options for TAD are defined in ADCON2.
 The length of TAD must be at least 1.6 .
EXAMPLE
Procedure for Performing A/D
Conversion
 Configure the A/D module
1. Configure analog pins, reference voltages
2. Select A/D input channel
3. Select A/D acquisition time (if available)
4. Select A/D conversion clock
5. Enable A/D module
 Configure A/D interrupt
1. Clear ADIF flag
2. Set ADIE bit (if desired)
3. Set GIE bit (if desired)
Procedure contd…..
 Wait for the desired acquisition time
(if required)
 Start conversion by setting the
GO/DONE bit
 Wait for A/D conversion to complete
 Read the A/D result registers; clear
the ADIF flag
 For next conversion, go to step 1 or
step 2.
Programming PIC18F458 ADC
Programming using interrupt
Digital to Analog (D/A, DAC, or
D-to-A) Conversion
 Converting discrete signals into
discrete analog values that represent
the magnitude of the input signal
compared to a standard or reference
voltage
◦ The output of the DAC is discrete analog
steps.
◦ By increasing the resolution (number of
bits), the step size is reduced, and the
output approximates a continuous analog
signal.
Digital-to-Analog Conversion
 2 Basic Approaches
◦ Weighted Summing Amplifier
◦ R-2R Network Approach
Weighted Sum DAC
 One way to achieve D/A conversion is
to use a summing amplifier.
 This approach is not satisfactory for a
large number of bits because it
requires too much precision in the
summing resistors.
 This problem is overcome in the R-2R
network DAC.
R-2R Ladder DAC
 The summing amplifier with the R-2R
ladder of resistances shown produces
the output where the D's take the
value 0 or 1.
 The digital inputs could be TTL
voltages which close the switches on
a logical 1 and leave it grounded for a
logical 0.
 This is illustrated for 4 bits, but can be
extended to any number with just the
resistance values R and 2R.
Example
 What will be the analog equivalent of
1001 0001?
DAC0808 interfacing with
PIC18
 8 bit DAC, provides 256 discrete
voltage levels.
Converting Iout to Voltage in
DAC0808
 In the MC0808 the digital inputs are
converted to current and to convert it
to voltage Iout is connected to a
resistor.
 As the resistance affect the output
voltage so current output is isolated by
connecting it to an op-amp.
Generating a sine wave
 To generate a sine wave we first need
a table whose values represent the
magnitude of sine of angle b/w 0 and
360 degrees.
 Sin varies from -1 to +1.
 This method ensures that only integer
numbers are output to the DAC by
PIC18.
 Assume full-scale voltage of 10 V.
 Vout = 5V + (5*sinQ)
Vout of DAC for various angles
Program for generating sine
wave
Full scale Vout = 10V
256steps/ 10V = 25.6 steps per volt
Output sine wave
Sensor interfacing
 Sensor is a device which detects or
measures a physical property and
records, indicates, or otherwise
responds to it.
 Transducer is a device that converts
variations in a physical quantity, such
as pressure or brightness, into an
electrical signal, or vice versa.
 We are considering only temperature
sensor.
Temperature Sensor
• Transducer that converts temperature into an
analog electrical signal.
• Many are available as integrated circuits, and
their outputs (voltage or current) are, in
general, linearly proportional to the
temperature.
• However, output voltage ranges of these
transducers may not be ideally suited to
reference voltages of A/D converters.
• Therefore, it is necessary to scale the output
of a transducer to range of the reference
voltages of an A/D converter.
• Scaling may require amplification or shifting
of voltages at a different level.
Interfacing LM34/LM35 with
PIC18
 The sensor of LM34 series are
precision integrated-circuit
temperature sensors.
 Output voltage is linearly proportional
to fahrenheit temperature.
 Outputs 10mV for each degree of
fahrenhiet temperature.
 In LM35 output voltage is linearly
proportional to celsius temperature.
LM34 sensors
LM35 sensors
Interfacing LM35 with PIC18
 Temperature calculations
◦ A/D converter has 10-bit resolution
◦ For temperature range 0ºF to +300ºF, the digital
output should be divided into 1024 steps (0 to
3FFH).
◦ Therefore, the digital value per degrees
Fahrenheit is 10.24 (1024/100 = 10.2410).
◦ This 10.24 V is exceeding the permissible max.
value i.e 3V.
◦ If step size is taken 2.5 mV then max Vout will be
2.56 V.
◦ Final value is calculated by dividing output by 4.
Interfacing LM35 with PIC18
 LM35 is
connected to
channel
0(RA0 pin).
 The channel
AN3(RA3
pin) is
connected to
the Vref of
2.56 V.
Program for reading and
displaying temperature
Pic ppt 13104022(4th_year)

Weitere ähnliche Inhalte

Was ist angesagt?

PIC16F877A interfacing with LCD
PIC16F877A interfacing with LCDPIC16F877A interfacing with LCD
PIC16F877A interfacing with LCDsunil polo
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...NimeshSingh27
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA ControllerShivamSood22
 
555 timer as Astable Multivibrator
555 timer as Astable Multivibrator555 timer as Astable Multivibrator
555 timer as Astable MultivibratorChandul4y
 
System bus timing 8086
System bus timing 8086System bus timing 8086
System bus timing 8086mpsrekha83
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...manishpatel_79
 
8086 modes
8086 modes8086 modes
8086 modesPDFSHARE
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Aarav Soni
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERsravannunna24
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic CircuitRamasubbu .P
 
Chapter 5 introduction to VHDL
Chapter 5 introduction to VHDLChapter 5 introduction to VHDL
Chapter 5 introduction to VHDLSSE_AndyLi
 
8051-mazidi-solution
8051-mazidi-solution8051-mazidi-solution
8051-mazidi-solutionZunAib Ali
 
8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijayVijay Kumar
 

Was ist angesagt? (20)

PIC16F877A interfacing with LCD
PIC16F877A interfacing with LCDPIC16F877A interfacing with LCD
PIC16F877A interfacing with LCD
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
PIC Microcontroller | ADC Interfacing
PIC Microcontroller | ADC InterfacingPIC Microcontroller | ADC Interfacing
PIC Microcontroller | ADC Interfacing
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA Controller
 
PLDs
PLDsPLDs
PLDs
 
555 timer as Astable Multivibrator
555 timer as Astable Multivibrator555 timer as Astable Multivibrator
555 timer as Astable Multivibrator
 
System bus timing 8086
System bus timing 8086System bus timing 8086
System bus timing 8086
 
DAC and sensor interfacing with PIC
DAC and sensor interfacing with PICDAC and sensor interfacing with PIC
DAC and sensor interfacing with PIC
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...
 
8086 modes
8086 modes8086 modes
8086 modes
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic Circuit
 
Chapter 5 introduction to VHDL
Chapter 5 introduction to VHDLChapter 5 introduction to VHDL
Chapter 5 introduction to VHDL
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
 
8051-mazidi-solution
8051-mazidi-solution8051-mazidi-solution
8051-mazidi-solution
 
8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 

Ähnlich wie Pic ppt 13104022(4th_year)

adc dac converter
adc dac converteradc dac converter
adc dac converterGaurav Rai
 
Fundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.pptFundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.pptBEVARAVASUDEVAAP1813
 
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptxnaveen088888
 
ADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfVikasMahor3
 
analog to digital converter and dac final
analog to digital converter and dac finalanalog to digital converter and dac final
analog to digital converter and dac finalDrVikasMahor
 
adcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxadcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxshivraj3252
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Guhan k
 
ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORAnil Yadav
 
digital anlage c converter for digital .ppt
digital anlage c converter for digital .pptdigital anlage c converter for digital .ppt
digital anlage c converter for digital .pptAbdullahOmar64
 
Successive Approximation ADC
Successive Approximation ADC Successive Approximation ADC
Successive Approximation ADC AbhayDhupar
 
ADC Interfacing with pic Microcontrollert
ADC Interfacing with pic MicrocontrollertADC Interfacing with pic Microcontrollert
ADC Interfacing with pic Microcontrollertleapshare007
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfsatyamsinha37
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERChirag Lakhani
 
03 analog control_sp17
03 analog control_sp1703 analog control_sp17
03 analog control_sp17John Todora
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital ConvertersAmitabh Shukla
 

Ähnlich wie Pic ppt 13104022(4th_year) (20)

adc dac converter
adc dac converteradc dac converter
adc dac converter
 
Fundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.pptFundamental of MSD Module-III Part-a.ppt
Fundamental of MSD Module-III Part-a.ppt
 
Adc dac converter
Adc dac converterAdc dac converter
Adc dac converter
 
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
 
ADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfADC and DAC interfacing.pdf
ADC and DAC interfacing.pdf
 
analog to digital converter and dac final
analog to digital converter and dac finalanalog to digital converter and dac final
analog to digital converter and dac final
 
adcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxadcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptx
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]
 
Adc and dac
Adc and dacAdc and dac
Adc and dac
 
ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTOR
 
digital anlage c converter for digital .ppt
digital anlage c converter for digital .pptdigital anlage c converter for digital .ppt
digital anlage c converter for digital .ppt
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
Successive Approximation ADC
Successive Approximation ADC Successive Approximation ADC
Successive Approximation ADC
 
Lica 7th chapter slides
Lica 7th chapter slidesLica 7th chapter slides
Lica 7th chapter slides
 
ADC Interfacing with pic Microcontrollert
ADC Interfacing with pic MicrocontrollertADC Interfacing with pic Microcontrollert
ADC Interfacing with pic Microcontrollert
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
 
03 analog control_sp17
03 analog control_sp1703 analog control_sp17
03 analog control_sp17
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 

Kürzlich hochgeladen

Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointGetawu
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...motiram463
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...Amil baba
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...ranjana rawat
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...anilsa9823
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...Pooja Nehwal
 
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样qaffana
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Pooja Nehwal
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Pooja Nehwal
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Pooja Nehwal
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gapedkojalkojal131
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power pointchhavia330
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power point
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
 
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
 
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power point
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
 

Pic ppt 13104022(4th_year)

  • 1. INTERFACING OF ADC, DAC & SENSOR WITH PIC18F MICROCONTROLLER
  • 2. Basics of A/D Conversion •Can convert only electrical voltages to digital values. • A transducer is needed to convert a non-electric quantity into an electrical voltage. • Different names of transducers are used for different physical quantities. • A data acquisition system is used to referred to those systems that perform A/D conversions.
  • 3. Characteristics of ADC  Resolution  Conversion time  Vref  Digital data output Dout = Vin/step size
  • 4. Parallel VS Serial ADC  Parallel in serial ou shift register  Speed is slow •8 bit & 16 bit o/p line •Speed is fast
  • 5. The PIC18f A/D Converter -The PIC18 has a 10-bit A/D converter. -The number of analog inputs varies among difference PIC18 devices. -The contents of these registers vary with the PIC18 members. -Early PIC18 (PIC18FXX2) members have only ADCON0 and ADCON1 registers.
  • 6.
  • 7. A/D Registers -The A/D converter has the following registers: •A/D Result High Register (ADRESH) •A/D Result Low Register (ADRESL) •A/D Control Register 0 (ADCON0) •A/D Control Register 1 (ADCON1)
  • 8. Three control registers are used to: •Set up the I/O pins for analog signals from ports A, B, and E that are used as inputs for A/D conversion.RA5 •Select a channel: AN4 •Set up pins RA2 and RA3 to connect external VREF + and VREF - if specified in the control register ADCON1. •Select an oscillator frequency divider through the control register ADCON1. •Select an acquisition time through the control register ADCON2.
  • 9. A/D Control Register 0 (ADCON0) • Primary function of the ADCON0 register: – Select a channel for input analog signal – Start a conversion – Indicate the end of the conversion • Bit2 is set to start the conversion, and at the end of the conversion this bit is reset.
  • 10. A/D Control Register 1 (ADCON1)  ADCON1 is primarily used to set up the I/O pins either for analog signal or for digital signals and select VREF voltages.  An input to be converted must be an analog input.  The ADFM bit of the ADCON1 is used for making it Right-justified or Left-justified because we need 10 out of 16 bits.
  • 11. ADFM bit  Alignment to the left – the eight MSB bits are stored in the ADRESH, and the two LSB bits are stored in ADRESL. In this case, the remaining six bits appear as - "0". • Alignment to the right – the eight LSB bits are stored in ADRESL, and two MSB bits are stored in the ADRESH. In this case six highest bits appear as - "0".
  • 12.
  • 13. A/D Acquisition Requirements  The A/D converter has a sample-and-hold circuit for analog input.  The sample-and-hold circuit keeps the voltage stable when it is converted.  The sample-and-hold circuit is shown in Figure.
  • 14. Automatic Acquisition Time  For earlier PIC18 members, when the GO/DONE bit is set, sampling is stopped and conversion begins.  The user is responsible for making sure enough acquisition time is provided.  For newer PIC18 members, the A/D module will continue to sample after the GO/DONE bit is set for the selected acquisition time.  The automatic acquisition time makes A/D programming a little easier.
  • 15. Selecting the A/D Conversion Clock  The per bit A/D conversion time is defined as TAD.  Each 10-bit A/D conversion takes 12 TAD to complete.  For some devices, the options for TAD are defined in ADCON0. For others, the options for TAD are defined in ADCON2.  The length of TAD must be at least 1.6 .
  • 17. Procedure for Performing A/D Conversion  Configure the A/D module 1. Configure analog pins, reference voltages 2. Select A/D input channel 3. Select A/D acquisition time (if available) 4. Select A/D conversion clock 5. Enable A/D module  Configure A/D interrupt 1. Clear ADIF flag 2. Set ADIE bit (if desired) 3. Set GIE bit (if desired)
  • 18. Procedure contd…..  Wait for the desired acquisition time (if required)  Start conversion by setting the GO/DONE bit  Wait for A/D conversion to complete  Read the A/D result registers; clear the ADIF flag  For next conversion, go to step 1 or step 2.
  • 21. Digital to Analog (D/A, DAC, or D-to-A) Conversion  Converting discrete signals into discrete analog values that represent the magnitude of the input signal compared to a standard or reference voltage ◦ The output of the DAC is discrete analog steps. ◦ By increasing the resolution (number of bits), the step size is reduced, and the output approximates a continuous analog signal.
  • 22. Digital-to-Analog Conversion  2 Basic Approaches ◦ Weighted Summing Amplifier ◦ R-2R Network Approach
  • 23. Weighted Sum DAC  One way to achieve D/A conversion is to use a summing amplifier.  This approach is not satisfactory for a large number of bits because it requires too much precision in the summing resistors.  This problem is overcome in the R-2R network DAC.
  • 24.
  • 25. R-2R Ladder DAC  The summing amplifier with the R-2R ladder of resistances shown produces the output where the D's take the value 0 or 1.  The digital inputs could be TTL voltages which close the switches on a logical 1 and leave it grounded for a logical 0.  This is illustrated for 4 bits, but can be extended to any number with just the resistance values R and 2R.
  • 26.
  • 27. Example  What will be the analog equivalent of 1001 0001?
  • 28. DAC0808 interfacing with PIC18  8 bit DAC, provides 256 discrete voltage levels.
  • 29. Converting Iout to Voltage in DAC0808  In the MC0808 the digital inputs are converted to current and to convert it to voltage Iout is connected to a resistor.  As the resistance affect the output voltage so current output is isolated by connecting it to an op-amp.
  • 30. Generating a sine wave  To generate a sine wave we first need a table whose values represent the magnitude of sine of angle b/w 0 and 360 degrees.  Sin varies from -1 to +1.  This method ensures that only integer numbers are output to the DAC by PIC18.  Assume full-scale voltage of 10 V.  Vout = 5V + (5*sinQ)
  • 31. Vout of DAC for various angles
  • 32. Program for generating sine wave Full scale Vout = 10V 256steps/ 10V = 25.6 steps per volt
  • 34. Sensor interfacing  Sensor is a device which detects or measures a physical property and records, indicates, or otherwise responds to it.  Transducer is a device that converts variations in a physical quantity, such as pressure or brightness, into an electrical signal, or vice versa.  We are considering only temperature sensor.
  • 35. Temperature Sensor • Transducer that converts temperature into an analog electrical signal. • Many are available as integrated circuits, and their outputs (voltage or current) are, in general, linearly proportional to the temperature. • However, output voltage ranges of these transducers may not be ideally suited to reference voltages of A/D converters. • Therefore, it is necessary to scale the output of a transducer to range of the reference voltages of an A/D converter. • Scaling may require amplification or shifting of voltages at a different level.
  • 36. Interfacing LM34/LM35 with PIC18  The sensor of LM34 series are precision integrated-circuit temperature sensors.  Output voltage is linearly proportional to fahrenheit temperature.  Outputs 10mV for each degree of fahrenhiet temperature.  In LM35 output voltage is linearly proportional to celsius temperature.
  • 38. Interfacing LM35 with PIC18  Temperature calculations ◦ A/D converter has 10-bit resolution ◦ For temperature range 0ºF to +300ºF, the digital output should be divided into 1024 steps (0 to 3FFH). ◦ Therefore, the digital value per degrees Fahrenheit is 10.24 (1024/100 = 10.2410). ◦ This 10.24 V is exceeding the permissible max. value i.e 3V. ◦ If step size is taken 2.5 mV then max Vout will be 2.56 V. ◦ Final value is calculated by dividing output by 4.
  • 39. Interfacing LM35 with PIC18  LM35 is connected to channel 0(RA0 pin).  The channel AN3(RA3 pin) is connected to the Vref of 2.56 V.
  • 40. Program for reading and displaying temperature