I'm looking at putting my first PIC (16F877) project PCB together and I was wondering if I could steal some of all your wise experience on doing this. All the work I have done so far is using a purchased dev board (mikroelektronika EasyPIC).
1) Power Supply
Most of my designs will be based on a 12V ish supply. Whether it be automotive or desk based, 12V seems like a good figure. I was planning on using a 7805 regulator with a large elec & small ceramic cap in parallel on both sides approach. i.e. 47-100uF and a 100nF. And then another small cap 10n as close to the IC supply pins as possible. How sensitive is a PIC and does this sound about right? I'll also be driving the usual LCD and a few LEDs but no motors as yet.
2) Resonator Setup
I bought some three pin resonators in both 4MHz and 20MHz. Do three pin ones always have built in caps? or is there an occasion where a three pin device (xtal/res?) still needs caps?
3) Reset Circuit
I've seen mentioned on a few design notes about connecting to 'the rest of your reset circuit'. Is it common practice to but some form of reset button type setup on devices? I have using the guidelines from the notes of the programmer I am using and plan to keep the ICSP setup (mikroelektronika USB programmer). But all this says is the rest of your reset circuit too. I've also seen a few websites that have a 1N4148 in parallel with a reset button, but I wasn't sure why?
4) Any other tips of wisdom...
I have to say I'm looking forward to getting my first PIC pcb up and running, I've been 'playing' with these little beauties for a while now, but it's time to make some real projects come to life!!!
>-----Original Message-----
>From: spam_OUTpiclist-bouncesTakeThisOuTmit.edu [.....piclist-bouncesKILLspam@spam@mit.edu]
>On Behalf Of Kev Pearce (kevp.com)
>Sent: 17 September 2004 10:08
>To: PICLISTKILLspamMIT.EDU
>Subject: [PIC:] [PIC]: General PIC Design Guidelines
>
>
>Hi all,
>
>I'm looking at putting my first PIC (16F877) project PCB
>together and I was wondering if I could steal some of all your
>wise experience on doing this. All the work I have done so far
>is using a purchased dev board (mikroelektronika EasyPIC).
>
>
>1) Power Supply
>
>Most of my designs will be based on a 12V ish supply. Whether
>it be automotive or desk based, 12V seems like a good figure.
>I was planning on using a 7805 regulator with a large elec &
>small ceramic cap in parallel on both sides approach. i.e.
>47-100uF and a 100nF. And then another small cap 10n as close
>to the IC supply pins as possible. How sensitive is a PIC and
>does this sound about right? I'll also be driving the usual
>LCD and a few LEDs but no motors as yet.
>
Watch out for power dissipation issues. A PIC and a couple of LED's won't
cause problems, but if you are running anything on the five volt rail that
tales significant current you will have to deal with the heat being
dissipated by the 7805. At 1Amp, with 12volt input that is 12-5 * 1 = 7
watts which is a significant amount of heat to get rid of. Obviously a
lower input voltage will reduce this.
>2) Resonator Setup
>
>I bought some three pin resonators in both 4MHz and 20MHz. Do
>three pin ones always have built in caps? or is there an
>occasion where a three pin device (xtal/res?) still needs caps?
>
Three pin resonators by definition have built in caps. You shouldn't need
to add any external caps.
>3) Reset Circuit
>
>I've seen mentioned on a few design notes about connecting to
>'the rest of your reset circuit'. Is it common practice to but
>some form of reset button type setup on devices? I have using
>the guidelines from the notes of the programmer I am using and
>plan to keep the ICSP setup (mikroelektronika USB programmer).
>But all this says is the rest of your reset circuit too. I've
>also seen a few websites that have a 1N4148 in parallel with a
>reset button, but I wasn't sure why?
>
It's usual to have a reset button on a development board, less so on a final
product/project. The diode is usualy to stop feeding 13volts from the
programmer into the 5 volts supply rail and toasting the PIC. Not always
needed, you can get away with just a high value resistor in many
circumstances.
>4) Any other tips of wisdom...
It's a good idea to have a pulldown resistor on the PGM pin. The device
comes from the factory with low voltage programming enabled, and having this
pin floating during programming can cause all sorts of grief.
Ensure you adequately decouple the supply rails NEAR the PIC. A 0.1uF
ceramic cap is traditional.
Regards
Mike
=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
_______________________________________________ http://www.piclist.com
View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist
>Most of my designs will be based on a 12V ish supply.
>Whether it be automotive or desk based, 12V seems like
>a good figure. I was planning on using a 7805 regulator
>with a large elec & small ceramic cap in parallel on
>both sides approach.
Be careful with 7800 series (and 7900 series negative regulators) as they do
not appreciate having voltage on the output and no voltage on the input - a
very easy situation to have if you have a large capacitor on the output
side.
A good scheme is to put a reverse direction diode across the regulator, such
as a 1n400x series. This holds the input voltage up close to the output
voltage and stops the regulator self destructing when the input voltage is
removed.
This is a worth while scheme with almost any linear regulator chip, and can
save much cussing through inadvertent regulator destruction.
So with the 7805 if the input were nearer the output it would disapate less
power (makes perfect sense really!!) but not too near as you to achieve as
stable a 5V as possible. I'll add a larger heatsink I think, one of the
laying down ones rather than the standing up types - just like my dev board
has! I guess I could drive any larger outputs from the 12V input rather than
the 5V but in an automotive I don't want to use the supply voltage without
some form of regulator.
I was planning to add reset button just so if the user gets any problems I
can always tell them to reboot!
Res is sorted then no caps requeired. I guess just using the xtal and caps
just saves a few pence.
The diode across the 7805 is another one of those 'seen it on some websites'
deisgn things but never really understood why it was there. It will now be
included for sure.
0.1u Decoupler as near as pos.
Thanks for the tips guys. It all makes sense and my uni days doing
electronic engineering are starting to come flooding back, too many years in
IT... :-( it nice to get back to the nuts and bolts and electrons again.
> Most of my designs will be based on a 12V ish supply. Whether it be
> automotive or desk based, 12V seems like a good figure. I was planning on
> using a 7805 regulator with a large elec & small ceramic cap in parallel
> on both sides approach. i.e. 47-100uF and a 100nF. And then another small
> cap 10n as close to the IC supply pins as possible.
/>
Consider using a more modern regulator such as the (still not new) LM2931.
Much more tolerant to abuse - even more so in an automotive situation.
Reverse polarity and various surges can destory a 7805. The little extra
price is probably worth paying to ensure 12v stays outside your PIC :-)
Regulator decoupling capacitors are specified in the relevant datasheet and
can be quiite different between types. Do what they say. Oscillation under
some conditions is the most usual failing iof caps are too wrong.
100 nanofarad per IC is a good idea, mounted as near power pins as
reasonably possible. (Although you can often get away with far fewer)
Regulator power dissipation is (Vin-Vout) x Iout. At 12v in 5v out that's 7
watts per amp. TO220 regulator will take a watt plus with no heatsink and
more with more heat sink. If you dont need the 12V and you have a choice a
lower Vin can be good. However, 12V is useful for quite a few things so it
may be useful to standardise on it. Many FETs like approaching 12V gate
drive. relays, motors, som elamps etc often are 12v rated.
> So with the 7805 if the input were nearer the output it would disapate less
> power (makes perfect sense really!!) but not too near as you to achieve as
> stable a 5V as possible. I'll add a larger heatsink I think, one of the
> laying down ones rather than the standing up types - just like my dev board
> has! I guess I could drive any larger outputs from the 12V input rather than
> the 5V but in an automotive I don't want to use the supply voltage without
> some form of regulator.
Just remember that "12V" in a car is nothing of the sort! 13.2V is the "norm" while running, but can drop to
8V while the starter is turning over, and can reach 18V if there's serious battery charging going on. Make
sure your regulator can handle the latter, and/or that your circuit can cope with being a brief voltage drop
if the regulator drops out during starting. Also make sure you noise-filter every cable that connects to your
device - the Automotive environment is very electronics-unfriendly!
On Fri, Sep 17, 2004 at 11:25:43AM +0100, Kev Pearce (kevp.com) wrote:
> Thanks very much for the words of wisdom guys!
>
> So with the 7805 if the input were nearer the output it would disapate less
> power (makes perfect sense really!!) but not too near as you to achieve as
> stable a 5V as possible.
Right. for 78XX parts you usually need about 3V of overhead. So 8V would be
perfect for a 7805.
Note that there are several classes of low dropout regulators (LDO) that will
often maintain regulation down to withing a couple of hundred millivolts of
the regulated voltage. May be worth spending some time investigating.
Switching regulators eliminates most of the heat disappation problems.
> I'll add a larger heatsink I think, one of the
> laying down ones rather than the standing up types - just like my dev board
> has! I guess I could drive any larger outputs from the 12V input rather than
> the 5V but in an automotive I don't want to use the supply voltage without
> some form of regulator.
Good idea. Also for auto you need some stiffer filtering because there can
be some nasty transients during normal operations.
>
> I was planning to add reset button just so if the user gets any problems I
> can always tell them to reboot!
I usually throw one in mine too.
> Res is sorted then no caps requeired. I guess just using the xtal and caps
> just saves a few pence.
In fact if it's a nanowatt chip (which the 16F877 isn't unfortunately) you
can use the internal oscillator block up to 8 Mhz completely eliminating the
crystal or resonator. The 16F777 has such a block, but isn't self programmable.
That would be the perfect combo for me.
> Reverse polarity and various surges can destory a 7805.
Wow. I didn't know it was possible to hurt a 7805. I've abused plenty of
them, and although they will get hot enough to cause serious blisters (I've
run the test), I've never been able to toast one of them.
The caps are important, though. Get them wrong and you can get all sorts of
oscillations.
On the other hand, though, the whole automotive environment is pretty
hostile. I sort of like the idea of a second regulator ahead of the 5V
regulator, but I think I would put a diode or two on the up side too, to
prevent serious spikes from getting thorough.
13.2 volts can become 18 volts, true. Can also become 24+ volts when some idiot jumps with two batteries, -13.2 volts when some idiot hooks up the jumping battery reversed, or 60 volts when an inductive load dumps it's cookies.
-- Lawrence Lile, P.E.
Electrical and Electronic Solutions
Project Solutions Companies http://www.projsolco.com
> {Original Message removed}
On Fri, 2004-09-17 at 05:07, Kev Pearce (kevp.com) wrote:
> Hi all,
>
> I'm looking at putting my first PIC (16F877) project PCB together and I was wondering if I could steal some of all your wise experience on doing this. All the work I have done so far is using a purchased dev board (mikroelektronika EasyPIC).
>
>
> 1) Power Supply
>
> Most of my designs will be based on a 12V ish supply. Whether it be automotive or desk based, 12V seems like a good figure. I was planning on using a 7805 regulator with a large elec & small ceramic cap in parallel on both sides approach. i.e. 47-100uF and a 100nF. And then another small cap 10n as close to the IC supply pins as possible. How sensitive is a PIC and does this sound about right? I'll also be driving the usual LCD and a few LEDs but no motors as yet
My experience is generally a PIC is very robust when it comes to power
supplies. What you have in mind is actually a little more then what I
usually do, but is definitely enough.
If you do plan on adding a motor I recommend a COMPLETELY different
power supply, the PIC can act very weird if it shares a power supply
with a high inductive load.
> 2) Resonator Setup
>
> I bought some three pin resonators in both 4MHz and 20MHz. Do three pin ones always have built in caps? or is there an occasion where a three pin device (xtal/res?) still needs caps?
Check the datasheet. Generally if it's a three pin device (and isn't a
can) it's got the caps, but check the datasheet to be sure.
> 3) Reset Circuit
>
> I've seen mentioned on a few design notes about connecting to 'the rest of your reset circuit'. Is it common practice to but some form of reset button type setup on devices? I have using the guidelines from the notes of the programmer I am using and plan to keep the ICSP setup (mikroelektronika USB programmer). But all this says is the rest of your reset circuit too. I've also seen a few websites that have a 1N4148 in parallel with a reset button, but I wasn't sure why?
I've always just tied reset high (or switched that pin to I/O function).
There are cases where you might want a reset button, but I usually power
cycle. Remember, reset on the PIC resets the PIC, but NOT the rest of
your hardware (unless you wire it like that).
Not sure on the diode, perhaps has something to do with VPP being
applied?
> 4) Any other tips of wisdom...
>
>
> I have to say I'm looking forward to getting my first PIC pcb up and running, I've been 'playing' with these little beauties for a while now, but it's time to make some real projects come to life!!!
Enjoy. Everyone remembers their first PIC project (mine was the standard
blinking LED, still remember it vividly). TTYL
PS. If possible could you please turn on word wrap in your email client,
when replying you message turns out to be very long lines. Kinda
annoying, especially for people who's email clients don't word wrap.
TTYL
I have been successfully using 78L05 to get regulated 12V for my
Tiny11 programmer. I use 2x 9V batteries in series and the regulator
seems to handle that input voltage quite well.
On Fri, 2004-09-17 at 05:07, Kev Pearce (kevp.com) wrote:
> I was planning on using a 7805 regulator...
> I'll also be driving the usual LCD...
Remember that if your "usual LCD" have LCD backlight, that will
add about 150 - 400 mA depending on type and size. You could
drive the backlight from a higher voltage, of course, so you don't
load the 7805 with the backlight load also.
> I bought some three pin resonators in both 4MHz and 20MHz.
If I'm not wrong, ceramic resonators are a bit more "heavy duty"
then standard crystals. Could be a good-thing if used in a car
(well, depends to some degree on the shape of your roads :-) )
> 3) Reset Circuit
Have you thought about using the watchdog to automaticly
reset your application if something runs wild ? You could
of course both use the watchdog and have a separat hardware
reset button, if you want. I don't remember what PIC you where
going to use, but BOR is another thing to think about. If the 12
supply drops below aprox 8V, the 5V supply might begin to drop
also. The (old) 78xx line needs at least 3V between input and output,
if I'm not wrong. A newer ("LDO") regulator will give you a larger
marginal...
And finaly, Herbert Graf wrote :
> PS. If possible could you please turn on word wrap in your
> email client, when replying you message turns out to be
> very long lines. Kinda annoying, especially for people who's
> email clients don't word wrap.
Agree !
Now, there is actualy a special key called "carriage return" (or on
a PC simply "Enter"). If properly used, the text will be neat,
well formated and easy to read no matter what email client the
reader is using or how it's setup/configured. Try it !
>I have been successfully using 78L05 to get regulated 12V for my
>Tiny11 programmer. I use 2x 9V batteries in series and the regulator
>seems to handle that input voltage quite well.
How are you boosting the 5V up to 12V?
Wouldn't a 78L12 be safer?
>> Just remember that "12V" in a car is nothing of the sort! 13.2V is the
>> "norm" while running, but ...
> 13.2 volts can become 18 volts, true. Can also become 24+ volts when some
> idiot jumps with two batteries, -13.2 volts when some idiot hooks up the
> jumping battery reversed, or 60 volts when an inductive load dumps it's
> cookies.
>
LM293x family (and SOME other regulator families) are specifically designed
to survive all those things. LM7805 isn't.
>Chetan Bhargava wrote :
>
>> I have been successfully using 78L05 to get regulated 12V for my
>> Tiny11 programmer.
>
>Probably either a 78L12 *or* a regulated 5V, not ?
You can bump them up a little, but I would rather not bump it up that far.
I have 08's and 12's in the drawer, so no real point in kludging it.
Ever hear of the 78P05, excellent regulator,
full thermal overload protection (temp sensor in the same silicon as output)
Safe Operating Area protection, Short circuit protection.
10 Amp continuous 14.1 amps peak.
But it is only available in the 5 volt version,
however a pair of resistors will let you set it to anything from 5 to 32 volts output.
Cost same as a pass transistor, but is virtually free from burning out.
> At 03:55 PM 9/17/2004, Jan-Erik Soderholm wrote:
>
> >Chetan Bhargava wrote :
> >
> >> I have been successfully using 78L05 to get regulated 12V for my
> >> Tiny11 programmer.
> >
> >Probably either a 78L12 *or* a regulated 5V, not ?
>
> You can bump them up a little, but I would rather not bump it up that far.
> I have 08's and 12's in the drawer, so no real point in kludging it.
>
> How? A 78L05 will natively produce 5V. Why not just use a 12V regulator
> instead of performing unnatural acts with a 7805?
Well, they are not un-natural acts, well documented by National in
their databook :-)
Note that the absolute maxim voltage that can be fed to a 78L05 is 35V
so 12V should be safe.
Please look at page 8. There is a formula to calculate the output
voltage. I use that formula with Excel and do a what-if analysis on
resistor values and output voltage.
Another reason of using 78L05 is that I have a bunch of them :-)
On Sat, 18 Sep 2004 09:00:56 +1200, Russell McMahon wrote:
<list of horrors in automotive electrics>
> LM293x family (and SOME other regulator families) are specifically designed to survive all those things.
My usual supplier doesn't have these, but does have the LM2940CT - and the description is very similar
(including mentioning surviving double-battery jump starts!). Do you happen to know what the difference is
between these two ranges?
I'd always thought that LDO regulators were expensive, but these are the prices of +5V regs from Maplin:
Now I wouldn't touch the "Value Brand", but I'm confused about the two L7805s - there's no hint of the
difference in the catalogue. I would normally go for the third option, but for 20p extra I think I'll change
my habits!
On Sat, 18 Sep 2004 00:42:24 -0500, Dave VanHorn wrote:
> At 04:43 PM 9/17/2004, Falcon Wireless Tech Support -
KF4HAZ wrote:
>
> >Ever hear of the 78P05, excellent regulator,
>
> No, I hadn't. Interesting specs.
I can't seem to find anything in English using Google -
any hints on where to find the specs? (Or where to buy
the device!)
>> LM293x family (and SOME other regulator families) are specifically
>> designed to survive all those things.
>
> My usual supplier doesn't have these, but does have the LM2940CT - and the
> description is very similar
> (including mentioning surviving double-battery jump starts!). Do you
> happen to know what the difference is
> between these two ranges?
I have not compared them in detail before.
In TO220 the 2940 seems to be 1A max and 2931 is 500 MA max.
The 2940 seems to have higher input voltage and superior dropout spec (about
half the dropout voltage of an LM2931) but both are comemndably low. I think
the 2931 and the 293x seeries in genral are newer ICs with generally
superior perfoprmance apart fromt he above figures. Close comparison of data
sheets needed.
> I'd always thought that LDO regulators were expensive, but these are the
> prices of +5V regs from Maplin:
>
> 7805 "Value Brand" 39p
> L7805CV 39p
> L7805CP 79p
The CV part is a TO220 package.
The CT part is a TO220 variant (they call it TO220 FP) with a slightly WORSE
thermal resistance.
> LM2404CT 99p
Is that REALLY an LM2404 - I imagine that's a typo and meant to be LM2940
Value brand (whatever that is :-) ) CAN be every bit as good as one twice as
dear. but that greatly depends on WHY it is cheap, and you often can't tell.
It MAY be product which does not meet some critical spec and has been
rejected. Or it may be quite OK.
For valued projects the LM293X and LM2940 areliable to be worth the little
extra in a hostile environment.
> Now I wouldn't touch the "Value Brand", but I'm confused about the two
> L7805s - there's no hint of the
> difference in the catalogue. I would normally go for the third option,
> but for 20p extra I think I'll change
> my habits!
On Sun, 19 Sep 2004 01:06:14 +1200, Russell McMahon wrote:
>...<
>
> I have not compared them in detail before.
> In TO220 the 2940 seems to be 1A max and 2931 is 500 MA max.
OK, so the 2940 is the "replacement" for a 7805 on that figure...
> The 2940 seems to have higher input voltage and superior dropout spec (about
> half the dropout voltage of an LM2931) but both are comemndably low. I think
> the 2931 and the 293x seeries in genral are newer ICs with generally
> superior perfoprmance apart fromt he above figures. Close comparison of data
> sheets needed.
>
> http://cache.national.com/ds/LM/LM2931.pdf
> http://cache.national.com/ds/LM/LM2940.pdf
> > I'd always thought that LDO regulators were expensive, but these are the
> > prices of +5V regs from Maplin:
> >
> > 7805 "Value Brand" 39p
> > L7805CV 39p
> > L7805CP 79p
>
> The CV part is a TO220 package.
> The CT part is a TO220 variant (they call it TO220 FP) with a slightly WORSE
> thermal resistance.
Strange! Why mess about with the packaging, I wonder?
> > LM2404CT 99p
>
> Is that REALLY an LM2404 - I imagine that's a typo and meant to be LM2940
Oops! Well caught: 2940 it is.
> Value brand (whatever that is :-) ) CAN be every bit as good as one twice as
> dear. but that greatly depends on WHY it is cheap, and you often can't tell.
> It MAY be product which does not meet some critical spec and has been
> rejected. Or it may be quite OK.
Right - for the cost saving I'm not prepared to risk the rest of the circuit, just in case the spec that it
falls out of causes it to fail shorted and let out all that magic smoke!
> For valued projects the LM293X and LM2940 areliable to be worth the little
> extra in a hostile environment.
Indeed, and I may just standardise on the 2940 henceforth because the cost difference (especially for 10 or
so) isn't worth not doing it! (And I'm finding it hard to imagine an un-valued project, if I've spent time
building it :-)
> The CT part is a TO220 variant (they call it TO220 FP) with a slightly
WORSE
> thermal resistance.
>
I could be wrong, but I thought the idea of the FP package is that it's
completely encapsulated - no exposed metal. So, yes the thermals are a
little worse, but it can be bolted to a heatsink at some arbitrary voltage
without worrying about electrical insulation.
>-----Original Message-----
>From: EraseMEpiclist-bouncesspam_OUTTakeThisOuTmit.edu [piclist-bouncesspam_OUTmit.edu]
>On Behalf Of Chetan Bhargava
>Sent: 18 September 2004 00:34
>To: Microcontroller discussion list - Public.
>Subject: Re: [PIC:] [PIC]: General PIC Design Guidelines
>
>
>>
>> How? A 78L05 will natively produce 5V. Why not just use a 12V
>> regulator instead of performing unnatural acts with a 7805?
>
>
>Well, they are not un-natural acts, well documented by
>National in their databook :-) Note that the absolute maxim
>voltage that can be fed to a 78L05 is 35V so 12V should be safe.
>
>http://cache.national.com/ds/LM/LM78L05.pdf
>
>Please look at page 8. There is a formula to calculate the
>output voltage. I use that formula with Excel and do a what-if
>analysis on resistor values and output voltage.
>
>Another reason of using 78L05 is that I have a bunch of them :-)
Chetan,
Boosting the voltage of these regulators with resistors is ok for very
non-critical use, but note that it significantly degrades the line and load
regulation performance of the device. If you check the datasheet you can
see that the current coming out of the ground pin changes considerably with
line voltage changes, and to a lesser extent with supply current changes.
The LM317 is a much better bet for a cheapish adjustable regulator.
Mike
=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
_______________________________________________ http://www.piclist.com
View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist