Microchip® Advanced Software Framework

 All Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
ADC example 2 for the ATmega168A Documentation

Introduction

This example demonstrates how to use the megaAVR ADC Driver to set up the ADC in freerunning mode.

Files:

Brief description

This application will read the analog value on the ADC0 pin in freerunning mode. An interrupt routine accumulates the readings and does an average every 16 readings; storing it in a global variable.

Note
You must connect an analog voltage source to the ADC0 pin. If using the STK600 you can use AREF0 or AREF1. Do not apply a voltage above the ADC voltage reference.

Compilation Info

This software was written for the GNU GCC for AVR, and IAR Embedded Workbench.
Other compilers may or may not work.

Contact Information

For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/