electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

pic's mclr pin problem.


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> pic's mclr pin problem.
Author Message
seyyah



Joined: 07 Oct 2001
Posts: 578
Helped: 1


Post21 Apr 2004 15:57   

pic mclr


This pin is very sensitive. Even i touch this pin with a screwdriver, pic resets. In my circuit i connect this pin to 5V via a 10K resistor. I also connect a 100n capacitor parallel to this pin. But if something happens in ground (for example turning off a relay), pic resets. How can this be possible. When i take out the capacitor there is no problem. Can anyone explain me how mclr pin goes to zero while a capacitor is connected? what can i do to prevent this? Is it possible or suitable to use pic without this capacitor connected to mclr pin. Is it safe? Are other mcus are as sensitive as pic to the effects like this one?
Back to top
E-design



Joined: 01 Jun 2002
Posts: 947
Helped: 68


Post21 Apr 2004 16:02   

mclr connected 44 pin


The newer pic's like the 16F628A have an option to use the internal power-up timer (all pic's have one according to a uchip note) and thus no need for the external circuitry like in the older 16F84A.

I remember a friend of mine once having a similar problem when switching relays and by putting an additional resistor (few kOhms) in series with the MCLR pin to the cap was able to overcome this problem.

Here is a document about reset and causes which might not address your problem by name, but still good reading

http://www.microchip.com/download/lit/suppdoc/toots/reset.pdf


Last edited by E-design on 21 Apr 2004 16:55; edited 2 times in total
Back to top
tgq



Joined: 15 Jul 2002
Posts: 305
Helped: 2


Post21 Apr 2004 16:38   

pic mclr cap


maybe you have bad (too close) PCB tracks ?
Back to top
hugo



Joined: 01 Jan 1970
Posts: 286
Helped: 27
Location: canada


Post21 Apr 2004 17:22   

mclr pic


Hi,

What do you mean by : "I also connect a 100n capacitor parallel to this pin."
There is no need to have a capacitor to MCLR pin!!!
You have to connect 100n capacitors parallel with power supply only!!!

Hope it help!

Bye


Last edited by hugo on 21 Apr 2004 21:33; edited 2 times in total
Back to top
kcmohr



Joined: 21 Apr 2004
Posts: 2


Post21 Apr 2004 18:59   

microchip mclr


I agree with Hugo. I use a 10k pull up w/ no cap. Set the fuses for PUT (power up timer) and BROWNOUT. Else, you can use a uprocessor supervisor and be sure to NOT USE, PUT and BROWNOUT.
Back to top
mrcube_ns



Joined: 10 Apr 2002
Posts: 429
Helped: 11
Location: Dark side of the Moon


Post21 Apr 2004 20:24   

sensitive mclr pin


First: Try to put that capacitor (usualy 100n ceramic) as close as you can to supply pins of pic.

Second: if there are sparks when reley go off you have to make distance between rele and mcu (or made some kind of metal rooms in box where all project are mounted).


Regards.



Mr.Cube
Back to top
seyyah



Joined: 07 Oct 2001
Posts: 578
Helped: 1


Post21 Apr 2004 21:11   

does mclr need pullup?


To hugo: I mean i connected a cap to mclr pin. One of its leg is connected to mclr and the other is to ground. I see this configuration everywhere. This ensures that the pic won't be resetted due to the transients, i think.
But it made the opposite effect which causes a reset. I wonder how this mechanism works?...

I take the ground side leg of the capacitor out and it worked good until i touched with a metal. When i touch this leg (unconnected leg of the cap)with a metal it resets again.

Then i connected this leg to the VSS of pic. I also connected a small cap between vss and vdd and changed 10k resistor with a 4.7k resistor.
And it doesn't reset now.

So do you have any comment about the reason of this event? I rather wonder, what happens when i touch the unconnected pin of the capacitor that causes the voltage level at the mclr pin goes down and results in a reset?
Back to top
wessoms



Joined: 15 Jan 2002
Posts: 17


Post21 Apr 2004 23:44   

microchip pic mclr pin esd


The reason why is because the 100nF cap will pass the negative transient spike from the ground to MCLR when the relay changes states. The current thru the 10K resistor from VDD to the MCLR pin is not enough to keep the transient spike from pulling the pin LOW. There for a resest happens. When you increased the current to the MCLR pin by lowering the resistance to 4.7K the problem went away. Hope this answers the question.
Back to top
papyaki



Joined: 13 Apr 2002
Posts: 564
Helped: 19
Location: A small village somewhere in Gaul


Post22 Apr 2004 7:58   

mclr supervisory circuit


Hi

As said E-Design in his previous post, Microchip recommand to put a serial resistor between the capacitor and MCLR pin. The recommanded value is comprised between 100ohm and 1kohm to avoid ESD/EOS value.

See the diagram page 26 of the following document :

h**p://www.microchip.com/download/lit/pline/picmicro/families/16f8x/35007b.pdf

They also provide app note AN607 :

h**p://www.microchip.com/download/appnote/pic16/00607b.pdf
Back to top
btbass



Joined: 20 Jul 2001
Posts: 1187
Helped: 113
Location: Oberon


Post22 Apr 2004 9:25   

mclr decoupling capacitor


Sounds like you have bad decoupling on your supply rail. Have you got a 100nF cap right next to the pic supply pin, and good decoupling on your relay supplies?
Back to top
sam_manchali



Joined: 14 Jun 2003
Posts: 105
Helped: 3
Location: sharjah


Post22 Apr 2004 15:19   

filters for mclr


hi,
i have also experienced this problem, but i think u need to have a free-wheeling diode across the coil of the relay. Idea
i am quite sure this will work. The pic resets as the coil, when s/w on and off causes a back emf , which disturbs the gnd. u dont need a good pcb or a 10k with cap on th eMCLR pin, i normallyu pull it directly to Vcc.

Smile
sam
Back to top
lguancho



Joined: 07 Jan 2004
Posts: 266
Helped: 5
Location: Singapore


Post23 Apr 2004 9:23   

filtering the mclr pin


Hi. Did you try to power your pic and relay separately? Also, does your pic device has "BROWNOUT" mechanisim? Maybe you could try to deactivate it.
Back to top
Google
AdSense
Google Adsense




Post23 Apr 2004 9:23   

Ads




Back to top
simce



Joined: 09 Jan 2004
Posts: 195


Post23 Apr 2004 10:40   

caps on mclr should


Here is my experience that solves most of these problems:
1. You must use "star" topology for power distribution across pcb that has MCU and relays.
2. You must use inverse polarized diode connected parallel to relays coils.
3. If contacts of relay passes high current it is very advisable to use snubber circuit parallel to contacts and to put relays far from PCB on which MCU is mounted.
4. Use separate galvanic isolated supply for MCU and relays.
5. Use 100ohm-1k pull-up resistor on MCLR pin.
6. If you made good PCB use 100nF capacitor between MCLR and GND.
7. Use inductors, and pi filters in power supply filters, and use more 100nF capacitors parallel to first filter capacitor after the input diode bridge.....

These are basic precautions that has to be obeyed, there are also more things to take care of, but if you obey this things you have 90% chance to make good MCU driven relay system.
Simce
Back to top
seyyah



Joined: 07 Oct 2001
Posts: 578
Helped: 1


Post23 Apr 2004 17:55   

microchip mclr resistor capacitor


To simce: i've done all of these except 4 and 7 and it didn't solved the problem.

To all: The only thing solved the problem: When i connect the capacitor's ground pin to pic's ground pin, it didn't reset again.
Relays diodes are connected. I tried to connect serial resistor(220 ohm) to cap of mclr it didn't work. I redesigned the ground to put mcu and relays far away from each other. I cancelled the brownout. I connected more capacitors and small capacitors and tantalum capacitors. I tried all of the your recommendations. May be they have some help but if the cap is connected but its ground isn't connected to pic's ground then there is problem. If cap isn't connected than there is no problem.
Back to top
simce



Joined: 09 Jan 2004
Posts: 195


Post23 Apr 2004 19:05   

pic mclr capacitor


Have you tried to increase capacitor that follows diode bridge after transformer. It has to be at least 4700uF!.
With 2x4700uF i controlled 10 relay for contact current of 10A each.
Anyhow you solved your problem! But turning Brownout is not a good idea!
Simce
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> pic's mclr pin problem.
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
14 and 20-pin PIC's (1)
ICD2 Clone MCLR problem (5)
pic16f676 mclr input problem (4)
MCLR in PIC16F88 (5)
mclr/vpp (7)
PIN switch problem? (6)
CPLD pin problem (6)
Pin assignment problem!!! (4)
spartan pin LOC problem (7)
Lattice pin fitting problem (3)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS