SlideShare a Scribd company logo
1 of 16
Download to read offline
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

What's hot

Analog to Digital converter in ARM
Analog to Digital converter in ARMAnalog to Digital converter in ARM
Analog to Digital converter in ARMAarav Soni
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolAditya Porwal
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Dhaval Kaneria
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingBhargav Kakadiya
 
Serial communication in LPC2148
Serial communication in LPC2148Serial communication in LPC2148
Serial communication in LPC2148sravannunna24
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16Techvilla
 
Slow peripheral interfaces (i2 c spi uart)
Slow peripheral interfaces (i2 c  spi uart)Slow peripheral interfaces (i2 c  spi uart)
Slow peripheral interfaces (i2 c spi uart)PREMAL GAJJAR
 
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay DeshmukhI2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay DeshmukhTejas Shetye
 
Interfacing to the analog world
Interfacing to the analog worldInterfacing to the analog world
Interfacing to the analog worldIslam Samir
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral InterfaceChirag Parikh
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23Techvilla
 
Seminar on serial communication
Seminar on serial communicationSeminar on serial communication
Seminar on serial communicationSamarth Patel
 
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterUniversal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterTejas Shetye
 

What's hot (20)

Analog to Digital converter in ARM
Analog to Digital converter in ARMAnalog to Digital converter in ARM
Analog to Digital converter in ARM
 
I2 c protocol
I2 c protocolI2 c protocol
I2 c protocol
 
I2C
I2CI2C
I2C
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)
 
SPI Bus Protocol
SPI Bus ProtocolSPI Bus Protocol
SPI Bus Protocol
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacing
 
Serial communication in LPC2148
Serial communication in LPC2148Serial communication in LPC2148
Serial communication in LPC2148
 
I2C introduction
I2C introductionI2C introduction
I2C introduction
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16
 
Slow peripheral interfaces (i2 c spi uart)
Slow peripheral interfaces (i2 c  spi uart)Slow peripheral interfaces (i2 c  spi uart)
Slow peripheral interfaces (i2 c spi uart)
 
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay DeshmukhI2C Bus 11.3.2 Unit 2 Design of Embedded systems  Ref. Book Ajay Deshmukh
I2C Bus 11.3.2 Unit 2 Design of Embedded systems Ref. Book Ajay Deshmukh
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
Interfacing to the analog world
Interfacing to the analog worldInterfacing to the analog world
Interfacing to the analog world
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
Seminar on serial communication
Seminar on serial communicationSeminar on serial communication
Seminar on serial communication
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterUniversal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
 

Similar to Raspberry Pi - Lecture 4 Hardware Interfacing Special Cases

Meeting w9 chapter 3 part 2
Meeting w9   chapter 3 part 2Meeting w9   chapter 3 part 2
Meeting w9 chapter 3 part 2Hattori Sidek
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital ConversionSyed Umair
 
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
 
MODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxMODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxManjunathtv2
 
New Microsoft Word Document.docx
New Microsoft Word Document.docxNew Microsoft Word Document.docx
New Microsoft Word Document.docxjainkamalkumar
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital ConvertersAnas Smarty
 
analog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptanalog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptdaredevil15082004
 
Plc analog Tutorial
Plc analog TutorialPlc analog Tutorial
Plc analog TutorialElectro 8
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noidaEdhole.com
 
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
 
86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-ppt86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-pptGovindaChandraBehera1
 
analog to digital converter.ppt
analog to digital converter.pptanalog to digital converter.ppt
analog to digital converter.pptDreamers6
 
Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsNiket Chandrashekar
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noidaEdhole.com
 
Data acquisition system
Data acquisition systemData acquisition system
Data acquisition systemgirishgandhi4
 
adc dac converter
adc dac converteradc dac converter
adc dac converterGaurav Rai
 
Chapter-1 Digital Measuring Instruments.pptx
Chapter-1 Digital Measuring Instruments.pptxChapter-1 Digital Measuring Instruments.pptx
Chapter-1 Digital Measuring Instruments.pptxramkumarraja7
 

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

Meeting w9 chapter 3 part 2
Meeting w9   chapter 3 part 2Meeting w9   chapter 3 part 2
Meeting w9 chapter 3 part 2
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital Conversion
 
Digital design chap 6
Digital design  chap 6Digital design  chap 6
Digital design chap 6
 
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
 
MODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptxMODULE-2_SIGNAL_CONDITIONING.pptx
MODULE-2_SIGNAL_CONDITIONING.pptx
 
New Microsoft Word Document.docx
New Microsoft Word Document.docxNew Microsoft Word Document.docx
New Microsoft Word Document.docx
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
 
analog to digital adn digital to analog .ppt
analog to digital adn digital to analog .pptanalog to digital adn digital to analog .ppt
analog to digital adn digital to analog .ppt
 
Digital voltmeter (DVM) and its Classification
Digital voltmeter (DVM) and its ClassificationDigital voltmeter (DVM) and its Classification
Digital voltmeter (DVM) and its Classification
 
Plc analog Tutorial
Plc analog TutorialPlc analog Tutorial
Plc analog Tutorial
 
Dac, adc architecture
Dac, adc architectureDac, adc architecture
Dac, adc architecture
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noida
 
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
 
86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-ppt86919253 data-acquisition-system-ppt
86919253 data-acquisition-system-ppt
 
analog to digital converter.ppt
analog to digital converter.pptanalog to digital converter.ppt
analog to digital converter.ppt
 
Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter Fundamentals
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noida
 
Data acquisition system
Data acquisition systemData acquisition system
Data acquisition system
 
adc dac converter
adc dac converteradc dac converter
adc dac converter
 
Chapter-1 Digital Measuring Instruments.pptx
Chapter-1 Digital Measuring Instruments.pptxChapter-1 Digital Measuring Instruments.pptx
Chapter-1 Digital Measuring Instruments.pptx
 

More from Mohamed Abdallah

Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVRMohamed Abdallah
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiRaspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiMohamed Abdallah
 
Raspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry PiRaspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry PiMohamed Abdallah
 
Raspberry Pi - Lecture 2 Linux OS
Raspberry Pi - Lecture 2 Linux OSRaspberry Pi - Lecture 2 Linux OS
Raspberry Pi - Lecture 2 Linux OSMohamed Abdallah
 
Raspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 IntroductionRaspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 IntroductionMohamed Abdallah
 

More from Mohamed Abdallah (9)

Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVR
 
Embedded C - Lecture 4
Embedded C - Lecture 4Embedded C - Lecture 4
Embedded C - Lecture 4
 
Embedded C - Lecture 3
Embedded C - Lecture 3Embedded C - Lecture 3
Embedded C - Lecture 3
 
Embedded C - Lecture 2
Embedded C - Lecture 2Embedded C - Lecture 2
Embedded C - Lecture 2
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiRaspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry Pi
 
Raspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry PiRaspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry Pi
 
Raspberry Pi - Lecture 2 Linux OS
Raspberry Pi - Lecture 2 Linux OSRaspberry Pi - Lecture 2 Linux OS
Raspberry Pi - Lecture 2 Linux OS
 
Raspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 IntroductionRaspberry Pi - Lecture 1 Introduction
Raspberry Pi - Lecture 1 Introduction
 

Recently uploaded

Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 

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
  • 16. Mohamed AbdAllah Embedded Systems Engineer mohabdallah8@gmail.com 16