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.

Using !MCLR for Reset

Status
Not open for further replies.

jpanhalt

Well-Known Member
Most Helpful Member
For such a simple pin, there is a lot of discussion on the Microchip forum and in Microchip application notes. Problem is, there is no consistency and even contradictions in varous Microchip documents.

A relatively recent thread on a Microchip forum (www.microchip.com/forums/m692754.aspx) presents this design:
upload_2014-11-26_11-59-21.png


Previously, I used a design with a Shottky protecting the 5V board supply from programming voltage. Well-known individuals on the forum were absolutely against any diode in the circuit. Second, I want to have a user accessible reset, and that is often used with a small capacitor (e.g., 0.1 µF) for debouncing. Moreover, an application note from Microchips suggests a small capacitor to hold !MCLR in reset for a short time during power-up.

What are your thoughts on that circuit? Specifically, will the 10K resistor provide adequate isolation of the capacitor during ICSP with an ICD3 programmer?

Regards, John
 
In the official MCHP ICD3 docs a cap is a no-no on MCLR but the PICDEM3 board uses a circuit like yours for a board reset.
https://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB_ICD3_Poster_51765a.pdf

I don't know exactly what the app note says but sometimes it's better just to have a simple RUN/PROG circuit/switch to select the user reset circuit with capacitor in RUN or the program circuit in PROG to the pin to eliminate complications and to do exactly what you want when you want.
 
I do not do ICSP but I have been using a reset like this for maybe 10 or 12 years now.

Implemented for quick building in a breadboard. No. 5 in the picture.

No more BB.JPG
 

Attachments

  • RAZ.pdf
    10 KB · Views: 461
nsaspook: Yes, there are inconsistencies with MC documentation.
atferrari: I used a very similar circuit to give a "smooth" reset while troubleshooting a glitch.

To paraphrase the question, will a 10K to 20K resistor give adequate isolation of the capacitor so ICSP will work well? The obvious option is a jumper that would be removed during programming. The well-known people on the MC forum said yes. But I am wondering about experience here, since even on the MC forum there was some disagreement among the top three (IMHO) of those well known's. MC is, surprisingly, silent on it. It is clear that without the isolation resistor having that large a capacitor is a no, no.

John
 
nsaspook: Yes, there are inconsistencies with MC documentation.
atferrari: I used a very similar circuit to give a "smooth" reset while troubleshooting a glitch.

To paraphrase the question, will a 10K to 20K resistor give adequate isolation of the capacitor so ICSP will work well? The obvious option is a jumper that would be removed during programming. The well-known people on the MC forum said yes. But I am wondering about experience here, since even on the MC forum there was some disagreement among the top three (IMHO) of those well known's. MC is, surprisingly, silent on it. It is clear that without the isolation resistor having that large a capacitor is a no, no.

John

The simple answer is yes it will work in 'most' cases but the devices are designed and guaranteed to meet full flash program/operation specifications within the full range of environmental conditions when programmed as per the official documentation.
 
I agree, it ain't broke, but that was not the question. The diode in the circuit provided by MC protects the target's components as follows (+5V is the target's supply rail):
upload_2014-11-26_15-26-58.png


The diode's purpose is not to facilitate the common use of a capacitor to debounce MCLR and help sequence POR, as shown in the circuit I posted. In fact, one of the questions on the MC forum specifically had to do with connecting the capacitor and grounding switch on the anode side of the diode. According to the helper on the forum, that location will not reliably reset the MCU, which makes sense to me.

John
 
The simple answer is yes it will work in 'most' cases but the devices are designed and guaranteed to meet full flash program/operation specifications within the full range of environmental conditions when programmed as per the official documentation.
Well then I should be OK. ;) Here is the POR circuit recommended by Microchip:
upload_2014-11-26_18-29-59.png


Source= DS31003A

As we have both noted, Microchip's recommendations for circuits do not take into consideration all other considerations it has published. I am not criticizing MC, but simply looking for other's experiences. My guess is that a 10K ohm isolation resistor in the circuit shown with a 13V VPP will only be 0.8 mA, which supposedly the ICD3 can handle. Unfortunately, VPP current capability is not published. The ICD3, however, has 100 mA of 5V for powering the target, compared to only 30 mA (if that) for the PK3.

John
 
I always looked at those things historically, i.e DS31003A was published in 1997 for example. Long before things like the ICD3 were brought to life. Surely just as the technology has moved on, so has things like Mchip's idea of how to best implement reset in an environment that will see the use of these newer technologies? Just my take on it :)
 
For development purposes I just use a 22k resistor to Vdd and if a reset switch is required a 1k+switch to Gnd. I also have a power indicator LED and this ensures that Vpp can never raise Vdd above acceptable levels. I have never had a problem that required a capacitor to fix it.

Mike.
 
Mike, Thanks for the hands-on advice.

At the time I started using an external reset circuit with a capacitor, I was having real headaches with non-reproducible starting. One thought was that it involved the starting sequence for the hardware EUSART receiver. At least it looked like that might be one factor. I changed that sequence and cleared all user RAM beginning at 0X20 and 0X70 at the beginning of the program. The problem disappeared. I am not sure the capacitor played a part, but the chip (16F1519) reset nicely using MCLR and that external circuit. Using some sort of protection on the switch to slow it down, like a resistor, was also one of the recommendations on MC's forum. Since fixing the start-up problem about three weeks ago, I haven't had a single program lock-up. I am now at the point of getting a revised board made in which I want to include a few improvements. I will try just the switch and resistor during a lull today.

tunedwolf: The very same circuit is shown in the 2014 version of the MC document on POR (AN607c, Figure 15). When I snipped the document last night, I didn't check the copyright date, since I was only interested in a source for the image and recognized it from the current version that applies explicitly to my chip, i.e., 16F1xxx.

John
 
UPDATE
Well, I am a little disappointed. I tried the following circuit and component combinations and could not get a failure to program. I erased, read PM, programmed and re-read PM . Everything looked OK, and there were no failure flags.
upload_2014-11-27_14-24-14.png


Without a positive control, I can't make any conclusion about the test. I was afraid to do something like 10 uF C1 and zero ohm R2 to see if a failure flag would even happen. Maybe I will try it tomorrow, if I don't have a headache. ;) Again, this was with an ICD3, not a PK3 .

I also tried just a switch and a 1K resistor on MCLR on the actual circuit, and it seemed to work fine.

John
 
The 10 kΩ resistor R2 isolates the capacitor from Vpp. A mentioned upthread, the programmer only has to driver 0.8 mA with that resistor in place, so it isn't surprising that the programmer was OK with it.

If R2 had been been lower or linked out, then the programmer would have to charge the capacitor quickly, and and you could get programming failures if the capacitor is too big.
 
Did you note the chart? I tried several R2's, the lowest was a short.

I am thinking of trying an R2 of 200 to 400R and a C1 of 47 uF tomorrow. Anything to give a positive control and force a slow increase in Vpp.

I also have a PK3 that I rarely use. It has a much inferior power supply, so it may show the effects more clearly.

John
 
Has anyone considered putting a scope on the /MCLR pin to see what happens with different resistor/capacitor values? I think that would put the issue to rest rather quickly. Unless the programmer has ridiculously high source impedance (which it obviously doesn't), it's hard to imagine there being a problem with the 10k isolating resistor.
 
Status
Not open for further replies.

Latest threads

Back
Top