I'm using an 18F2550 and have been struggling to keep it running. This is what happens: I program the pic, plug it into the bread board and it runs great. If I shut the pic off with a switch in my circuit, it won't start running again. If I remove the pic from the bread board and plug it back in, with power on it will take of again. I spent more time than I care to admit trouble shooting the external XT settings ( I was looking at the signal using a scope, when I turn the power off and back on the 4 Mhz XT wasn't starting ). Turns out the Pic is getting lost in a brown out.

The cause: I'm switching power off to Vdd on the pic, PortA.0 still has an analog signal and PortA.1 has a digital signal. With power off, I measure 2-3 volts on the pics Vdd pin. Enough to make an LED glow dim. So when I remove Power from Vdd, the pic enters a brown out, but not enough to reset the default 2 volt BOR config.

What I did: I set the brown out to hardware control and set the brown out reset at 4 volts. ( which is the min Vdd for the 18F2550 ). Now when I switch power on and off the pic starts and runs fine, most of the time, still seems to be a little glitch now and then.

My question: I verified that Vdd was getting power from PortA.0 and PortA.1, if I remove these inputs the low voltage on Vdd goes away. I can see my digital signal on Vdd if the analog signal is removed. Am I crazy thinking that this shouldn't have been something I had to fight with? There is a possibility that the pic will have voltage on the analog pin before Vdd when the entire circuit is powered up, I'm concerned that the pic may not start correctly if it get's lost to the "dark side" and enters the brown out lockup I have been working with.

Is there other settings I should configure? Do other models of Pics have this same issue? I've searched the forum and didn't find anything like this, I may have missed it?

By the way, thanks for all the other great posts out there, there were enough solutions for other problems that I was able to figure out how to find the settings I needed in the 18F2550.inc and P18F2550.inc files. If I read the 18F2550 manaul any more I may go crazy!

Thanks from a newbie,
Shane