Microchip's _MCLR pull-up cct

Hi

I've a relative newbie to electronics and PIC microcontrollers in particular. I'm trying to design a cct using PIC16F628A.

I'm looking at the Microchip mid-range PIC document (DS31028A-page28-4), and this shows a diagram of how to isolate VDD from VPP when the ICSP connector is connected.

The diagram consists of VDD connected to a resistor (R1) and a capacitor (C1). Between the capacitor is a diode(D1) which is connected (normal bias) to _MCLR/VPP and the ICSP connector. A second connection is made from VDD to the VDD pin via resistor(R2) on the PIC and ICSPconnector.

(anybody care to show me some ASCII cct drawing tools?)

I understand that D1 protects/isolates the main cct from the +13v VPP when programming.

My questions are;

1) D1 is referred to as a Schotky diode in the document. Can somebody explain what one is, and recommend a model number for me to use. 2) Also, no values are given for R1, R2 and C1. I assume 'cos they can't possibly know the capacitance of a third party cct, but can anybody recomend good starting values for these? I can give you a pointer to my circuit on the web if you'd like to see the cct. Should C1 be a tantalum cap or electrolytic, ceramic or what? 3) I don't use any of the other programming pins for my application to make life easy, but my cct has another component which fires off a data burst to my PIC periodically. I assume this won't affect the PIC while it's being programmed? Or should I isolate the entire cct from VDD via a dip switch or something to be sure?

Thanks Mark

Reply to
MarkMc
Loading thread data ...

A Schottky diode is one of a class of 'hot-barrier' diodes and they are used because their forward voltage is typically 0.2-0.3V for small signal type devices. This is to make sure MCLR discharges quickly. There's no protection required if MCLR is connected only to a reset signal.

You should not need to isolate this pin beyond the typical schematic shown in the manual.

Typical devices for this sort of application might be the MMDL770T1 from On Semi (nee Motorola SPS)

formatting link
Get a parametric table of devices by searching for schottky diodes. You want low Vf, Low If (forward voltage, forward current) and fast recovery is preferable.

You only need the full RC circuit for a slow rising Vcc system.

This is from DS31003A (Mid range PIC reference manual)

**Figure 3-3 shows a possible POR circuit for a slow power supply ramp up. The external Power-on Reset circuit is only required if VDD power-up time is too slow. The diode, D, helps discharge the capacitor quickly when VDD powers down.**

A slow rising input is defined in that manual as < 0.05V/millisec.

If you have a slow rising Vcc, then MCLR should stay low until Vdd is valid. That occurs at around 2.5V, but I would suggest making sure it holds off until Vdd is about 3V.

You need to calculate the RC pair, and for this you first need to define your power. Let's say it's 1V/millisec. That means we don't want MCLR to go above ~75% Vdd until at least 3 milliseconds later. A delay of 10msec would work for a good conservative circuit. (It also simplifies the mathematics).

1xRC is about 63% Vdd, and we'll use that as it's close enough if we extend the time a little. The listed VIH for MCLR (the input voltage at which a high is guaranteed to be detected) is 0.8VDD.

So RC >= 0.01 Choose a resistor (Microchip suggests

Reply to
PeteS

Thanks very much for enlightening me Pete.

Very much appreciated.

I'm using the _MCLR pin straight to VDD (supplied by a 7805 vreg), but also it connects to an ICSP +13v supply for programming. Sorry for being dense here, would this mean that I do or don't need the diode set-up?

If not, should I still have, say a 0.1uF tant. cap between VDD and gnd, right next to the PIC IC?

Cheers, Mark

Reply to
MarkMc

You need the diode to block the Vpp(+13V) from powering up the rest of your circuit and potentially killing some parts by applying excessive voltage to them. I suspect that they used a Schotky(sp?) or "hot carrier" diode just for the low voltage drop feature (.2 - .3V) just to keep MCLR as close as possible to Vcc.

gnd,

If you'd like, it shouldn't harm anything. You would probably only need that if glitches/spikes were likely on the Vcc that might result in a device reset.

Reply to
Anthony Fremont

Well, the diode is there to make sure that the MCLR pin doesn't exceed Vcc during power down. If you have a fast falling Vcc, then the cap/res pair will hold MCLR high without the diode, exceeding the rating of the device and powering the rest of the chip through the input protection diodes (this is generally not a good thing [tm]). I would normally have the diode there for protection against transients anyway, but ICSP requires that you do not have the diode that way.

Look at the application diagram on page 28-4 of the previously referenced manual. There is a diode there (make it a schottky again so that when MCLR is powered by Vcc you aren't 0.6 - 0.7V below Vcc, but

0.2 - 0.3V below) but this time to isolate the power supplies (we call this diode OR'ing, by the way). In this particular circuit, assuming Vpp is not present, then the diode will still discharge the cap at normal Vcc power down, not exceeding about Vcc + 0.3V at the MCLR pin, so you still get the device protection.

You should bypass the device, but I would suggest a 1-10uF ceramic as esr dominates ripple performance, and ceramics have outstanding esr ratings (typically below 10 milli ohm - I have seen them as low as 1 miili ohm). I don't see a need for bulk bypass beyond that - the maximum current is Icc + I (IO), so you should be in the order of 10s of milliamps. Note that using a ceramic like this means you don't have to also have a small value ceramic (which you would need with a tant, unless it's one of the later ones), and tantalum has it's own problems (highly toxic if they overheat for whatever reason). During programming, the current is higher, of course, but not that high.

Hope that helps

Cheers PeteS

Reply to
PeteS

You might find the information in this free PIC book useful: Getting started with PIC microcontrollers, by Fred Stevens a PDF can be downloaded from here:

formatting link

see page 18 for a disussion of component sizes for the RC circuit.

HTH,

B.C.

Reply to
Bill Carson

The diagram on page 28-4 was the diagram that first prompted my post.

Forgive me for asking, I'm not an electronics professional, but what does "BYPASS" mean? is this the normal capacitor for protecting against ripples and spikes going in to an IC? I've always been told to use a 0.1uF tant. capacitor for this due to their speed to react. I'm pretty sure I read this in a PIC book once too. I'll happily learn some other way, but I'm not sure I fully understand.

Cheers, Mark

Reply to
MarkMc

Bypass is, as you assume, to deal with local voltage variations due to the chip itself. As the chip operates and switches it's outputs (and its inputs are changed), the device uses more or less current, and this shows up as noise on it's power pins (there are lots of reasons for this, including the nductance of the bond wires from the die to the pins of the device).

Bypassing is used to combat this noise, and we usually talk of it in two ways:

Bulk bypass. This is a fairly large capacitor used as energy storage for those sudden increases (and decreases) in current. Large variations in current a long way (electrically) from the regulator sense point can have dramatic voltage fluctuations - bulk bypass is used for this.

Signal bypass: This is to eliminate (well, minimise) the noise on the power lines due to high speed switching of the device.

Note that these two do overlap considerably; high speed switching can also have large current variations associated with it, although we try to minimise that in really high speed stuff by using (almost) constant current devices (and that's another story entirely).

I am sure tantalums were recommended because their performance is superior, electrically, to electrolytic capacitors. As I noted above, tantalums have their own issues though. Modern ceramic capacitors have up to 100uF at 6.3V in a 1210 package (I know, I've used them - check out this panasonic part : ECJ4YB0J107M), have superior performance to a tantalum (lower esr, better ripple current performance, better temperature characteristics) for general bypassing.

This is not to say tantalums are not widely used - I use them myself as part of the loop filter in some LDO supplies which require my output ESR not be *too* low (Look carefully at the datasheet for the National LP3961 for an example).

That's the quick explanation.

Cheers

PeteS

Reply to
PeteS

Thanks Pete, that helps clear things up. I'm enjotying learning about this stuff. Let me see if I'm getting this. I should use ceramics (100uF?) in close proximity to all of the IC's (PIC being one of them) in my cct.

Should I put a tant. (0.1uF) on the 5v regulator too? (78L05)?

Cheers, Mark

Reply to
MarkMc

You should have a bypass cap for the 7805 (I assume it's powering a few things, such as the I/O devices) - about 10uF is a good rule of thumb for light loads.

Use a 0.1 - 1uF cap for the PIC.

If you use ceramics, that's all you should need.

Cheers

PeteS

MarkMc wrote:

about

them)

Reply to
PeteS

That's great, thanks for all your help Pete

Reply to
MarkMc

dis one is da bomb.

formatting link

Reply to
niftydog

That's perfect, thanks niftydog.

Cheers, Mark

Reply to
MarkMc

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.