Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

ADC on Atmega328. Part 2

After we’ve learned how to performs simple ADC conversions on AVR microcontroller we can move forward with more complex tasks. AVR ADC module has many useful features that make conversions more robust without occupying MCU resources. Imagine that we need to sample analog waveform or audio signal. It has to be done precisely at defined sampling frequency like 20kHz. The only way to do this correct is to use auto-triggering with exact time intervals. Why not to pass counting task to timer? Lets write Timer0 auto-triggered ADC conversions with ADC complete interrupt service routine. Continue reading