PDA

View Full Version : MCLR causing trouble . .



shahidali55
- 13th December 2007, 16:59
MCLR pin of 16F84A too sensitive.
I've explained the problem on the post linked below . . .
http://picbasic.co.uk/forum/showpost.php?p=47611&postcount=32
Now i think its the MCLR pin of the IC that is causing trouble.
I've given this pin to a 10k resistor and then to Vcc.
Now even if touch the Vcc grid, the IC resets or 'locks up'.
How can i resolve this ? ? ?

Dave
- 13th December 2007, 17:08
shahidali55, What type of filtering do you have on the VCC and VDD lines to the processor? Also is brown out detect enabled?

Dave Purola,
N8NTA

shahidali55
- 15th December 2007, 07:31
Hello Dave
F84 does not have BOD . . .
I have used a 100uF cap at the input of 7805 and a 1uF at output.
The schematic is like the one below
<center><img src="http://josepino.com/pic_projects/led_clock/JP6282.gif" alt=" Led Clock Schematic "></center>
The processor resets randomly or just locks up . . .
I'm using a electronic 12v adapter to power it (SMPS type).

Melanie
- 15th December 2007, 08:25
Because you don't have Resistors to the Common Anodes, if you switch-ON any LED segment for more than a few mS, the current draw will be sufficient to deplete the 1uF Capacitor and your supply will be marginal for operating the PIC.

I suggest three changes...

1. Increase the 1uF to 10uF
2. Put 180R Resistor in each Common Anode
3. Put a 100nF Capacitor between Vss and Vdd as close to the PIC as possible.

Jerson
- 15th December 2007, 11:16
The schematic has some serious flaws as I can see

1) As it stands, the switches can seriously damage the A & B segment outputs as the supply is directly connected to the port. If the segment is logic 0, it directly shorts the supply to the port pin which may blow the pin or simply short the supply (your reset issue lies here).

Way out?
1) The cathodes need series resistors of around 100 Ohms.
2) A 100n capacitor between VDD and VSS directly across the PIC
3) Lots of b/cheer ?

shahidali55
- 17th December 2007, 12:18
Ok, now i have a 100uF capacitor at output of 7805, .1uF directly on to PCB between Vcc and GND. I have already put 120ohm resistors in series with common anodes, the anodes and cathodes are being driven with transistor buffers.
The PIC resets if i just touch any part of the Vcc grid with a screwdriver in my hand.
(Also kept it running and it reset after around 3 hours)
I tried using a 16f628A, same problem even if i disable MCLR at programming...

Jerson
- 17th December 2007, 17:09
I have modified the circuit as it should be. It is remarkable that you can reset your cpu by touching VCC. Please mod the circuit as I've shown and let us know how it goes. The resistors shown are all 100 Ohms.

mister_e
- 17th December 2007, 17:15
Are you using a breadboard??? any chance that there's faulty/loose contact on?

Any chance you have some splitted +/- tracks. mmm maybe a picture would help to explain better
<table><tr><td>http://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Breadboard.svg/218px-Breadboard.svg.png</td><td>What i mean is that sometime the supply line on some breadboard brands
have a break in the middle of their +/- line.

On the picture, you observe that red and blue line are not continuous,
This said, don't use it as a reference...


What i suggest is just do a continuity test on each breadboard + and - tracks between
each edge (say point 1 and 57).

might be one cause here...</td></tr></table>

PCB and DIP socket? any chance the Vss pin is broken underneath the socket... yeah it happen...

Are you living close to Area 51, Hangar 18?

shahidali55
- 20th December 2007, 14:12
Thanks for the info . . .
I've now got 120 ohm resistors in series with the segment pins.
The buttons are given to a 1K then to GND, internal pullup enebled.
I'm using pref board. Checked for loose contacts. Did find one but that didn't solve the strange reset problem.
The IC is resetting when i just make a light touch on the MCLR pin.
The MCLR pin is given to Vcc through a 10k resistor.
I've got another clock using the very same circuit and it doesn't reset that easy.
Could this be due to ESD ? ? ?

The clock also has a battery backup.
<img src="http://www.delabs-circuits.com/png_circuits/embedded/battery-backup.png">
Pin 3 is used to monitor the mains input. (it is given to the output from the 5v reg ,and not the output of battery backup ,through a voltage divider network).
Could the battery backup be causing a problem ?

Jerson
- 20th December 2007, 14:32
Is your power supply based on a transformer or is it one of those low cost capacitive coupled power supplies? I am suspecting that it is the latter one. Then your talk of ESD makes sense. The best option for you to get any valid answer is to post your entire schematic including the power supply. Without that, all answers will be conjecture.

JF

shahidali55
- 21st December 2007, 12:20
I'm using a SMPS power supply. (from a PC).
Connecting GND to the case of the XTAL solved my problem.
I've never had such a problem before and have no idea why giving GND to case of XTAL solved it . . .
Thank you everyone for helping me out . . .