PDA

View Full Version : PIC doesn't start witout scope



Tobias
- 25th April 2010, 04:07
16F876A, I have a 1500 uf cap in front of an AP1084 5v regulator. On the 5v side, I have a 470uf cap. There are 24 1/4hp motors on the 12v side. They create alot noise so thats why I run the large value caps. Here is the deal, on power-up, quite often a PIC doesn't start. I couldn't figure out what was going on. Then I thought I needed to reprogram PIC, as soon as I connected the programmer, the PIC started. The next time it happened, I thought I would trace things out with my scope. As soon as I touch the scope lead to the MCLR pin, the PIC started again. Once it starts, it will keep going. I would say 75% of the time, I need to jump start with my scope.

Any ideas? What is happening to MCLR when I touch it with my scope? Maybe a cap on the MCLR line?
Thanks
Toby

idtat
- 25th April 2010, 04:18
Schematic?

Tobias
- 25th April 2010, 04:27
Here you go

mackrackit
- 25th April 2010, 04:55
What happens if you turn the MCLR diode around?

Archangel
- 25th April 2010, 20:07
What happens if you turn the MCLR diode around?
Good call Dave. Is MCLR even a needed function ? Perhaps turn it off in the configs. . . just thinking out loud, if you are controlling motors, maybe an E-STOP and full reset would be safer ?

mackrackit
- 25th April 2010, 20:16
MCLR OFF is not an option for that part. Would be nice if it was...

Agreed about the full reset. Could save some problems down the road.

rsocor01
- 25th April 2010, 21:56
Good call Dave. Is MCLR even a needed function ? Perhaps turn it off in the configs. . . just thinking out loud, if you are controlling motors, maybe an E-STOP and full reset would be safer ?


Good catch. Yes, Tobias definetely needs to turn that diode around or it won't work. He can even damage other components in his circuit with the ~12V going to Vpp from the programmer.

I have a design with a 16F727 where I use a diode and a 4.7k resistor connected to MCRL. Now, reading Joe_S post I just realized that I don't really need this two extra components in my design. In the 16F727 you can configure pin 1 as MCRL or as RE3.

Robert

Tobias
- 26th April 2010, 14:33
Guys I appreciate the input and I realize that I have the diode drawn backwards in the schematic compared to the board. The PIC doesn't even program if the diode is backwards.

The question I have is what happens when I touch the MCLR line with the scope? When I do that, the PIC starts up. Thats the weird deal. I am back at my office now and am going to swap out diodes. Maybe there is just a problem with the diode.

I will let you know what I find.

Thanks again

rsocor01
- 26th April 2010, 15:14
Guys I appreciate the input and I realize that I have the diode drawn backwards in the schematic compared to the board. The PIC doesn't even program if the diode is backwards.

The question I have is what happens when I touch the MCLR line with the scope? When I do that, the PIC starts up. Thats the weird deal. I am back at my office now and am going to swap out diodes. Maybe there is just a problem with the diode.

I will let you know what I find.

Thanks again

Yes, that's weird. Sometimes I forget to remove the programmer from my circuit and when the programmer is off and connected to the circuit my PIC won't work. So, in order to make my PIC work I need to either turn the programmer on or disconnect it from the circuit.

In your case, what voltage are you feeding MCRL with? Are you sure you are getting this voltage at MCRL? Try replacing the 4.7k resistor also. Try connecting an inductor in series with the 4.7k resistor or a 0.1uF capacitor from MCRL to ground close to the MCRL pin to eliminate posible noise.

Robert

Acetronics2
- 26th April 2010, 17:41
Hi,

the 876 is not so easy with its reset pin ... ;) I have numerous examples ...

I always use MC33064P5 TO92 supply supervisors and never have any power up problem.

a good habit is always enable the Brownout option ... 75% of problems off !!!

Alain

Archangel
- 26th April 2010, 17:57
I have not checked the data sheet, Does this PIC have PWRTE available, and is there ANYTHING else on that circuit which could pull the line to less than VDD ?

Tobias
- 26th April 2010, 21:49
VDD/5v is going to MCLR. The hard thing is I can't figure out the 'state' of the pin when it doesn't start because right when I touch the scope to the MCLR line the damn thing starts, lol.



Yes, that's weird. Sometimes I forget to remove the programmer from my circuit and when the programmer is off and connected to the circuit my PIC won't work. So, in order to make my PIC work I need to either turn the programmer on or disconnect it from the circuit.

In your case, what voltage are you feeding MCRL with? Are you sure you are getting this voltage at MCRL? Try replacing the 4.7k resistor also. Try connecting an inductor in series with the 4.7k resistor or a 0.1uF capacitor from MCRL to ground close to the MCRL pin to eliminate posible noise.

Robert