adc interfacing
TRANSCRIPT
![Page 1: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/1.jpg)
![Page 2: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/2.jpg)
In the Real World, a sensor senses any physical parameter and converts into an equivalent analog electrical signal.
For efficient and ease of signal processing, this analog signal is converted into a digital signal using an Analog to Digital Converter (ADC).
This digital signal is then fed to the Microcontroller (MCU) and is processed accordingly.
![Page 3: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/3.jpg)
![Page 4: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/4.jpg)
![Page 5: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/5.jpg)
Atmega8 provides 10 Bit Resolution for ADC
![Page 6: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/6.jpg)
The ADC of the AVR converts analog signal into digital signal at some regular interval
Determined by the clock frequency
ADC operates within a frequency range of 50kHz to 200kHz
But CPU clock frequency is much higher (in the order of MHz)
Frequency division must take place
The prescaler acts as this division factor
![Page 7: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/7.jpg)
Out of the 50kHz-200kHz range of frequencies, which one do we need?
There is a trade-off between frequency and accuracy
Greater the frequency, lesser the accuracy and vice-versa
So, if your application is not sophisticated and doesn’t require much accuracy, you could go for higher frequencies
![Page 8: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/8.jpg)
1. ADMUX – ADC Multiplexer Selection Register
![Page 9: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/9.jpg)
![Page 10: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/10.jpg)
![Page 11: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/11.jpg)
![Page 12: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/12.jpg)
![Page 13: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/13.jpg)
Bit 7 – ADEN – ADC Enable
Bit 6 – ADSC – ADC Start Conversion
Bit 5 – ADFR – ADC Free Running Select
Bit 4 – ADIF – ADC Interrupt Flag
Bit 3 – ADIE – ADC Interrupt Enable
Bits 2:0 – ADPS2:0 – ADC Prescaler Select Bits
![Page 14: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/14.jpg)
![Page 15: Adc interfacing](https://reader035.vdocuments.net/reader035/viewer/2022062220/559cde771a28abd3118b45b9/html5/thumbnails/15.jpg)