Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16F628A reseting Problem

Status
Not open for further replies.

Suraj143

Active Member
Hi! I have a small project done in PIC16F628A.But I’m having a resetting problem sometimes.

It means when power up the PIC it is not resetting immediately. Sometimes it takes about 10 mins to reset, so I have to wait until that time to see the circuit working.

Can somebody tell me a way to reset the PIC smoothly when power up?

Here is my fuse settings.

Code:
Oscillator = XT

WDT	=off	
PWRT	=off
MCLR	=off
BODEN	=off	
LVP	=off
CPD	=off
CP	=off

I didn’t use a pull-up resistor for RA5 (MCLR).I kept that pin free. (Earlier I placed that resistor but no progress.) Also I never use a decoupling capacitor 1uF near the PIC.

Here is my initialization code.

Code:
	movlw	0x07		;turn off comparators
	movwf	CMCON

	bsf	STATUS,RP0
	clrf	TRISB		;make all PORB pins output
	movlw	b'11000'	;RA3,RA4 inputs
	movwf	TRISA
	bcf	STATUS,RP0
	goto	MAIN

Do I need to add a DELAY before the main program starts to solve this problem?
 
Is it relatively easy for you to change the BODEN setting and test to see if it makes a difference? You may also want to try changing the PWRT setting.
 
hi suraj,
Is it possible that your crystal oscillator is not starting up?
Some crystal cuts require additional caps.

You should have decoupling capacitors on the PIC's power rails.
 
Suraj143 said:
I didn’t use a pull-up resistor for RA5 (MCLR).I kept that pin free. (Earlier I placed that resistor but no progress.) Also I never use a decoupling capacitor 1uF near the PIC.

You do need a decoupling capacitor next to the chip, although not 1uF. Try using a 0.1uF or 0.01uF ceramic type.

Also set PWRT in config, it will introduce a startup delay of about 70ms to give your power supply enough time to reach 5 volts before starting the program.
 
OK guys I'll give a try adding a decoupling capacitor also I'll turn ON the fuse settings in PWRT & also BODEN.
 
The XT mode is suitable for frequencies up to 4 MHz. If you're using a higher frequency crystal, select the HS mode.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top