Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

My PIC project "reseting"

Not open for further replies.


Member level 2
Dec 9, 2006
Reaction score
Trophy points
Activity points
I have been built a simple digital clock using PIC 16F877A. The software was developed in the CCS compiler (C language).

First, I made the software to count only the seconds. All running ok. Then I changed the software to count the minutes and hours and since this modification my PIC is reseting after some minutes or hours (there is no specific time to get reset, can in any moment).

This project was in a proto board and now is in a PCB, but the problem still persists.

See below the PIC fuses I used:


Please, how can I do to repare this fault?

Make sure that you master clear pin is connected to VCC using a 10K resistor and a 100nF capacitor to GND.


Bom dia leomecma,

I put the resistor and the capacitor in the MCLR pin, exactly you told me.

This problem appeared after software modification only. There was not hardware modification.

I read that the CCS compiler can create a code that the result can be a reset in the PIC. Is it possible?


Today I turned on the light of my office (where the PIC project is running) and the PIC did a reset. So, I tried several times to turn on the light and the PIC did the resets several times.

In my house, the power line is 220VAC (127VAC bi-phase) and to supply the PIC I use a power supply made by LM317 with good filters.


it seems GND or MCLR problems. If you are using a protoboard verify your connections...


Put a capacitor accross your MCLR pin to ground! OF course mechanical switches like your light can cuase huge spike on control lines of digital circuitries.

try 0.01uF


As you are in development phase, I suggest the following:
Put a resistor of 47K to VCC. This action will not have negative efects.
Internally, the program starts 100-200 ms later than VCC reached 5V.
When do you decide buid a pcb I suggest put a IC-reset choosen for 80% of VCC, but if you don't want this you can leave the resistor between RESET and VCC.

Note: What is value of XTAL that are using? Remenber that if you XTAL is > 4MHz you should use as fuse HS (see note in CCS ).


I solve my problem.
The cable between PIC and the programmer was connected and an EMI was entering by this interface.
After I unplug this cable during equipment running, there was no reset.

Thanks all!!

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to