View previous topic :: View next topic |
Author |
Message |
daveh Guest
|
|
Posted: Tue Mar 18, 2008 9:49 pm |
|
|
I should also note that RB0/INT is connected through a 1Mohm resistor to ground and through a switch to Vdd. Maybe 1M is too large? |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Mar 19, 2008 4:47 am |
|
|
Quote: |
MCLR is connected through a 1M resistor to Vdd. Maybe that's too high?
|
Yes, it is too high! Try with 10K...47K and let us know.
In the Configuration Register change PROTECT by NOPROTECT, at least in this stage.
Humberto |
|
|
daveh Guest
|
|
Posted: Wed Mar 19, 2008 6:28 am |
|
|
Quote: | In the Configuration Register change PROTECT by NOPROTECT, at least in this stage. |
I’m curious how leaving the code unprotected would help? |
|
|
__baltazar__ Guest
|
|
Posted: Wed Mar 19, 2008 8:01 am |
|
|
I know you are trying to conserve your cell charge but the manual recommends <40k pullup on the MCLR pin . I used 100k i n one of my projects before and it still worked fine. Try changing the MCLR pullup or use the config register to enable the internal pullup. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Mar 19, 2008 8:36 am |
|
|
Quote: |
I’m curious how leaving the code unprotected would help?
|
Lets assume that he is still in development stage, hence there is no any reason to
protect the code, unless he likes to play burning uChips
Humberto |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Thu Mar 20, 2008 8:30 am |
|
|
It would be very interesting that who started the consultation, kindly get a time to close it,
showing the obtained results, in such way that it would be shared by others members.
This thread is a clear example: No one of us knows which was the final result of the tests.
While there is not a final or conclusive commentary, everything is diluted and this does not
contribute that others could learn from this experience.
After all, this expected feedback is one the goal of an open forum.
Humberto |
|
|
gjs_rsdi
Joined: 06 Feb 2006 Posts: 468 Location: Bali
|
mclr |
Posted: Thu Mar 20, 2008 7:20 pm |
|
|
I had such a problem in a high emi system with ac motors.
10uf capacitor to ground with 10k resistor to vcc on mclr solved the problem.
Best regards
Joseph |
|
|
__baltazar__ Guest
|
|
Posted: Thu Mar 20, 2008 11:51 pm |
|
|
Quote: | It would be very interesting that who started the consultation, kindly get a time to close it,
showing the obtained results, in such way that it would be shared by others members. |
I agree with Humberto. Posting goes with some responsibilty. But let's say that daveh is just busy trying to get answer from other forums But it seems we really have zoomed in into the correct root cause
Quote: | I had such a problem in a high emi system with ac motors.
10uf capacitor to ground with 10k resistor to vcc on mclr solved the problem. |
But gjs_rsdi, I am curious whether you put another series resistance between your pullup /capacitor junction and the MCLR pin to limit the discharge current? |
|
|
gjs_rsdi
Joined: 06 Feb 2006 Posts: 468 Location: Bali
|
reset |
Posted: Fri Mar 21, 2008 4:50 am |
|
|
Sorry, I forget. 100 ohm in series to mclr befor the c/r junction.
I am also enabling always the power-up delay. Is esential (in my opinion) in any heavy emi/rfi environment.
Humberto, Baltazar you are right. Not writting how the problem solved, not nice.
Best regards
Joseph |
|
|
daveh Guest
|
|
Posted: Fri Mar 21, 2008 7:59 am |
|
|
Sorry for the delay I didn't have a chance to implement the suggestions till just now. Ok, I tried switching the pull-down on RB0/INT to 10k and also changed the pull-up on MCLR to 10k. Neither one seemed to make a big difference. Thus far the biggest impact was adding the NOMCLR fuse (clearing MCLRE).
I do have the PUT enabled as well.
Quote: | Lets assume that he is still in development stage, hence there is no any reason to
protect the code, unless he likes to play burning uChips
|
Humberto, maybe I'm missing something obvious. If I'm doing ICSP doesn't it take as long to program a chip that's code protected as one that isn't? Excuse my ignorance but I'm not sure how not code protecting is helpful.
Thanks for all the great feedback thus far. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Mar 21, 2008 9:42 pm |
|
|
Sorry Dave it was not a good advice.
In Flash devices, using NOPROTECT will require a bulk erase before every programming
cycle. From this point of view, it is better (faster) to keep CODE PROTECT enabled.
In these devices the Configuration Register is a EE memoy type, allowing a non permanent
process, unlike those early "windowed JW" devices where the Configuration Register
were made in PROM memory type, a "true irreversible fuse".
The actual name used by CCS to set the Configuration Register, - the preprocessor directive
#FUSES - is a direct derivative of this.
Humberto |
|
|
Praful
Joined: 18 Jun 2012 Posts: 23
|
hangs by spike |
Posted: Mon Jun 25, 2012 1:18 am |
|
|
Dear all members,
I facing a same problem in my ckt. A relay is operated by 16f887 and that relay operates a contactor which handles 2kw load, but sometimes the PIC hangs when the load on/off simultaneously. What can I do ? |
|
|
RHA
Joined: 25 Apr 2006 Posts: 31 Location: Germany
|
|
Posted: Mon Jun 25, 2012 1:43 am |
|
|
In the past i have made some projects where port pins are directly connected to a connector to the outside and i made some easy steps to face the problems with ESD :
Disable MCLR-Pin in config fuses.
Connect MCLR over 22k to +5V and over 10nF (ceramic) to GND. The components have to be placed as near as possible to the chip.
A 100nf (ceramic) between +5V and GND as near as possible to the chip.
A 1uF (ceramic) as near as possible to the voltage source.
10nF (ceramic) and 5V TVS-Diodes (for example PESD5V0L1BA) in parallel to the capacitor between static signal lines and GND.
Pull-Ups on unused port pins or drive them as output to GND.
GND lines on the PCB as big as possible. On 2 Layer PCBs connect both layers in signal GND as often as possible.
With this configuration i can simulate the ESD with a ESD-Pistol up to 15kV to the port pins on the outside and have no problems. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Jun 25, 2012 3:28 am |
|
|
A comment:
MCLR, is one of the most 'dangerous' pins on the PIC for spikes.
Because it acts as the reference input to the Vpp generator, it has no form of protection clamping at all. It will happily shoot up above the supply rail, and when it does, triggers a reset (though you should have to pull MCLR 'down' to get a reset, when it goes 'up', it's first action is to trigger a reset, before it rises to the point where programming stuff starts to happen. In this region (between Vdd, and the start of the programming area), it's input impedance is very high, so it rises easily.
Now, the protection diodes on (most) other PIC inputs, should be thought of as 'line of last resistance' defenses. Relying on them to save you, is like standing in front of an oncoming car, holding up a sign saying 'stop'.
Generally, start by adding protection where signals come into the board. Options, are things like small capacitors, across buttons, followed by a resistor in the wire from the button to the PIC. This way when a spike occurs it'll tend to route 'down' the capacitor, and the current flowing into the PIC pins is limited by the resistor. Other option, transorb components across the switch pins. These go conductive when the voltage rises above their rated voltage, and again tend to route the spike to ground. On the MCLR pin, add your own protection diode from this to Vdd, and use a little capacitance on the pin as well. Remember also, that if a signal is routed through a diode, it passes to the supply rail, so there must be local capacitance on the rail to limit how much this rises.
RHA, is 'spot on' here, especially with the reference to ceramic capacitors. It is important to understand that 'bigger is not necessarily better' when dealing with capacitors for handling spikes. Things like electrolytic capacitors have really poor performance, when dealing with the very fast rise times of a spike like this. If you look at the design of things like PC motherboards, and phones, where manufacturers are trying to save every cent, you still find literally dozens of small capacitors spread round the board, close to inputs, and every chip that potentially generates noise as it works. These are _essential_, or the manufacturer would be getting rid of them to save money....
Best Wishes |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Jun 26, 2012 6:32 am |
|
|
I would like to emphasize adding resistors between the PIC pin and the rest of the circuit. Use as high a resistance as the circuit impedances will allow. These resistors are almost as important as the capacitors. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
|