Spurious at PMW output ATmega328p

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I use an ATmega328p with internal 8MHz clock for PWM, the PWM filter consists of a 4.7uF capacitor an a 100k resistor.

After the filter I measure a spurious signal of 16MHz with a to high amplitude for my application.

Does anyone know what causes this an what can be done about it?

 

regards,

Bert

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try putting a 100nF capacitor across the 4.7uF capacitor to filter the high frequency.

 

With the 100K resistor, you have a somewhat high source impedance.

Are you using a proper scope probe?  10x setting?

How are you connecting the grounds - uC and scope.  Leads should be short.

 

With 100K and 4.7uF, you have a corner freq of ~0.33Hz.  Why so low?

What is the frequency of the PWM signal?  What attenuation is desired?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Schematic and a picture of your setup would help.

 

Jim

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks ki0bk for your reply but the conecction are straight forward like other who us PWM with the ATmega328p.

So, the PWM signal is pressent at pin 15 and from there just a resistor 100k and then a capacitor 4.7uF to GND.

I use a load resistor, 10k.

 

Bert

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The PWM filter was calculated with the tool at http://sim.okawa-denshi.jp/en/PW...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Be_logic wrote:
just a resistor 100k and then a capacitor 4.7uF to GND. I use a load resistor, 10k.

 

Your load resistor is to LOW!  try swapping the 10k/100k in the circuit and see what happens!

 

Jim

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What waveform do you get with no load -- "empty" pin?

 

If that result is a clean PWM, then you are indeed needing to change your load.  And then I'll suggest moderators move the thread to General Electronics.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I measure a spurious signal of 16MHz with a to high amplitude for my application.

Well how much sig do you measure?  2mv? If your cap is 4.7uF ceramic, it will do a good job at RF freqs...An Electrolytic will do next to nothing at RF.

 

Regardless of the cap, where do you gnd your scope leads...they can make a difference, and as mentioned the pickup probe lengths must be short, or you are making a loop antenna.

Short the probe gnd to the probe tip & wave it around your circuit...you'll probably see 16MHz pickup, even though the probe is shorted & also not connected to the board (you just made a loop antenna pickup).

 

With a 1Meg scope/probe, a 100k circuit resistor will lead to a voltage measurement drop (but this is not about that)...keep in mind.

 

How are you seeing 16MHz, with an 8 MHz clock?  Double check your observations.  Of course there are harmonics, but your scope is in the time domain, not freq domain...so a 3MHz squarewave will show as 3 MHz regardless  (even though it has many harmonics).  It could be some internal diode is acting like a nonlinear freq doubler, or your RC filter happens to allow some 16MHz harmonic through , but not 8MHz(unlikely)... I'd just double check your readings. 

When in the dark remember-the future looks brighter than ever.

Last Edited: Tue. Aug 21, 2018 - 06:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, Bert -

 

You need to understand an important fact about low-pass filters, generally, and RC low-pass specifically. The filter will NEVER (well, almost never) remove exactly all of the input high frequency signal. You can use better capacitors, for example, and it may make the high frequency "leakage" smaller but not zero. You reduce the high frequency component by some fraction of its original value, and (for simple filters, anyway) that fraction can be arbitrarily small but not zero. 

 

A second important fact is that, in a real circuit with real measuring instruments, there are all sorts of "parasitics". As a result, the simple fact of where you put your scope ground lead can make a huge difference in the observed signal. If you use a prototype board, especially one of those spring contact boards, it is at least an order of magnitude worse, if not more. 

 

The important question is: does the "signal" you observed matter?

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have watched after everything according to your advice, but I still have this signal (see the attachment) on the OC1A.

The top-top signal is too high for my application. PWM filter is now 100k and the capacitor is now 22uF.

But this does not, unfortunately, suppress the interference signal.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Be_logic wrote:
I have watched after everything according to your advice,
Be_logic wrote:
PWM filter is now 100k and the capacitor is now 22uF.

Not exactly everything:

theusch wrote:
What waveform do you get with no load -- "empty" pin?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Be_logic wrote:
The top-top signal is too high for my application.

Am I seeing the screenshot correctly -- the "problem" is a few millivolts?!?  Tell how that is "too high".  And a few millivolts can be coming from your measurement setup.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
the simple fact of where you put your scope ground lead can make a huge difference in the observed signal

Just to make a point of West Coast Jim's statement above!  Can you show us your setup, post a picture please, showing where the scope gnd is as well as the filter circuit.

 

Jim

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274