Internal microcontroller ADC

Many microcontrollers contains internal on-chip ADC. Typical devices would be Atmel Atmega series microcontrollers like Atmega8 and further. Internal ADC are successive way to integrate analog world in to your embedded systems using only one microcontroller die. Many applications doesn’t require high speed or high accuracy ADC conversions, thus on-chip ADC is best choice.

Lets look at Atmega8. It contains 10-bit approximation ADC with analog input multiplexer of 8-single-ended input voltage (refers to 0V) channels.

Atmega microcontrollers have separate analog supply voltage pins – AVCC (Atmega8 has known bug – digital and analog grounds are interconnected inside chip).

Reference voltage is provided inside chip. It is nominally 2.56V or AVCC. AREF pin is used to decouple voltage reference by a capacitor for better noise performance.

The reference voltages nay be selected between:

  • Internal reference 2.56V;

  • AVCC (must not differ from VCC more than ±0.3V);

  • Or reference voltage can be connected to external pin AREF.

If we have 8 bit ADC, then our conversion would look like this:

Digital Code=(Vin/Vref)x256

Lets say we use 5V reference and we measure 3.2V input signal. So result:

Result=(Vin*256)/Vref=(3.2V*256)/5V=163=0xA3

Jus remember, that on-chip ADC accuracy isn’t perfect. Atmega8 datasheet states that absolute accuracy is ±2LSB. This means that last two bits gives gives an error. So same our calculated result may vary it can be like 0xA0 or 0×0xA2 …

Another issue is supply voltage stability and accuracy. Let us say that voltage is 1% higher than we expect. It would be 5.05V. Then our calculation will give:

Result=(Vin*256)/Vref=(3.2V*256)/5.05V=162=0xA2

So 1% change in voltage will change conversion result in one bit. Typically voltage may vary by 2 or 3%.

The voltage variation may occur because of supply source instability, temperature changes, loads. It is hard to avoid this. But absolute accuracy can be increased by selecting external ADC like MAX1242.

Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post
 |  TrackBack URI for this post

New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,
Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …
Programming AVR ADC module with WinAVR,
Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut …
New on WinARM Tutorial
What are differences between WinARM and WinAVR,
Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …
LPC2000 watchdog timer,
As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount …

Leave a Reply