ADC on Atmega328. Part 1

Microcontrollers are meant to deal with digital information. They only understand ‘0’ and ‘1’ values. So what if we need to get some non-digital data into the microcontroller. The only way is to digitize or simply speaking to convert analog in to digital. This is why almost all microcontrollers are featured with the ADC module. Atmega328 microcontroller also has 8 (or 6 in PDIP package) ADC input channels. All these can be used to read an analog value that is within the reference voltage range. Let us see how this is easy. Continue reading

Interrupt based ADC conversions on Atmega168A

Protostack has expanded his previous AVR ADC tutorial with more advanced version where they use newer Atmega168A microcontroller instead Atmega168. In this tutorial part ADC conversions are performed by using interrupt routines. This technique frees microcontroller from loop checks and gives resources to other tasks like updating LCD, processing information. Continue reading