MCLR as reset on 12F657

Status
Not open for further replies.

k7michal

New Member
I'm implemanting the MCLR as a reset switch; I have a 910k resistor tied high (5V) and a grounding push button switch.

For the most part things seem to be working okay, but when I copied the same .hex into other 12F675's some of those chips are not working... The program will boot properly but when I reset it, it seems to hang!

I've tried tieing a 0.01uF cap from the pin to ground but that doesn't help?

Just wondering if anyone else ever had similar issues.

Thanks in advance.
 
Use a 10K pull up resistor & change the fuse setting to MCLRE.

And another method configure GP3 as MCLR_OFF & add a reset switch in series with the 5V VDD line.

So you can add another input switch to your GP3.
 
Last edited:
I saw on a schematic once that some one use a 1M resistor for the MCLR pull up. It seemed to make sense to use as little current as possible.

I just tried a 100K and I got the same results. will try the 10K now. And last resort, the switch in series.

So yeah, I have this one chip 12F675 that works perfectly, and a fresh batch of chips with the exact same code are giving me problems. Is it possible that these things have to be broken in? heh heh
 
k7michal said:
I saw on a schematic once that some one use a 1M resistor for the MCLR pull up. It seemed to make sense to use as little current as possible.

It's just a pullup resistor, it doesn't use any current - except when you press the reset switch - so it doesn't make sense!
 
so I tried the 10K and on one of my older chips I have to press and hold the reset switch for a good 2 sec in order for it to reboot. *strange*, and the one chip that works as it should uses the 910K resistor...

I tried the new batch of chips with the 10K and those new chips from DigiKey cannot reset, even if I hold for 2 sec.

right now I'm holding them on a grounded bread board, thinking they need to discharge?
 
also.. a copy of the .asm if you don't feel like deciphering none tab delimited format.

**broken link removed**
 
yes, it's a 5V set up....

Code tags? I'm not sure what those are, but I do have little ";explanations" for most major parts.

try the link it's much better. **broken link removed**
 
To add your code in a box like that...
Code:
	CLRF	DCNT
	BCF	STATUS,C
	INCF	CNT1

	MOVF	CNT1,W		;counting to 3, on third count goto LOOP1 and flash LED.
	ADDLW	0XFD
	BTFSS	STATUS,C
	GOTO	FINISH

you just need to type

[code]

Paste your code here

[/code]

do you have any schematic of your current project?
 
Last edited by a moderator:
Shouldn't;
MOVLW 0XD0 ;GLOBAL EN,PERIPHERAL EN, GP2/INT EN.
MOVWF INTCON

Be the last thing you do before entering the;
MAIN SLEEP
GOTO MAIN

Loop? If you enable interrupts before all variables are initialized, then unpredictable behavior will result.
 
First thing, change the 100k to 10k thru 22k
second add the all important and often omitted 0.1uf cap between pins 1 & 8
third use a 330 ohm resistor in series with the LED (omit the 2.2k)
forth omit the 100K on the switch and enable the GPIO pullups

Try that.

If you just want to see if your PIC is OK then check out my Inchworm Hello world poster in the download section. (should be easy to mod the 12F509 code) and the schematic with 0.1uf led etc is there.
 

turns out this was the problem. now all the chips work perfectly even though there is a 910K resistor on the MCLR pin.

and I'll eliminate the 100K pull up, anything to reduce components/redundancy


Thank you all!!!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…