Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Cutoff frequency of lowpass filter for AVcc

+2
−0

The ATmega16U2 datasheet suggests putting an external lowpass filter from Vcc (the digital supply) to AVcc (the analog supply).

Image_alt_text

However, the datasheet doesn't specify what type of lowpass filter (passive/active, RC/LC) should be used, neither does it specify the cutoff frequency fc. Here is my current schematic where I have used a an RC lowpass filter with fc = 159 Hz (schematic still in progress). Is this a good value?

Image_alt_text

What determines the filter type (passive/active), and what determines the cutoff frequency for the lowpass filter in this situation?

History

0 comment threads

3 answers

+4
−0

I see Andy has already given a good answer about part values and rolloff frequency. I'll therefore try to explain why and what I usually do.

A digital circuit where signals are either slammed low or high can tolerate some noise on the supply. For example, it would usually be OK to power logic gates from a 3.3 V supply produced by a buck regulator switching at 100 kHz. The supply might ripple as much as 100 mVpp, but such levels won't usually bother the digital circuit. Outputs will still be held solidly high or low, and inputs can still unambiguously distinguish between high and low.

Analog circuitry is different. Noise from the power supply can end up on analog signals. That's bad since the information they carry is the specific signal level. For example, 100 mV uncertainty on a 3.3 V signal means the signal only carries 5 bits of information in its voltage. If you could reliable measure it down to 1 mv, then it could carry over 11 bits of information.

Some analog chips, like most opamps, have deliberate circuitry to try to make the internal signal levels immune to power supply ripple. However, this can only go so far. This is quantified in something called the power supply rejection spec. Active power supply rejection only works up to some frequency. More of the power supply noise makes it onto signals as the frequency gets higher.

In the case of an A/D in a microcontroller, the digital output value really indicates what fraction the input was to the A/D reference voltage. If that reference has noise on it, then the digital output will have noise on it proportionally.

To get the specs quoted in the datasheet for the micro's A/D, you have to hold AVdd and the A/D's reference steady. The datasheet you quote dumbs this down to say to put a filter from Vdd to AVdd. It doesn't really matter how you achieve clean AVdd, but it probably can't be too far off from the Vdd level. Specifying a low pass filter is a simple way to do that without spending a lot of time writing the datasheet.

The low pass filter from Vdd to AVdd needs to:

  1. Squash the noise on Vdd so that AVdd is a clean level to the extent you care about. For a 10 bit A/D for example, the noise should be less than 1 part in 1000, preferably half that.
  2. Keep the AVdd level close to the Vdd level. Things can break internally, or at least not function correctly, when there is too much of an offset between the two. The datasheet should give you AVdd limits relative to Vdd.

The reason your 10 kΩ resistor is bad is because of point 2. Only 100 µA draw on AVdd would cause a whole volt offset. That's probably too much, and also makes the AVdd level dependent on the AVdd current, which actually adds noise.

You should be able to see that the characteristics of the low pass filter from Vdd to AVdd depend on what noise is on Vdd, and how clean AVdd needs to be. That varies from design to design, but usually Vdd is well regulated at DC. Noise on Vdd usually comes from a switching power supply if one is used to make Vdd, and from current transients drawn by digital circuitry as it switches. Both those are usually "high" frequency. You are generally not worried about 1 kHz or even 10 kHz noise, but around 100 kHz and up.

In the end, it's usually impossible to know the particulars to design a specific filter. What I do is something that should be "good enough" in most ordinary cases. Here is a typical example from a real commercial product:

The 5.7VIS input so the 3.3 V linear regulator comes from a flyback power supply across an isolation barrier. It is somewhat noisy, and its level only regulated to within a few 100 mV. The linear regulator (IC13) cleans it up a bit and produces a more steady and accurate 3.3 V for powering the digital section of the microcontroller (IC14).

L6 and C61 form the low pass filter to make AVdd even cleaner than Vdd. L6 is a 0805 "chip inductor" of 950 nH and 600 mΩ. With 600 mΩ series resistance, 10 mA of AVdd draw will cause only 6 mV of offset from Vdd. The LC rolloff of 950 nH and 10 µF is 52 kHz. Note that the RC rolloff is even lower, at 27 kHz. This filter will start attenuating noise at 30 kHz, and then attenuates more sharply at around 50 kHz. By 100 kHz, there is significant attenuation from three poles, with a slope of 18 dB per octave at higher frequencies.

Sometimes I use two such LC in series and higher capacitance if there is more noise around or the signal needs to be extra clean. The 1.2 Ω series resistance needs to be considered, but that's usually not a problem.

History

0 comment threads

+3
−0

Is this a good value?

A 10 kΩ resistor in series with AVCC won't cut the mustard at all. AVCC does draw current (PLL and ADC for example) and, this can be several mA so, an inductor is needed (along with capacitor C2 in your diagram). Typically something like 10 μH appears to be recommended.

An inductor will barely drop any DC voltage at all; it should have a resistance of maybe less than 1 Ω to a few ohms so, if 10 mA were drawn by AVCC, the DC volt drop would be a few tens of mV maximum. Choose the inductor so that it remains inductive into the MHz region. All inductors become capacitive above their self resonant frequency so, it's important to choose a high value for SRF.

what determines the cutoff frequency for the lowpass filter in this situation?

For an LC filter (the type recommended), the cut-off frequency formula is this: -

$$F_C = \dfrac{1}{2\pi\sqrt{LC}}$$

So, for 10 μH and 100 nF, the cut-off frequency is 159 kHz. You can use this calculator to help you with other value combinations. You should also factor-in what power supply spectral noise you have and maybe choose a higher value of inductor and capacitor.

Because an LC network like this can "overshoot" the output voltage when the incoming supply rises quickly, you might consider adding a zener diode across the AVCC rail and GND/0 volts.

Personally, I would test this by using a simulator.

History

0 comment threads

+1
−0

Another option entirely is to add a voltage reference IC. There are two flavours of those: "series reference" and "shunt reference". Simplified, the former is a linear regulator of sorts and the latter is a zener diode of sorts. An article from AD here: Series or Shunt Voltage Reference?

As noted in the article there are a few subtle differences between the two making them more suitable in certain cases. But no matter which one you pick, you can go with one that's slightly below the ordinary VCC supply of the MCU. Most often the ADC pin is specified to not tolerate higher voltages than the main supply, but you can usually go far lower. Depending on the nature of the voltage you are measuring of course.

For example, for 5V supplied MCUs with 12 ADC, it is common to pick a voltage ref with 4.096V, since that would be an even divisor of 212 leaving you with a handy unit of mV in the software.

History

0 comment threads

Sign up to answer this question »