View Single Post
  #1   Spotlight this post!  
Unread 29-06-2006, 01:18
sciguy125 sciguy125 is offline
Electrical Engineer
AKA: Phil Baltar
FRC #1351
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Sunnyvale, CA
Posts: 519
sciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond repute
Send a message via AIM to sciguy125 Send a message via MSN to sciguy125 Send a message via Yahoo to sciguy125
microcontroller picking up noise?

I'm having a problem with a microcontroller project that's driving me insane. I've got a PIC18F4455. In an attempt to find the source of the problem, I've stripped it down to a very megar setup. The controller has power, its oscillator, a reset button, and an LED. When it starts up, it turns on the LED and just sits there. Now, if I connect anything that's also connected to the wall socket, it messes up. The LED either dims or turns off completely. I think the dimming is a result of high speed flickering though.

For instance, if I attach my oscilloscope probe (even just ground) to any part of the circuit, the controller flakes out. Also, if I use a wall transformer with a voltage regulator for power, putting my hand close to certain parts of the breadboard makes the LED go out. Touching the metal back plate of my board (which I have verified to be isolated from the circuit) completely puts out the LED. If I touch the back plate and circuit ground, everything is fine. If I run the circuit on a battery only however, it works fine. Just keeping the ground (the negative terminal) from the transformer in makes it flakey again. My multimeter, which runs on batteries, doesn't affect the LED.

At the moment, I'm using a 20MHz crystal and the PLL to get the clock to 48MHz. Bringing down the clock speed (either by internal dividers or using a slower crystal) does very little. I even went as far as trying the internal 8MHz oscillator (but I didn't try it at lower speeds).

I did discover that turning off brown out detection (which will trigger a reset if the power drops below 2.0V) makes it less sensative. With it on, the scope probe causes the LED to go out completely. Without brown out detection, it just dims (presumably flickering). This makes me believe that the controller is in fact resetting for some reason. However, my multimeter claims that the power is fine. The scope, which causes the controller to misbehave, also claims that the power is fine, but there's some noise. Adding capacitors cleans it up though. The caps only make the problem slightly better. After the first cap, additional caps don't make any noticable improvements.

Here's another point. If I can successfully connect the scope without the controller freaking out, the crystal has a nice sine wave. When the LED is out, the crystal is 0V. When the LED is dim, the crystal has some strange almost-square waveform with noise in the latter half of the high period. I haven't figured out if the crystal problems are because the controller is resetting or if the noise in the crystal is forcing the controller to reset. I suspect the former though.

I've narrowed down the problem to having something to do with the power line. I've tried different outlets at home and they all do the same thing. At work, however, the problem doesn't exist. I work in an ESD lab, so they may have some sort of special filtering or grounding that I don't know about. The technicians suggested some sort of noise at my house. I have yet to find the exact problem though. If I can't figure it out in the next few days, I'll make it a point to hunt down one of the engineers and see what they have to say. In the mean time, are there any ideas around here?
__________________

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GE/S/P a-- e y-- r-- s:++ d+ h! X+++
t++ C+ P+ L++ E W++ w M-- V? PS+ PE+
5- R-- tv+ b+ DI+++ D- G
------END GEEK CODE BLOCK------