| View previous topic :: View next topic |
| Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Aug 10, 2009 2:31 pm |
|
|
I think if the input voltage happens to float near the trigger point for the
CMOS logic gate input, that massive full-scale random noise signals could
be propagated into the chip die. Many of the i/o input circuits have
paths (tracks) that bypass the input latch and go to the interior of the
chip. This is shown in the I/O Ports section of the PIC data sheet.
For that reason, I avoid leaving input pins in a floating state. I normally
set unused pins to be low-level outputs. |
|
 |
Ttelmah Guest
|
|
Posted: Mon Aug 10, 2009 2:49 pm |
|
|
Let me make some general comments:
The 'rules' for pins are identical for the PIC, and any other normal logic device.
Never leave a pin 'undriven'. Pins_must_ either be driven high/low (outputs on a PIC), or if inputs, connected to a supply rail. If connected to a rail, _and the pin can change state to become an output_, they should be connected via resistors.
The 'point' to the latter part, is if you have something like a tri-statable pin, and connected it to a rail directly, then something goes wrong, and the pin is no longer tri-stated, excessive current will be drawn, and damage may result. Something like a 1K resistor to a supply rail avoids this.
On some older CMOS families, resistors were also needed, because otherwise pins could get into 'latch-up' during power on, or in the presence of noise.
Choosing 'which rail', depended on the logic family involved. On TTL, it draws slightly less current to connect inputs to the +ve rail. On CMOS, it generally does not matter.
So the general 'best practice' advice, would be to simply set the other pins as outputs, or connect them via a resistor pack to the supply rail, and set them as inputs.
Best Wishes |
|
 |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Aug 10, 2009 3:22 pm |
|
|
Seems, that you are trying hard to ignore the point I addressed in my post!
I didn't suggest to have floating pins with processors or other logic, I clarified, that I avoid them, too.
But I prefer a realistic view on the electronic effects caused by floating pins. You're invited to present proven cases, where a floating pin caused a processor reset or wrong logic behaviour, although it was equipped with suitable power supply and bypass capacitors.
I never experienced a similar case and I think it's simply misleading to suggest that setting floating pins to a defined level can be expected to heal a problem as Gabriel reported.
I don't want to contradict any of the said "rules", if you are talking about good practice. But if you are analyzing an electronic circuit's failure, you should try to be precise and distinguish between likely causes of failure and minor flaws. |
|
 |
Gabriel
Joined: 03 Aug 2009 Posts: 1085 Location: Panama
|
|
Posted: Mon Aug 10, 2009 3:56 pm |
|
|
wow,
nice dicussion going on here....i like it.
my point to start this post... although i realize is more an electrical question rather than a programing one.. was to get some idea on how to set up the "correct" state of my unused pins in my program....
obviously there are some hardware changes that go along with having the "right" settings ... which is a programing question.
having pulled high or low inputs OR outputs i think might depend on your aplication... mabey if your trying to save some mA, pulling things high is not your best choice.... or depend on your environment...
in my case... its winter... im cold.. i wear coats... every time i move any part of my body i get a charge build up... im prototyping... im touching my ckt constantly... my pic goes insane...although since trying some of the advice given here... i have managed to get some stability in my circuit.
and yes.. the discussion i started was in regards to static making your circuit reset and so on.... But... any aditional information... more than welcomed... im pretty sure more than one person will benefit from this.
me being the first one...
thank you all!
im so glad i join this forum. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
 |
mkuang
Joined: 14 Dec 2007 Posts: 257
|
|
Posted: Tue Aug 11, 2009 8:15 am |
|
|
| Gabriel wrote: | wow,
in my case... its winter... im cold.. i wear coats... every time i move any part of my body i get a charge build up... im prototyping... im touching my ckt constantly... my pic goes insane...although since trying some of the advice given here... i have managed to get some stability in my circuit.
|
I recommend that you get yourself a decent two layer ESD mat plus a static wrist-strap and grounding kit. The investment is about $300 USD ($60 for a mat from Digikey and about $250) for a grounding kit and strap from a company like SPIwestek). If you connect it properly you will save yourself a lot of ESD headaches at present and in the future. |
|
 |
Gabriel
Joined: 03 Aug 2009 Posts: 1085 Location: Panama
|
|
Posted: Tue Aug 11, 2009 9:30 am |
|
|
Funny that you mention the ESD mat,
i didn't know they existed... but when i started working on my project
i decided to place everything on top of a neoprene mat... for that specific purpose... i know its not the same but i figured it would bring some isolation...
ill check those out.. maybe i can get a cheaper one here in argentina...
from a local manufacturer...300$ is more than my budget... I'm still recovering from my digital oscilloscope purchase....but stuff for one“s lab is never a bad investment...(my lab is in Panama, but I'm in Argentina right now, thus my limited resources and tools)
on a cheaper note hahaha, i got some resistors today... so I'm grounding every pin i have un used... or tieing high. i have to read all the suggestions here once again...
thanks for your suggestion.
g _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
 |
Ttelmah Guest
|
|
Posted: Tue Aug 11, 2009 10:22 am |
|
|
More comments:
You have to be careful with cheap ESD mats, _not_ to put circuits directly on them. Stand them above the mat, but don't have legs touching the mat...
This is the 'point' of the two layer mat mentioned, these have a conductive bottom layer, and a more resitive static dissipating top layer. So don't just look for a Neoprene mat....
On leaving pins floating, even if you ignore quite a few dozen published papers about the increase in ESD problems when this is done (try searching the IEEE database), you also run into increased power consumption. Pins that are in the 'indeterminate' region on logic (between VIh, and VIl), result in the input gate drawing more power.
As I said, _either_ tie the pins to a rail, _or_ program them as outputs.
Best Wishes |
|
 |
Gabriel
Joined: 03 Aug 2009 Posts: 1085 Location: Panama
|
|
Posted: Tue Aug 11, 2009 10:43 am |
|
|
hi Ttelmah:
i didnt look for a neoprene mat, i had one laying around... i just said that i am using it as an improvised ESD mat, even though i had never heard of ESD mats... so i thought it was sort of nice hearing that "my" idea of using a mat to protect agains ESD had some validity in it.
like you said.. i have them declared as outputs... but aditionaly, now that i got some resistors.. i am also going to tie them to a rail.
now, on that subject:
since i have them as an output using tris,
should i tie them high and then do somthing like
Output_portB(0xFF); for all my unused pins/ports?
(or same concept but everything low)...
OR just use set the tris and tie them to my preffered railvia resistor, without actually "ouputing" anything(high/low)?
g _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
 |
mkuang
Joined: 14 Dec 2007 Posts: 257
|
|
Posted: Tue Aug 11, 2009 11:06 am |
|
|
| If you are tying the outputs to the 5V rail using resistors you can use output_low(your favorite pin). IF you are tying the outputs to GND using resistors then use output_high(pin). |
|
 |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Aug 11, 2009 11:33 am |
|
|
| The difference between a standard neoprene mat and an ESD protection mat is, that the neoprene is a good isolator and thus rather producing static electricity than discharging it. ESD protective materials have a high ohmic conductive fill, e.g. carbon. |
|
 |
Gabriel
Joined: 03 Aug 2009 Posts: 1085 Location: Panama
|
|
Posted: Tue Aug 11, 2009 1:44 pm |
|
|
FvM:
hmm... i guess i am getting rid of my neoprene mat....
It be funny if that is the precise reason why I'm getting so much static...
My home made "Solution" is actually the source of the problem...
Mkuang:
Right now its not a problem, but which of the "tying to rail Formats" you posted on your last post is more efficient power wise?
I ask because my final design will be battery operated... and power leaks will be something I will want to minimize...
Maybe its a dumb question....
Thanks for your help...
I feel so dumb asking some of these questions... but its been a loooong time since i prototyped anything....
thanks
g _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
 |
mkuang
Joined: 14 Dec 2007 Posts: 257
|
|
Posted: Tue Aug 11, 2009 2:04 pm |
|
|
| Gabriel wrote: | FvM:
Mkuang:
right now its not a problem, but which of the "tying to rail Formats" you posted on your last post is more efficient power wise?
i ask because my final design will be battery operated... and power leaks will be somthing i will want to minimize...
|
I think these PICS are CMOS devices so it doesn't matter much whether the pins are pulled high or pulled low (i.e. whether the PIC is sinking or sourcing current). If you are concerned about current draw use a larger value resistor but keep in mind that the larger value the resistor the more it is susceptable to noise pickup. |
|
 |
|