SlideShare a Scribd company logo
Prepared by: Mohamed AbdAllah
Raspberry pi interfacing
Lecture 4: Hardware interfacing special cases
1
Lecture Agenda
ADC
PWM
Polling
V.S
Interrupt
2
ADC
ADC
PWM
Polling
V.S
Interrupt
3
ADC
 What is ADC?
• An analog-to-digital converter (ADC, A/D, or A to D) is a device that
converts a continuous physical quantity (usually voltage) to a digital
number that represents the quantity's amplitude.
• The conversion involves quantization of the input, so it necessarily
introduces a small amount of error.
• Instead of doing a single conversion, an ADC often performs the
conversions ("samples" the input) periodically. The result is a sequence of
digital values that have been converted from a continuous-time and
continuous-amplitude analog signal to a discrete-time and discrete-
amplitude digital signal.
4
ADC
 What is ADC?
5
ADC
 ADC concepts
• Sampling: is the process of taking captures of the signal each specific
amount of time.
• Quantization: is the process of rounding the taken value to a specific
predefined constant values.
• Sampling rate: the rate at which new digital values are sampled from the
analog signal.
• Resolution: indicates the number of discrete values it can produce over
the range of analog values (ex. 8-bits ADC resolution).
• Quantization error: it is the noise introduced by quantization in the ADC.
It is a rounding error between the analog input voltage to the ADC and
the output digitized value. The noise is non-linear and signal-dependent.
6
ADC
 ADC example: successive-approximation ADC
• uses a comparator to successively narrow a range that contains the input
voltage. At each successive step, the converter compares the input
voltage to the output of an internal digital to analog converter which
might represent the midpoint of a selected voltage range. At each step in
this process, the approximation is stored in a successive approximation
register (SAR). For example, consider an input voltage of 6.3 V and the
initial range is 0 to 16 V. For the first step, the input 6.3 V is compared to 8
V (the midpoint of the 0–16 V range). The comparator reports that the
input voltage is less than 8 V, so the SAR is updated to narrow the range
to 0–8 V.
7
ADC
 ADC example: successive-approximation ADC
• For the second step, the input voltage is compared to 4 V (midpoint of 0–
8). The comparator reports the input voltage is above 4 V, so the SAR is
updated to reflect the input voltage is in the range 4–8 V. For the third
step, the input voltage is compared with 6 V (halfway between 4 V and 8
V); the comparator reports the input voltage is greater than 6 volts, and
search range becomes 6–8 V. The steps are continued until the desired
resolution is reached.
8
PWM
ADC
PWM
Polling
V.S
Interrupt
9
PWM
 What is PWM?
• Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a
technique used to encode a message into a pulsing signal. It is a type of
modulation. Although this modulation technique can be used to encode
information for transmission, its main use is to allow the control of the
power supplied to electrical devices, especially to inertial loads such as
motors.
• The average value of voltage (and current) fed to the load is controlled by
turning the switch between supply and load on and off at a fast rate. The
longer the switch is on compared to the off periods, the higher the total
power supplied to the load.
10
PWM
 What is PWM?
• The PWM switching frequency has to be much higher than what would
affect the load (the device that uses the power), which is to say that the
resultant waveform perceived by the load must be as smooth as possible.
Typically switching has to be done several times a minute in an electric
stove, 120 Hz in a lamp dimmer, from few kilohertz (kHz) to tens of kHz
for a motor drive and well into the tens or hundreds of kHz in audio
amplifiers and computer power supplies.
11
PWM
 PWM duty cycle
• describes the proportion of 'on' time to the regular interval or 'period' of
time, a low duty cycle corresponds to low power, because the power is off
for most of the time. Duty cycle is expressed in percent, 100% being fully
on.
12
PWM
 PWM duty cycle
13
Polling V.S Interrupt
ADC
PWM
Polling
V.S
Interrupt
14
Polling V.S Interrupt
 Polling
• The program keeps polling on the target information until it is ready, so
the program stops waiting for the required information.
 Interrupt
• The program does any other work and when the important information is
available, the program get interrupted to handle this information.
15
Mohamed AbdAllah
Embedded Systems Engineer
mohabdallah8@gmail.com
16

More Related Content

PDF
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Mohamed Abdallah
 
PDF
Lpc2148 i2c
anishgoel
 
PDF
SPI Protocol in LPC2148
Dnyanesh P. Joshi
 
PPTX
Serial Peripheral Interface
Anurag Tomar
 
PDF
Asynchronous Serial Communication and standards
Mathivanan Natarajan
 
PPTX
I2c protocol - Inter–Integrated Circuit Communication Protocol
Ankur Soni
 
PDF
The I2C Interface
Corrado Santoro
 
PDF
I2C Bus (Inter-Integrated Circuit)
Varun Mahajan
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Mohamed Abdallah
 
Lpc2148 i2c
anishgoel
 
SPI Protocol in LPC2148
Dnyanesh P. Joshi
 
Serial Peripheral Interface
Anurag Tomar
 
Asynchronous Serial Communication and standards
Mathivanan Natarajan
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
Ankur Soni
 
The I2C Interface
Corrado Santoro
 
I2C Bus (Inter-Integrated Circuit)
Varun Mahajan
 

What's hot (20)

PPTX
Analog to Digital converter in ARM
Aarav Soni
 
PPTX
I2 c protocol
Azad Mishra
 
PPTX
I2C
Sarojpatnaik5
 
PPTX
Serial peripheral Interface - Embedded System Protocol
Aditya Porwal
 
PPT
Serial Peripheral Interface(SPI)
Dhaval Kaneria
 
PPT
SPI Bus Protocol
Sudhanshu Janwadkar
 
PPT
I2C protocol and DS1307 RTC interfacing
Bhargav Kakadiya
 
PPTX
Serial communication in LPC2148
sravannunna24
 
PPTX
I2C introduction
SUNODH GARLAPATI
 
PPT
Serial Communication Part-16
Techvilla
 
PPTX
Slow peripheral interfaces (i2 c spi uart)
PREMAL GAJJAR
 
PPT
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
Tejas Shetye
 
PDF
SPI Protocol
Anurag Tomar
 
PPTX
Interfacing to the analog world
Islam Samir
 
PDF
Serial Peripheral Interface
Chirag Parikh
 
PPT
I2C And SPI Part-23
Techvilla
 
PPT
Seminar on serial communication
Samarth Patel
 
PPT
I2C Protocol
Anurag Tomar
 
PPTX
I2C Protocol
Sudhanshu Janwadkar
 
PPTX
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Tejas Shetye
 
Analog to Digital converter in ARM
Aarav Soni
 
I2 c protocol
Azad Mishra
 
Serial peripheral Interface - Embedded System Protocol
Aditya Porwal
 
Serial Peripheral Interface(SPI)
Dhaval Kaneria
 
SPI Bus Protocol
Sudhanshu Janwadkar
 
I2C protocol and DS1307 RTC interfacing
Bhargav Kakadiya
 
Serial communication in LPC2148
sravannunna24
 
I2C introduction
SUNODH GARLAPATI
 
Serial Communication Part-16
Techvilla
 
Slow peripheral interfaces (i2 c spi uart)
PREMAL GAJJAR
 
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
Tejas Shetye
 
SPI Protocol
Anurag Tomar
 
Interfacing to the analog world
Islam Samir
 
Serial Peripheral Interface
Chirag Parikh
 
I2C And SPI Part-23
Techvilla
 
Seminar on serial communication
Samarth Patel
 
I2C Protocol
Anurag Tomar
 
I2C Protocol
Sudhanshu Janwadkar
 
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Tejas Shetye
 
Ad

Similar to Raspberry Pi - Lecture 4 Hardware Interfacing Special Cases (20)

PPTX
Lecture_6_Analog_Interfacing continue.pptx
OnyangoBernard1
 
PPT
"Empowering Motion: A Dive into Actuators"
PasianoNemes
 
PDF
Mixed Signal Verification of a Voltage Regulator using a State Space approach...
Raj Mitra
 
PDF
Microcontroller part 3
Keroles karam khalil
 
PPTX
03 analog control_sp17
John Todora
 
PPTX
05 analog control_sp15
John Todora
 
PPTX
Unit 6.pptx
SiddharthWagh14
 
PPTX
Tools for Practical Attacks on Analog-to-Digital Conversion
Alexander Bolshev
 
PPTX
Chap 3. signal processing elemnt part three
YemaneBayray
 
PPT
Analog to digital converters, adc
Saumya Ranjan Behura
 
PPTX
TIVA_Workshop_Session II.pptx Embedded system design using TIVA
ece04abhishek
 
PPT
Fundamental of MSD Module-III Part-a.ppt
BEVARAVASUDEVAAP1813
 
PDF
Types of Actuators and Sensors in Robotics
rahulkatre9
 
PPT
04._sensors_and_actuators.ppt Kassa presentation
KassahunAwoke
 
PPTX
Design and testing of Voltage Regulator using 723
HaleshMREC
 
PPT
Sensors And Actuators
Jinesh Patel
 
PDF
Ab cs of_adcs
hacker1500
 
PDF
Arm Processor Based Speed Control Of BLDC Motor
Uday Wankar
 
PPT
Adc f05
Niroshan Manoharan
 
PPTX
Adc and dac
nitugatkal
 
Lecture_6_Analog_Interfacing continue.pptx
OnyangoBernard1
 
"Empowering Motion: A Dive into Actuators"
PasianoNemes
 
Mixed Signal Verification of a Voltage Regulator using a State Space approach...
Raj Mitra
 
Microcontroller part 3
Keroles karam khalil
 
03 analog control_sp17
John Todora
 
05 analog control_sp15
John Todora
 
Unit 6.pptx
SiddharthWagh14
 
Tools for Practical Attacks on Analog-to-Digital Conversion
Alexander Bolshev
 
Chap 3. signal processing elemnt part three
YemaneBayray
 
Analog to digital converters, adc
Saumya Ranjan Behura
 
TIVA_Workshop_Session II.pptx Embedded system design using TIVA
ece04abhishek
 
Fundamental of MSD Module-III Part-a.ppt
BEVARAVASUDEVAAP1813
 
Types of Actuators and Sensors in Robotics
rahulkatre9
 
04._sensors_and_actuators.ppt Kassa presentation
KassahunAwoke
 
Design and testing of Voltage Regulator using 723
HaleshMREC
 
Sensors And Actuators
Jinesh Patel
 
Ab cs of_adcs
hacker1500
 
Arm Processor Based Speed Control Of BLDC Motor
Uday Wankar
 
Adc and dac
nitugatkal
 
Ad

More from Mohamed Abdallah (9)

PDF
Hardware interfacing basics using AVR
Mohamed Abdallah
 
PDF
Embedded C - Lecture 4
Mohamed Abdallah
 
PDF
Embedded C - Lecture 3
Mohamed Abdallah
 
PDF
Embedded C - Lecture 2
Mohamed Abdallah
 
PDF
Embedded C - Lecture 1
Mohamed Abdallah
 
PDF
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
PDF
Raspberry Pi - Lecture 5 Python for Raspberry Pi
Mohamed Abdallah
 
PDF
Raspberry Pi - Lecture 2 Linux OS
Mohamed Abdallah
 
PDF
Raspberry Pi - Lecture 1 Introduction
Mohamed Abdallah
 
Hardware interfacing basics using AVR
Mohamed Abdallah
 
Embedded C - Lecture 4
Mohamed Abdallah
 
Embedded C - Lecture 3
Mohamed Abdallah
 
Embedded C - Lecture 2
Mohamed Abdallah
 
Embedded C - Lecture 1
Mohamed Abdallah
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
Raspberry Pi - Lecture 5 Python for Raspberry Pi
Mohamed Abdallah
 
Raspberry Pi - Lecture 2 Linux OS
Mohamed Abdallah
 
Raspberry Pi - Lecture 1 Introduction
Mohamed Abdallah
 

Recently uploaded (20)

PPTX
Module_II_Data_Science_Project_Management.pptx
anshitanarain
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
sangeethamtech26
 
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
ghousebhasha2007
 
PPTX
Chapter----five---Resource Recovery.pptx
078bce110prashant
 
PPTX
anatomy of limbus and anterior chamber .pptx
ZePowe
 
PPTX
Production of bioplastic from fruit peels.pptx
alwingeorgealwingeor
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PPTX
TE-AI-Unit VI notes using planning model
swatigaikwad6389
 
PDF
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
Ajaykumar966781
 
PPTX
Practice Questions on recent development part 1.pptx
JaspalSingh402
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
Structs to JSON How Go Powers REST APIs.pdf
Emily Achieng
 
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
PPTX
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
PDF
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 
PPTX
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
Module_II_Data_Science_Project_Management.pptx
anshitanarain
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Strings in CPP - Strings in C++ are sequences of characters used to store and...
sangeethamtech26
 
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
ghousebhasha2007
 
Chapter----five---Resource Recovery.pptx
078bce110prashant
 
anatomy of limbus and anterior chamber .pptx
ZePowe
 
Production of bioplastic from fruit peels.pptx
alwingeorgealwingeor
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
TE-AI-Unit VI notes using planning model
swatigaikwad6389
 
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
Ajaykumar966781
 
Practice Questions on recent development part 1.pptx
JaspalSingh402
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
Structs to JSON How Go Powers REST APIs.pdf
Emily Achieng
 
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
Ppt for engineering students application on field effect
lakshmi.ec
 

Raspberry Pi - Lecture 4 Hardware Interfacing Special Cases

  • 1. Prepared by: Mohamed AbdAllah Raspberry pi interfacing Lecture 4: Hardware interfacing special cases 1
  • 4. ADC  What is ADC? • An analog-to-digital converter (ADC, A/D, or A to D) is a device that converts a continuous physical quantity (usually voltage) to a digital number that represents the quantity's amplitude. • The conversion involves quantization of the input, so it necessarily introduces a small amount of error. • Instead of doing a single conversion, an ADC often performs the conversions ("samples" the input) periodically. The result is a sequence of digital values that have been converted from a continuous-time and continuous-amplitude analog signal to a discrete-time and discrete- amplitude digital signal. 4
  • 6. ADC  ADC concepts • Sampling: is the process of taking captures of the signal each specific amount of time. • Quantization: is the process of rounding the taken value to a specific predefined constant values. • Sampling rate: the rate at which new digital values are sampled from the analog signal. • Resolution: indicates the number of discrete values it can produce over the range of analog values (ex. 8-bits ADC resolution). • Quantization error: it is the noise introduced by quantization in the ADC. It is a rounding error between the analog input voltage to the ADC and the output digitized value. The noise is non-linear and signal-dependent. 6
  • 7. ADC  ADC example: successive-approximation ADC • uses a comparator to successively narrow a range that contains the input voltage. At each successive step, the converter compares the input voltage to the output of an internal digital to analog converter which might represent the midpoint of a selected voltage range. At each step in this process, the approximation is stored in a successive approximation register (SAR). For example, consider an input voltage of 6.3 V and the initial range is 0 to 16 V. For the first step, the input 6.3 V is compared to 8 V (the midpoint of the 0–16 V range). The comparator reports that the input voltage is less than 8 V, so the SAR is updated to narrow the range to 0–8 V. 7
  • 8. ADC  ADC example: successive-approximation ADC • For the second step, the input voltage is compared to 4 V (midpoint of 0– 8). The comparator reports the input voltage is above 4 V, so the SAR is updated to reflect the input voltage is in the range 4–8 V. For the third step, the input voltage is compared with 6 V (halfway between 4 V and 8 V); the comparator reports the input voltage is greater than 6 volts, and search range becomes 6–8 V. The steps are continued until the desired resolution is reached. 8
  • 10. PWM  What is PWM? • Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a technique used to encode a message into a pulsing signal. It is a type of modulation. Although this modulation technique can be used to encode information for transmission, its main use is to allow the control of the power supplied to electrical devices, especially to inertial loads such as motors. • The average value of voltage (and current) fed to the load is controlled by turning the switch between supply and load on and off at a fast rate. The longer the switch is on compared to the off periods, the higher the total power supplied to the load. 10
  • 11. PWM  What is PWM? • The PWM switching frequency has to be much higher than what would affect the load (the device that uses the power), which is to say that the resultant waveform perceived by the load must be as smooth as possible. Typically switching has to be done several times a minute in an electric stove, 120 Hz in a lamp dimmer, from few kilohertz (kHz) to tens of kHz for a motor drive and well into the tens or hundreds of kHz in audio amplifiers and computer power supplies. 11
  • 12. PWM  PWM duty cycle • describes the proportion of 'on' time to the regular interval or 'period' of time, a low duty cycle corresponds to low power, because the power is off for most of the time. Duty cycle is expressed in percent, 100% being fully on. 12
  • 13. PWM  PWM duty cycle 13
  • 15. Polling V.S Interrupt  Polling • The program keeps polling on the target information until it is ready, so the program stops waiting for the required information.  Interrupt • The program does any other work and when the important information is available, the program get interrupted to handle this information. 15