SlideShare ist ein Scribd-Unternehmen logo
1 von 14
1
PIC Microcontroller
Prof. Ashvini Kulkarni
Assistant Professor
Department of Electronics & Telecommunication
Hope Foundation’s
International Institute of Information Technology, I²IT
www.isquareit.edu.in
 Characteristics of ADC
 PIC 18 ADC features
 PIC 18 ADC control registers
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
2
 Analog signal is converted into a digital data that
can be processed using a digital computer.
 Types of ADC:
 Slope and double-slope type
 Flash type
 Successive approximation
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
3
 Characteristics of ADC[2]:
1. Resolution:
 ADC has n- bit resolution(where n=8,10,12,16,24
bits)
 Higher the resolution smaller the step size
 If ADC has 8 bit resolution means 2^8= 256(No. of
steps)
 Applied voltage is Vref=5v then 5/256=19.53 mv
(step size)
2. Conversion time:
 The time it takes for the converting analog input to
digital output Vref:It is input voltage used for the
reference voltage
 Vref/no. of steps(Vref is responsible for step size)
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
4
 Characteristics of ADC:
3. Digital data output:
 8 bit ADC, we have 8bit digital data output of D0
–D7
 Dout=Vin/step size[2]
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
5
 Features of ADC
1) The ADC in PIC18F4550 is a successive
approximation ADC with a resolution of 10 bits.
2) It has 10 input channels.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
6
Configuring Registers
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in7
The PIC18 Microcontroller
- The A/D converter has the following
registers[1]:
• A/D Control Register 0 (ADCON0)
• A/D Control Register 1 (ADCON1)
• A/D Control Register 2 (ADCON2)
• A/D Result High Register (ADRESH)
• A/D Result Low Register (ADRESL)
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
8
Figure No. 1: Block diagram of ADC in PIC18f4550[1]
 Each port pin associated with the A/D
converter can be configured as an
analog input or as a digital I/O.
 When the A/D conversion is complete,
the result is loaded into the
ADRESH:ADRESL registers,
 the GO/DONE bit (ADCON0 register) is
cleared and A/D Interrupt Flag bit,
ADIF, is set.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
9
 The analog reference voltage is
software selectable to either the
device’s positive and negative supply
voltage (VDD and VSS) or the voltage
level on the RA3/AN3/VREF+ and
RA2/AN2/VREF-/CVREF pins.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
10
1. Configure the A/D module: Configure analog pins,
voltage reference and digital I/O (ADCON1)
 Select A/D input channel (ADCON0)
 Select A/D acquisition time (ADCON2)
 Select A/D conversion clock (ADCON2)
 Turn on A/D module (ADCON0)
2. Configure A/D interrupt (if desired):
 Clear ADIF bit
 Set ADIE bit
 Set GIE bit
3. Wait the required acquisition time (if required).
 Start conversion
 Set GO/DONE=1 bit in (ADCON0 register)
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
11
5. Wait for A/D conversion to complete, by either:
 Polling for the GO/DONE bit to be cleared OR Waiting
for the A/D interrupt
6. Read A/D Result registers (ADRESH:ADRESL);
 clear bit ADIF, if interrupt bit is set.
7. For next conversion, go to step 1 or step 2, as
required.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
12
[1] Microchip datasheet of PIC18F2455/2550/4455/4550
[2] Muhamad Ali Mazidi,Rolind D Mckinly,”PIC
microcontroller and embedded systems”Pearson
publication.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
13
For further information please contact
Ashvini Kulkarni
Department of Electronics & Telecommunication
Hope Foundation’s International Institute of
Information Technology, I²IT
Hinjawadi, Pune – 411 057
Phone - +91 20 22933441
www.isquareit.edu.in | ashvinik@isquareit.edu.in
| info@isquareit.edu.in
14

Weitere ähnliche Inhalte

Was ist angesagt?

Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
PRADEEP
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
Dr.YNM
 

Was ist angesagt? (20)

Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
Interrupts for PIC18
Interrupts for PIC18Interrupts for PIC18
Interrupts for PIC18
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Pic 18 microcontroller
Pic 18 microcontrollerPic 18 microcontroller
Pic 18 microcontroller
 
Microcontroller pic 16f877 addressing modes instructions and programming
Microcontroller pic 16f877 addressing modes instructions and programmingMicrocontroller pic 16f877 addressing modes instructions and programming
Microcontroller pic 16f877 addressing modes instructions and programming
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikar
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
 
R-2R Ladder DAC
R-2R Ladder DACR-2R Ladder DAC
R-2R Ladder DAC
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
 
8051 io interface
8051 io interface8051 io interface
8051 io interface
 
Ditial to Analog Converter
Ditial to Analog ConverterDitial to Analog Converter
Ditial to Analog Converter
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
 
8051 serial communication-UART
8051 serial communication-UART8051 serial communication-UART
8051 serial communication-UART
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
 
Pic16cxx instruction set
Pic16cxx instruction setPic16cxx instruction set
Pic16cxx instruction set
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
 

Ähnlich wie PIC Microcontroller | ADC Interfacing

Rachit 20 March 2015
Rachit 20 March 2015Rachit 20 March 2015
Rachit 20 March 2015
Rachit Kapoor
 

Ähnlich wie PIC Microcontroller | ADC Interfacing (20)

Basics of Computer Graphics
Basics of Computer GraphicsBasics of Computer Graphics
Basics of Computer Graphics
 
Introduction To Assembly Language Programming
Introduction To Assembly Language ProgrammingIntroduction To Assembly Language Programming
Introduction To Assembly Language Programming
 
Interfacing of LCD with LPC2148
Interfacing of LCD with LPC2148Interfacing of LCD with LPC2148
Interfacing of LCD with LPC2148
 
IoT based Smart board for Displaying and Forwarding notices using Raspberry Pi
IoT based Smart board for Displaying and Forwarding notices using Raspberry PiIoT based Smart board for Displaying and Forwarding notices using Raspberry Pi
IoT based Smart board for Displaying and Forwarding notices using Raspberry Pi
 
Industrial Internet of Things (IIoT)
Industrial Internet of Things (IIoT)Industrial Internet of Things (IIoT)
Industrial Internet of Things (IIoT)
 
DAA Introduction to Algorithms & Application
DAA Introduction to Algorithms & ApplicationDAA Introduction to Algorithms & Application
DAA Introduction to Algorithms & Application
 
Interrupt Handling with LPC2148
Interrupt Handling with LPC2148Interrupt Handling with LPC2148
Interrupt Handling with LPC2148
 
Fundamentals of Computer Networks
Fundamentals of Computer NetworksFundamentals of Computer Networks
Fundamentals of Computer Networks
 
IRJET- Students Smart Card using RFID
IRJET-  	  Students Smart Card using RFIDIRJET-  	  Students Smart Card using RFID
IRJET- Students Smart Card using RFID
 
Smart Vending Machine System Using IOT
Smart Vending Machine System Using IOTSmart Vending Machine System Using IOT
Smart Vending Machine System Using IOT
 
IRJET- College Bus Fee Payment System
IRJET- College Bus Fee Payment SystemIRJET- College Bus Fee Payment System
IRJET- College Bus Fee Payment System
 
IRJET- Braille Oriented Classroom
IRJET-  	  Braille Oriented ClassroomIRJET-  	  Braille Oriented Classroom
IRJET- Braille Oriented Classroom
 
Introduction To Fog Computing
Introduction To Fog ComputingIntroduction To Fog Computing
Introduction To Fog Computing
 
Rachit 20 March 2015
Rachit 20 March 2015Rachit 20 March 2015
Rachit 20 March 2015
 
IOT Virtual Doctor Robot for Online Doctor Consultation of Patient Healthcare...
IOT Virtual Doctor Robot for Online Doctor Consultation of Patient Healthcare...IOT Virtual Doctor Robot for Online Doctor Consultation of Patient Healthcare...
IOT Virtual Doctor Robot for Online Doctor Consultation of Patient Healthcare...
 
SMART LATHE MACHINE
SMART LATHE MACHINESMART LATHE MACHINE
SMART LATHE MACHINE
 
Raspberry Pi Traffic Light
Raspberry Pi Traffic LightRaspberry Pi Traffic Light
Raspberry Pi Traffic Light
 
IRJET - Pick and Place Surveillance Robot
IRJET -  	  Pick and Place Surveillance RobotIRJET -  	  Pick and Place Surveillance Robot
IRJET - Pick and Place Surveillance Robot
 
Introduction to TCP Protocol Suite
Introduction to TCP Protocol SuiteIntroduction to TCP Protocol Suite
Introduction to TCP Protocol Suite
 
IRJET- Design and Implementation of PID Controller using HDL on FPGA
IRJET- 	  Design and Implementation of PID Controller using HDL on FPGAIRJET- 	  Design and Implementation of PID Controller using HDL on FPGA
IRJET- Design and Implementation of PID Controller using HDL on FPGA
 

Mehr von International Institute of Information Technology (I²IT)

Mehr von International Institute of Information Technology (I²IT) (20)

Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
 
Understanding Natural Language Processing
Understanding Natural Language ProcessingUnderstanding Natural Language Processing
Understanding Natural Language Processing
 
What Is Smart Computing?
What Is Smart Computing?What Is Smart Computing?
What Is Smart Computing?
 
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Professional Ethics & Etiquette: What Are They & How Do I Get Them?Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
 
Writing Skills: Importance of Writing Skills
Writing Skills: Importance of Writing SkillsWriting Skills: Importance of Writing Skills
Writing Skills: Importance of Writing Skills
 
Professional Communication | Introducing Oneself
Professional Communication | Introducing Oneself Professional Communication | Introducing Oneself
Professional Communication | Introducing Oneself
 
Servlet: A Server-side Technology
Servlet: A Server-side TechnologyServlet: A Server-side Technology
Servlet: A Server-side Technology
 
What Is Jenkins? Features and How It Works
What Is Jenkins? Features and How It WorksWhat Is Jenkins? Features and How It Works
What Is Jenkins? Features and How It Works
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Hypothesis-Testing
Hypothesis-TestingHypothesis-Testing
Hypothesis-Testing
 
Data Science, Big Data, Data Analytics
Data Science, Big Data, Data AnalyticsData Science, Big Data, Data Analytics
Data Science, Big Data, Data Analytics
 
Types of Artificial Intelligence
Types of Artificial Intelligence Types of Artificial Intelligence
Types of Artificial Intelligence
 
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
 
Sentiment Analysis in Machine Learning
Sentiment Analysis in  Machine LearningSentiment Analysis in  Machine Learning
Sentiment Analysis in Machine Learning
 
What Is Cloud Computing?
What Is Cloud Computing?What Is Cloud Computing?
What Is Cloud Computing?
 
Introduction To Design Pattern
Introduction To Design PatternIntroduction To Design Pattern
Introduction To Design Pattern
 
Importance of Theory of Computations
Importance of Theory of ComputationsImportance of Theory of Computations
Importance of Theory of Computations
 
Java as Object Oriented Programming Language
Java as Object Oriented Programming LanguageJava as Object Oriented Programming Language
Java as Object Oriented Programming Language
 
What Is High Performance-Computing?
What Is High Performance-Computing?What Is High Performance-Computing?
What Is High Performance-Computing?
 
Data Visualization - How to connect Microsoft Forms to Power BI
Data Visualization - How to connect Microsoft Forms to Power BIData Visualization - How to connect Microsoft Forms to Power BI
Data Visualization - How to connect Microsoft Forms to Power BI
 

Kürzlich hochgeladen

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 

Kürzlich hochgeladen (20)

Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 

PIC Microcontroller | ADC Interfacing

  • 1. 1 PIC Microcontroller Prof. Ashvini Kulkarni Assistant Professor Department of Electronics & Telecommunication Hope Foundation’s International Institute of Information Technology, I²IT www.isquareit.edu.in
  • 2.  Characteristics of ADC  PIC 18 ADC features  PIC 18 ADC control registers Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 2
  • 3.  Analog signal is converted into a digital data that can be processed using a digital computer.  Types of ADC:  Slope and double-slope type  Flash type  Successive approximation Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 3
  • 4.  Characteristics of ADC[2]: 1. Resolution:  ADC has n- bit resolution(where n=8,10,12,16,24 bits)  Higher the resolution smaller the step size  If ADC has 8 bit resolution means 2^8= 256(No. of steps)  Applied voltage is Vref=5v then 5/256=19.53 mv (step size) 2. Conversion time:  The time it takes for the converting analog input to digital output Vref:It is input voltage used for the reference voltage  Vref/no. of steps(Vref is responsible for step size) Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 4
  • 5.  Characteristics of ADC: 3. Digital data output:  8 bit ADC, we have 8bit digital data output of D0 –D7  Dout=Vin/step size[2] Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 5
  • 6.  Features of ADC 1) The ADC in PIC18F4550 is a successive approximation ADC with a resolution of 10 bits. 2) It has 10 input channels. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 6
  • 7. Configuring Registers Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in7 The PIC18 Microcontroller - The A/D converter has the following registers[1]: • A/D Control Register 0 (ADCON0) • A/D Control Register 1 (ADCON1) • A/D Control Register 2 (ADCON2) • A/D Result High Register (ADRESH) • A/D Result Low Register (ADRESL)
  • 8. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 8 Figure No. 1: Block diagram of ADC in PIC18f4550[1]
  • 9.  Each port pin associated with the A/D converter can be configured as an analog input or as a digital I/O.  When the A/D conversion is complete, the result is loaded into the ADRESH:ADRESL registers,  the GO/DONE bit (ADCON0 register) is cleared and A/D Interrupt Flag bit, ADIF, is set. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 9
  • 10.  The analog reference voltage is software selectable to either the device’s positive and negative supply voltage (VDD and VSS) or the voltage level on the RA3/AN3/VREF+ and RA2/AN2/VREF-/CVREF pins. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 10
  • 11. 1. Configure the A/D module: Configure analog pins, voltage reference and digital I/O (ADCON1)  Select A/D input channel (ADCON0)  Select A/D acquisition time (ADCON2)  Select A/D conversion clock (ADCON2)  Turn on A/D module (ADCON0) 2. Configure A/D interrupt (if desired):  Clear ADIF bit  Set ADIE bit  Set GIE bit 3. Wait the required acquisition time (if required).  Start conversion  Set GO/DONE=1 bit in (ADCON0 register) Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 11
  • 12. 5. Wait for A/D conversion to complete, by either:  Polling for the GO/DONE bit to be cleared OR Waiting for the A/D interrupt 6. Read A/D Result registers (ADRESH:ADRESL);  clear bit ADIF, if interrupt bit is set. 7. For next conversion, go to step 1 or step 2, as required. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 12
  • 13. [1] Microchip datasheet of PIC18F2455/2550/4455/4550 [2] Muhamad Ali Mazidi,Rolind D Mckinly,”PIC microcontroller and embedded systems”Pearson publication. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in 13
  • 14. For further information please contact Ashvini Kulkarni Department of Electronics & Telecommunication Hope Foundation’s International Institute of Information Technology, I²IT Hinjawadi, Pune – 411 057 Phone - +91 20 22933441 www.isquareit.edu.in | ashvinik@isquareit.edu.in | info@isquareit.edu.in 14