Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[AVR] adc power supply(linear or switching)

Status
Not open for further replies.

banner

Member level 1
Joined
Oct 6, 2009
Messages
35
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
iran
Activity points
1,529
hi
I have to implement an adc funcyion with microcontroller(using atmega16 adc), is it correct to drive the micro with switching power supply?or it may degrade adc function? is there any ripple rejection method inside the microcontroller for ADC power supply part?

thanks in advance
 

memarian

Full Member level 5
Joined
Aug 11, 2004
Messages
257
Helped
57
Reputation
114
Reaction score
34
Trophy points
1,308
Activity points
2,011
Hi,

it depends on your power supply filtering, but usually using a linear power supply is better and you can achieve better results. Normally in microcontrollers there is no internal ripple or switching noise rejection, (because it needs large capacitors or inductors (in Chip Scale)) , and usually they have an extra power pin for adc , so you can use external power supply filtering or even use a very precise reference regulator.

According to ATMEGA32 (i don't have ATMEGA16 datasheet at the moment), it has 3 adc/vcc related pins :

VCC : microcontroller power supply
AVCC : PortD+ A/D Power
Aref : A/D reference Voltage

According to datasheet : you should connect your AVCC to VCC Pin with a low pass filter.
You should connect a capacitor between AREF and GND.(Near Aref Pin)

you can use Aref (internal 2.56V) or AVCC as ADC reference in your program. You may use ADC in noise canceler mode (depends on your program) which halts the main core during the ADC sampling to eliminates negative effects of internal clocks on ADC Sample.
 
  • Like
Reactions: banner

    banner

    points: 2
    Helpful Answer Positive Rating

David_

Advanced Member level 2
Joined
Dec 6, 2013
Messages
572
Helped
8
Reputation
16
Reaction score
8
Trophy points
28
Location
Sweden
Activity points
10,695
Hello.

Also relevant to this subject is what are you going to measure with the ADC?

Regards
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,157
Helped
4,068
Reputation
8,136
Reaction score
3,992
Trophy points
113
Activity points
119,757
Hi,

I agree with memarian.
I want to comment one point. Memarian suggests to use the internal VRef. This I see as one very important point.
When you use VCC as ARef, then every change in VRef will affect the ADC result.

Besides this try to keep GND pin current of the complete microcontroller low. While the top level of thd ADC is dtermined by VRef, the bottom level is determined by GND. From PCB gnd there is an impedanc to the internal chip gnd. Every gnd pin current causes ground bouce causing an error in ADC reading.

VCC or better AVCC - when not used as VRef - is not that critical. You may find in datasheet ADC chapter a PSRR specification. This shows how much a change in VCC wil change the ADC result.

Use a gnd plane.
Use capacitors next to the ADC inputs to filter out unwanted noise.

Usea scope (AC mode) to see the noise on VCC - with varying power consumption.Often you will see the bigger noise with low current consumption when the SMPS is in burst mode.

****
I just tested a self made PCB, where a switch mode DCDC converter is 10mm away from a 16bit ADC. Split gnd plane, filers and capacitors next to the ADC inputs make the 10ksmpl/s readings stable to +/-1Lsb. Some experience and some effort in PCB layout was useful.

Hope this helps

Klaus
 
  • Like
Reactions: banner

    banner

    points: 2
    Helpful Answer Positive Rating

banner

Member level 1
Joined
Oct 6, 2009
Messages
35
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
iran
Activity points
1,529
Hi,
actually i can not use internal Vref as the reference,because I want to measure 1-5volt.
 

memarian

Full Member level 5
Joined
Aug 11, 2004
Messages
257
Helped
57
Reputation
114
Reaction score
34
Trophy points
1,308
Activity points
2,011
Hi,
actually i can not use internal Vref as the reference,because I want to measure 1-5volt.
Hi,
You can use internal reference voltage and use a simple 1/2 resistor voltage divider in ADC input if it's possible. (use precise 1% or 0.1% Resistors),
But if you really want to use the same 5V VCC as Reference voltage use a low pass filter and place it near AVCC Pin.
 
  • Like
Reactions: banner

    banner

    points: 2
    Helpful Answer Positive Rating

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,157
Helped
4,068
Reputation
8,136
Reaction score
3,992
Trophy points
113
Activity points
119,757
Hi,

i fully agree with memarian.

Using a voktage reference instead of VCC is the way to go.
VCC is not to designed for low noise and low drift.

I always recommend to use an RC combination at each ADC input. With and additional resistor you have a voltage divider and you can measure 5V (and about any other higher voltage) precisely and reliably.

***

Klaus
 
  • Like
Reactions: banner

    banner

    points: 2
    Helpful Answer Positive Rating

David_

Advanced Member level 2
Joined
Dec 6, 2013
Messages
572
Helped
8
Reputation
16
Reaction score
8
Trophy points
28
Location
Sweden
Activity points
10,695
Hello.

I don't know if this is cost effective but to get a precise voltage divider one could use the LT5400, it contains 4 resistors in a 8-lead MSOP for 8USD.
The 4 resistors are of 2 different values(2 of each) in different ratios, though the absolute aaccuracy in resistanse might not be very good the matching between them are 0,01% for the better one and 0,025% for the cheaper one. Ether way the make for exelent voltage dividers for ADC measurements.

Regards
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,157
Helped
4,068
Reputation
8,136
Reaction score
3,992
Trophy points
113
Activity points
119,757
Hi,

It is a ATmeaga ADC with 10 bits resolution. Any precision better than 0.1% is overkill.

Klaus
 
  • Like
Reactions: David_

    David_

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top