Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com 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.

MCLR issue in PIC16F887(Main Line Neutral is connected to 5V ground)

Status
Not open for further replies.

deepshah3

Junior Member level 1
Junior Member level 1
Joined
Jan 30, 2018
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
161
Hi there,
I am facing an issue of MCLR reset in my PIC16F887.I have connected the connected the recommended components as per the datasheet, at the MCLR pin. I am using this chip in a product where we are sensing the mains input voltage. We have used a 12V SMPS to give supply to 7805 to generate the 5V for PIC16F887. However, the circuit is such that the main line Neutral is connected to the 5V ground. Is it possible that, this neutral to 5v ground connection, is creating some problem due to which the MCLR reset occurs?
 

Hi,

No. I guess it's a PCB layout problem. Do you have a really solid GND plane?

Klaus
 

What exactly is the 'MCLR problem' that you are having? And how do you know that this is the problem?
By 'recommended components as per the datasheet'I assume that you mean Figure 14-2. What are the actual values you are using as the figure only defines minimum values for the resistor and the capacityor is optional.
Do you also have an ICSP connector and is the programmer/debugger attached?
Susan
 
Hi,

No. I guess it's a PCB layout problem. Do you have a really solid GND plane?

Klaus
No there is no ground plane on the PCB. Is it necessary to have a ground plane in the PCB?
I have used the same chip in another circuit where the PCB does not have a ground plane. The only difference being that there is no connection between the mainline neutral and the 5V ground and it is working perfectly.
--- Updated ---

What exactly is the 'MCLR problem' that you are having? And how do you know that this is the problem?
By 'recommended components as per the datasheet'I assume that you mean Figure 14-2. What are the actual values you are using as the figure only defines minimum values for the resistor and the capacityor is optional.
Do you also have an ICSP connector and is the programmer/debugger attached?
Susan
The problem I am facing is that the controller resets on its own after sometime, once the circuit is powered ON.
I have used 10k resistor pullup and 104 capacitor pulldown at pin1(MCLR) and I have also connected a 2k2 resistor in series at the pin1(MCLR).The reason to use the series 2k2 is that I was previously using pic16f877a in which the datasheet recommended the use of a series capacitor at the MCLR pin.
No the programmer is not connected with the circuit.
 
Last edited:

Hi,

No, there is no need for a GND plane.
But - especially for not that experienced people - a GND plane is the more simple and the more reliable solution. It brings much more benefit than you know by now.

If you don´t follow
* signal and return path considerations
* low impedance routing
* small enclosed area of a current loop
* and so on
a circuit surely can work. Mainly by accident.
Is it reliable? Does it work when there is a cellular phone around? or Wifi or any other HF sources...or when the refrigerator switches ON/OFF

Single board traces are like spiderwebs in the wind. Spiderwebs do work. Spiders do know how to build and how to use them. But I like the idea of a solid ground.

Klaus
 
No there is no ground plane on the PCB. Is it necessary to have a ground plane in the PCB?
I have used the same chip in another circuit where the PCB does not have a ground plane. The only difference being that there is no connection between the mainline neutral and the 5V ground and it is working perfectly.
--- Updated ---


The problem I am facing is that the controller resets on its own after sometime, once the circuit is powered ON.
I have used 10k resistor pullup and 104 capacitor pulldown at pin1(MCLR) and I have also connected a 2k2 resistor in series at the pin1(MCLR).The reason to use the series 2k2 is that I was previously using pic16f877a in which the datasheet recommended the use of a series capacitor at the MCLR pin.
No the programmer is not connected with the circThe r
No there is no ground plane on the PCB. Is it necessary to have a ground plane in the PCB?
I have used the same chip in another circuit where the PCB does not have a ground plane. The only difference being that there is no connection between the mainline neutral and the 5V ground and it is working perfectly.
--- Updated ---


The problem I am facing is that the controller resets on its own after sometime, once the circuit is powered ON.
I have used 10k resistor pullup and 104 capacitor pulldown at pin1(MCLR) and I have also connected a 2k2 resistor in series at the pin1(MCLR).The reason to use the series 2k2 is that I was previously using pic16f877a in which the datasheet recommended the use of a series capacitor at the MCLR pin.
No the programmer is not connected with the circuit.
The controller was getting reset after operating normally for sometime. Since the mainline neutral is connected to the 5v ground, I thought some spikes might be causing the MCLR pin to go low which was causing the reset. That is the only reason I thought it is a MCLR reset.
--- Updated ---

Hi,

No, there is no need for a GND plane.
But - especially for not that experienced people - a GND plane is the more simple and the more reliable solution. It brings much more benefit than you know by now.

If you don´t follow
* signal and return path considerations
* low impedance routing
* small enclosed area of a current loop
* and so on
a circuit surely can work. Mainly by accident.
Is it reliable? Does it work when there is a cellular phone around? or Wifi or any other HF sources...or when the refrigerator switches ON/OFF

Single board traces are like spiderwebs in the wind. Spiderwebs do work. Spiders do know how to build and how to use them. But I like the idea of a solid ground.

Hi,

No, there is no need for a GND plane.
But - especially for not that experienced people - a GND plane is the more simple and the more reliable solution. It brings much more benefit than you know by now.

If you don´t follow
* signal and return path considerations
* low impedance routing
* small enclosed area of a current loop
* and so on
a circuit surely can work. Mainly by accident.
Is it reliable? Does it work when there is a cellular phone around? or Wifi or any other HF sources...or when the refrigerator switches ON/OFF

Single board traces are like spiderwebs in the wind. Spiderwebs do work. Spiders do know how to build and how to use them. But I like the idea of a solid ground.

Klaus
Yes the circuit works well. I have not experienced any issues with mobile phones or wifi.
But I would surely consider having a ground plane in PCBs now onwards.
 
Last edited:

The ground connection to mains can play a role, not on its own, but it can promote noise injection if the circuit has cables of some length connected or the board a certain size. A continuous ground plane would be preferred but it's not absolutely necessary. Power supply bypass and reset filter capacitors should have short traces connecting to processor ground, better use multiple meshed ground traces.
 
The problem has solved for now.
I was using a 100uF capacitor at the output of 7805, but I changed it to 470uF. After that, the circuit is working properly and the controller is not getting reset.
Thank you for your time and replies everyone!!!
 

Hi,

good to see it works now.

But honestly I don´t think that the increased capacity is the solution. I rather think it´s the lower ESR.
My idea: maybe even a 10uF tantalum could also work.

You may be happy with the solution now.
But don´t be surprised when it fails tomorrow, or fails when a cable is slightely moved, or when you operate the circuit in another room.

I still recommend to use a solid GND plane in future. It saves for a lot of trouble.

Klaus
 
The main reason for that capacitor is to slightly delay the raising of \MCLR\ above the release voltage when the power supply is being applied - this holds the chip in reset until a little after the voltage reaches a usable level.
Therefore increasing the capacitor will hold the chip in reset a little longer.
However, in this case it is also probably acting as a smoothing capacitor on the power line and that is taking off the low spikes that was previously triggering the reset.
All this comes back to making sure that the power supply is clean which is probably the root cause of your problem.
Susan
 
Hi,

good to see it works now.

But honestly I don´t think that the increased capacity is the solution. I rather think it´s the lower ESR.
My idea: maybe even a 10uF tantalum could also work.

You may be happy with the solution now.
But don´t be surprised when it fails tomorrow, or fails when a cable is slightely moved, or when you operate the circuit in another room.

I still recommend to use a solid GND plane in future. It saves for a lot of trouble.

Klaus
Sure.
I will try the changes in the new PCBs.
 

i think problem is with your 12v smps, ensure that the 12vdc power supply is isolated. placing 470uf is not a good solution, check to see
whether there is continuity b/w main neutral & 7805 regulator GND with digital multimeter. if problem still occurs use another 12vdc smps.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top