

Here, the code is explained line by line. Burn the program in Atmega16 using JTAG and Atmel studio and rotate the potentiometer to vary the ADC value. Now start configuring these register bits in program such that we get Internal ADC read and output to All Pins of PORTC.Ĭomplete program is given below. Internal 2.56 Voltage Reference with external capacitor at AREF Pin Bit 6-7: They are used to select the reference voltage for ADC.


In order to use these pins as ADC pins we will have to configure certain registers dedicated to ADC control. By default, the PORTA pins are general IO pins, it means the port pins are multiplexed. Complete PortA (GPIO33-GPIO40) is dedicated for ADC operation. Now 8-channel corresponds to the dedicated 8 ADC Pins on Atmega16 where each pin can read the Analog voltage. 1024 levels of discrete Analog values (2 10 = 1024). 10 bit corresponds to that if input voltage is 0-5V then it will be split in 10 bit value i.e. Let’s discuss about the inbuilt ADC of Atmega16.Ītmega16 has an inbuilt 10 bit and 8-channel ADC. In this tutorial we will use inbuilt ADC of Atmega16. ADC’s are available in form of IC’s and also microcontrollers comes with inbuilt ADC nowadays. If you want to explore the ADC in much deep then you can refer our previous tutorial on ADC. This finishes our little explanation on successive-approximation. The digital code corresponds to the analog level is the desired digital representation of the analog signal. The generation is stopped when the analog level becomes just larger than the analog signal. An internal counter is used to compare with the analog signal under conversion. In a Successive-Approximation type of ADC, a series of digital codes, each corresponds to a fix analog level, are generated successively. The most inexpensive type of ADC is Successive-Approximation and in this tutorial Successive-approximation ADC will be used.

Few popular ADC’s are flash, successive approximation and sigma-delta. There are many types of ADC available for different applications. So, in order to make microcontrollers understand the analog signals, we have to convert these analog signals into digital form. In real world most of the signals are analog and any microcontroller or microprocessor understands the binary or digital language (0 or 1). In electronics, an ADC is a device which converts an analog signal like current and voltage into digital code (binary form). What is ADC (Analog to Digital Conversion)ĪDC stands for Analog to Digital Converter.
