Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] AVR Power Supply Noise

2006-07-10 by Larry Barello

I recently fought with some AVR CPU malfunction and it had NOTHING to do
with power supply noise.  The target system was a mega128 with a 16 mhz
resonator.   The symptoms?  Oh, the stack pointer would randomly be off by
one.  Or it would just start executing code at random locations, most often
off in empty flash which would just NOP (0xFFFF) until the PC wrapped and
the code restarted (I knew this was the case since there was *no* reset
source at the start of my code - it never reset).

The problem, it turned out after much investigation, was having the CKOPT
fuse cleared.  That puts the crystal driver into a very low power mode and,
apparently, noise in the system (the biggest problem was a brushed DC motor
controller) was causing extra clock cycles which were way too fast for the
CPU to keep up with.

Anyway, checking the CKOPT fuse and reprogramming the chip solved the
problem.  The signal at the resonator was ~4v pp vs 200mv and the code is
rock solid.


-----------
Larry Barello
www.barello.net


| -----Original Message-----
| From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
| Of Zack Widup
| Sent: Monday, July 10, 2006 9:30 AM
| To: AVR-Chat@yahoogroups.com
| Subject: Re: [AVR-Chat] AVR Power Supply Noise
| 
| On Mon, 10 Jul 2006, behrooz_hariri wrote:
| 
| > I connected a car battery (12v) to LM7805 to fully minimize power
| > supply noise. But still get errors in executing codes.
| > I read a film capacitor 0.1uF is necessary after regulator. I used
| > electrolyte one 0.15uF.  Does it make difference?
| >
| 
| Electrolytics aren't the best things for bypassing RF.  Since a value of
| 0.1 uF or so is meant to keep RF out of the chip's power leads, you might
| do better with a different kind of capacitor.
| 
| Make sure you put it as close as you can get to the supply and
| ground pins on the AVR chip.
| 
| > I use a breadboard with some wire rather twisted and 10cm long. Is
| > this a reason for MCU malfunction?
| >
| 
| Possibly. Breadboards are notorious for coupling between
| wires/connections.
| 
| There are quite a few development boards out there that are made to get
| around this problem.
| 
| Zack
|

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.