SlideShare a Scribd company logo
4
Most read
7
Most read
8
Most read
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

More Related Content

PPTX
Microcontroller 8051 and its interfacing
DOC
PIC MICROCONTROLLERS -CLASS NOTES
PPTX
8051 Microcontroller ppt
PPTX
PIC Microcontrollers
PPTX
Serial Communication in 8051
PPT
Memory organization of 8051
DOC
Chap 5
PDF
Microcontroller pic 16f877 addressing modes instructions and programming
Microcontroller 8051 and its interfacing
PIC MICROCONTROLLERS -CLASS NOTES
8051 Microcontroller ppt
PIC Microcontrollers
Serial Communication in 8051
Memory organization of 8051
Chap 5
Microcontroller pic 16f877 addressing modes instructions and programming

What's hot (20)

PPTX
Windowing techniques of fir filter design
PPT
Arm organization and implementation
PPTX
PIC-18 Microcontroller
PPT
Interfacing LCD with 8051 Microcontroller
PDF
8051 interfacing
DOCX
Arm7 Interfacing examples
PPT
AVR Fundamentals
PPTX
Microcontroller 8096
PPTX
LCD Interacing with 8051
PPTX
Electronics Quiz
PPT
Microcontroller-8051.ppt
PPTX
M ary psk modulation
PPTX
8051 timer counter
PPTX
Sensor interfacing in 8051
PDF
DAC Interfacing with 8051.pdf
PPT
8051 MICROCONTROLLER
PPTX
Pass Transistor Logic
PPSX
Presentation on Op-amp by Sourabh kumar
PPTX
Switch mode power supply
Windowing techniques of fir filter design
Arm organization and implementation
PIC-18 Microcontroller
Interfacing LCD with 8051 Microcontroller
8051 interfacing
Arm7 Interfacing examples
AVR Fundamentals
Microcontroller 8096
LCD Interacing with 8051
Electronics Quiz
Microcontroller-8051.ppt
M ary psk modulation
8051 timer counter
Sensor interfacing in 8051
DAC Interfacing with 8051.pdf
8051 MICROCONTROLLER
Pass Transistor Logic
Presentation on Op-amp by Sourabh kumar
Switch mode power supply
Ad

Similar to PIC Microcontroller | ADC Interfacing (20)

PPTX
Introduction To Assembly Language Programming
PPTX
IoT based Smart board for Displaying and Forwarding notices using Raspberry Pi
PPT
Industrial Internet of Things (IIoT)
PPTX
DAA Introduction to Algorithms & Application
PPTX
PDF
IRJET- Students Smart Card using RFID
PDF
Smart Vending Machine System Using IOT
PDF
IRJET- College Bus Fee Payment System
PDF
IRJET- Braille Oriented Classroom
DOCX
Rachit 20 March 2015
PDF
IOT Virtual Doctor Robot for Online Doctor Consultation of Patient Healthcare...
PDF
SMART LATHE MACHINE
PDF
Raspberry Pi Traffic Light
PDF
IRJET - Pick and Place Surveillance Robot
PPTX
PDF
IRJET- Design and Implementation of PID Controller using HDL on FPGA
Introduction To Assembly Language Programming
IoT based Smart board for Displaying and Forwarding notices using Raspberry Pi
Industrial Internet of Things (IIoT)
DAA Introduction to Algorithms & Application
IRJET- Students Smart Card using RFID
Smart Vending Machine System Using IOT
IRJET- College Bus Fee Payment System
IRJET- Braille Oriented Classroom
Rachit 20 March 2015
IOT Virtual Doctor Robot for Online Doctor Consultation of Patient Healthcare...
SMART LATHE MACHINE
Raspberry Pi Traffic Light
IRJET - Pick and Place Surveillance Robot
IRJET- Design and Implementation of PID Controller using HDL on FPGA
Ad

More from International Institute of Information Technology (I²IT) (20)

PPTX
Understanding Natural Language Processing
PPTX
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
PPTX
Writing Skills: Importance of Writing Skills
PPTX
Professional Communication | Introducing Oneself
PPTX
PPTX
What Is Jenkins? Features and How It Works
PPTX
Data Science, Big Data, Data Analytics
PPTX
PPTX
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
PPTX
Sentiment Analysis in Machine Learning
PPT
Importance of Theory of Computations
PPT
Java as Object Oriented Programming Language
PPTX
PPTX
Data Visualization - How to connect Microsoft Forms to Power BI
Understanding Natural Language Processing
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Writing Skills: Importance of Writing Skills
Professional Communication | Introducing Oneself
What Is Jenkins? Features and How It Works
Data Science, Big Data, Data Analytics
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Sentiment Analysis in Machine Learning
Importance of Theory of Computations
Java as Object Oriented Programming Language
Data Visualization - How to connect Microsoft Forms to Power BI

Recently uploaded (20)

PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
PPT on Performance Review to get promotions
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
composite construction of structures.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT
Project quality management in manufacturing
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Sustainable Sites - Green Building Construction
PPTX
UNIT 4 Total Quality Management .pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPT on Performance Review to get promotions
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
composite construction of structures.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Project quality management in manufacturing
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
CH1 Production IntroductoryConcepts.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Foundation to blockchain - A guide to Blockchain Tech
OOP with Java - Java Introduction (Basics)
Sustainable Sites - Green Building Construction
UNIT 4 Total Quality Management .pptx

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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 - [email protected] 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 | [email protected] | [email protected] 14