MCLR

Thread Starter

ching fong kee

Joined Jun 23, 2010
42
in PIC
Pulling the MCLR pin low, will reset the CPU

i'm very confusing with this
by clicking the Button that is connected to the MCLR , it will reset the PIC
then why it is not pulling the MCLR to high ?

 

BMorse

Joined Sep 26, 2009
2,675
you need to have a pullup resistor (10K) connected from MCLR pin to Vcc (+), then have the switch connected to MCLR and Ground(-), when the switch is pressed it will pull MCLR low to reset pic, when you release the switch, MCLR will be pulled back high via the resistor.

B. Morse
 

Papabravo

Joined Feb 24, 2006
22,082
I could be wrong, but don't some PIC parts have an internal "pullup" connection to VCC? Especially on parts where MCLR is a multi-function pin.
 

t06afre

Joined May 11, 2009
5,934
I could be wrong, but don't some PIC parts have an internal "pullup" connection to VCC? Especially on parts where MCLR is a multi-function pin.
Microchip do have something they call weak pull-ups. That can be enabled separately via a register. The current is about 250uA at 5 volt for typical non low power variants. How this implemented may vary. Like you may not find it on every port. Then the MCLR is enabled this option will be turned on automatic. At least for the chip I am using most of the time.
Edit: Not all PIC MCUs do have this option
 
Last edited:

tom66

Joined May 9, 2009
2,595
It's also important to note that the weak pull up on MCLR is usually, if not always, a configuration option, and requires rewriting of the flash to change.
 

BMorse

Joined Sep 26, 2009
2,675
this will be my PIC circuit.

MCLR looks to be connected properly, but why is the base of the NPN transistor pulled high? It should be pulled low so the transistor stays off until you set the I/O (RB4) high....

Since the circuit seems to be wired correctly, now lets see the code to see if you have MCLR configured properly to be used as a Master Reset...

B. Morse
 

t06afre

Joined May 11, 2009
5,934
Your circuit looks OK regarding the reset button. A explanation why reset is active low may be this. Then a digital input is not connected to anything (a term named floating) it will most probably sense a high input level. To avoid false trigging, it is often more preferable to use active low for such important signals.
 

BMorse

Joined Sep 26, 2009
2,675
This could causing the latch up on the MCLR pin when the switch is pressed:

Voltage spikes below VSS at the MCLR pin, inducing currents greater than 80 mA, may cause latch-up.
Thus, a series resistor of 50-100W should be used when applying a “low” level to the MCLR pin rather than
pulling this pin directly to VSS.
So it may be wise to add the series resistor between the switch and VDD.

B. Morse
 
in PIC
Pulling the MCLR pin low, will reset the CPU

i'm very confusing with this
by clicking the Button that is connected to the MCLR , it will reset the PIC
then why it is not pulling the MCLR to high ?
I can send the MCLR PIC ckt. for Reset for High pull, send ur mail ID.I can send the attachment if you have Express PCB Free Software installed on ur Computer.
 

tom66

Joined May 9, 2009
2,595
Just take a screenshot, use the PrtScrn key on your keyboard and paste it into any good image program; if you're on Windows, then Paint will be adequate. Try and save it as a PNG since it's a screenshot.
 
Top