PDA

View Full Version : problems on power up of PIC



dmairspotter
- 11th June 2006, 22:28
Hi all

I have a project using the PIC 16F876A. I'm having a problem with that appears to be the program memory resetting or erasing randomly on power up.

I'm using a wall wart at 12 vdc to power up the system. An LM340AT produces 5v for the processor, which is fed through an on-off toggle switch to the PIC. I have a .1mfd decoupling cap between +5 and ground at the PIC.

I program the chip, and the device works fine. Power it on or off several times OK. Then it will cease working. Using my Epic programmer and Micrcode studio plus to verify the program it shows either all 0s of 3FFF instead of program. Device reprograms OK. Ive tried different chips witrh same result. Problem seems worse if I leave the switch on and unplug and plug the 12V power supply, which makes me suspect transients.

I have MCLR tied to 5V with a 3.3k resistor.

Any ideas or power supply design tips greatly appreciated! This problem is a project killer!

Thanks

BobK
- 13th June 2006, 01:14
Hi dmairspotter,

I think you may want to put a few more capacitors on your circuit. Put a 10uF on both sides of the voltage regulator along with .1uf caps. Put a .1uf from MCLR to ground. Then try your power off and on again and see if this doesn't clear things up for you. It probably wouldn't hurt to also put a 100uf on th inout side of the voltage regulator also.

BobK

Pic_User
- 13th June 2006, 01:55
Hi dmairspotter,

Do you think the power-up sequence might be accidentally putting the 16F876A into the "Low Voltage Program" mode. Then programming garbage into the PIC.

Make sure to turn the "Low Voltage Program" option off when you program the 16F876A

PIC16F87XA FLASH Memory Programming Specification
http://ww1.microchip.com/downloads/en/DeviceDoc/39589b.pdf

See: 2.4.1 LOW VOLTAGE ICSP PROGRAMMING MODE
When RB3 is driven to VDD from ground, the PIC16F87XA device enters Programming mode.

-Adam-

malc-c
- 13th June 2006, 09:48
I have MCLR tied to 5V with a 3.3k resistor.

I tend to use 10K for pull up resistors.. don't know if that makes much difference but might be worth a try

Acetronics2
- 13th June 2006, 10:17
Hi all

I have a project using the PIC 16F876A. I'm having a problem with that appears to be the program memory resetting or erasing randomly on power up.


Any ideas or power supply design tips greatly appreciated! This problem is a project killer!

Thanks

Hi,Dmair

I use Pics abord R/C systems ... supply is always "not so good , yeah ..." I then solved the problem with an external Brown out device like MC 33064P5 ...

No more startup, cutout or "glitches" problems ... cause reset is strongly tied low until Power is in the correct range !!!

In your explanation ... I didn't see any "big" capacitor ( > 200µF )... between Reg and PIC. ... just an idea ...

Alain

dmairspotter
- 13th June 2006, 14:11
Thanks for all the input. I did try some small (.1-.2 mF) caps at the in and out of the reg. On the in side, seemed to help. On the out, seemed to aggravate the problem. I will check the LV programming and try adding some more/bigger caps. Thanks again.