Reasons for having MCU pin-states default to pull-up/down out of resetHow to configure an ARM GPIO port (STR9) to an alternate function?Recommendation for default settings for unused pins on an STM32 (ARM Cortex M3) - pull up/pull down?Why would an input pin have both a pull-up and pull-down resistor?Need of External Pull Up/Pull Down for Processor I/O pinsPullup or direct drive when handling active low inputs/resets?Pull-up and Pull-down Resistor Usage on Input or Output MCU PinsTurn pull-up into pull-downPull-up vs Pull-down on enable pinPrevent a floating output to PWM input on MCU resetPull-up vs Pull-down for contact switch?

Can you use Vicious Mockery to win an argument or gain favours?

How can I write humor as character trait?

How does electrical safety system work on ISS?

Review your own paper in Mathematics

Which Article Helped Get Rid of Technobabble in RPGs?

What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?

Pre-mixing cryogenic fuels and using only one fuel tank

Biological Blimps: Propulsion

I found an audio circuit and I built it just fine, but I find it a bit too quiet. How do I amplify the output so that it is a bit louder?

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?

I sent it from my dad's number

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?

Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?

Giving feedback to someone without sounding prejudiced

Microchip documentation does not label CAN buss pins on micro controller pinout diagram

awk assign to multiple variables at once

Quoting Keynes in a lecture

Inherit child template to the parent template using Powershell

Has the laser at Magurele, Romania reached a tenth of the Sun's power?

Does grappling negate Mirror Image?

The IT department bottlenecks progress, how should I handle this?

How to preserve electronics (computers, iPads and phones) for hundreds of years

How do I tell my boss that I'm quitting soon, especially given that a colleague just left this week



Reasons for having MCU pin-states default to pull-up/down out of reset


How to configure an ARM GPIO port (STR9) to an alternate function?Recommendation for default settings for unused pins on an STM32 (ARM Cortex M3) - pull up/pull down?Why would an input pin have both a pull-up and pull-down resistor?Need of External Pull Up/Pull Down for Processor I/O pinsPullup or direct drive when handling active low inputs/resets?Pull-up and Pull-down Resistor Usage on Input or Output MCU PinsTurn pull-up into pull-downPull-up vs Pull-down on enable pinPrevent a floating output to PWM input on MCU resetPull-up vs Pull-down for contact switch?













6












$begingroup$


On many MCUs, pin-states default to tri-stated (a.k.a. analog inputs) when the MCU resets so as to not affect the circuits they are connected to until software configures the pins. The tri-stated pins also allow the HW designer to choose the pull state of each pin on a case-by-case basis in function of the underlying circuitry.



However, there are some MCUs (and SoCs) that default their pins to instead activate an internal pull-up/down. For example, the LPC845 defaults all pins to pull-ups coming out of reset.
LPC845 Datasheet Section 8.11.1



Is there a reason defaulting pins to pull-up/down is preferable to tri-stated (other than the possible incremental power savings when coming out of a reset, or the marginal BOM cost savings)?



If anything, I rarely find that pins should be pulled-up coming out of reset (I typically need to pull them down, if at all).










share|improve this question











$endgroup$







  • 1




    $begingroup$
    I'd probably want that behavior to be configurable with fuses for the device, during programming. That's my thought, right now.
    $endgroup$
    – jonk
    2 days ago






  • 4




    $begingroup$
    Sounds like a good chip. The real question is why the vast majority of MCUs leave them in tri-state/inputs, exposing the pins to EMI and ESD during MCU boot-up. Because we all like EMC tests failing and ESD-damaged ICs, right?
    $endgroup$
    – Lundin
    2 days ago











  • $begingroup$
    @Lundin This is an interesting point. I could see EMI being an issue if the pins are not externally pulled, but how would ESD be mitigated by defaulting pins to a certain pull state coming out of reset? Aren't the input pin diodes sufficient?
    $endgroup$
    – TRISAbits
    2 days ago










  • $begingroup$
    @TRISAbits On modern MCUs the diodes should hopefully be ok... maybe. There's often no public spec on them. So it is good practice to have some manner of resistor between the pin and connectors/buttons/stuff that humans might poke at.
    $endgroup$
    – Lundin
    yesterday















6












$begingroup$


On many MCUs, pin-states default to tri-stated (a.k.a. analog inputs) when the MCU resets so as to not affect the circuits they are connected to until software configures the pins. The tri-stated pins also allow the HW designer to choose the pull state of each pin on a case-by-case basis in function of the underlying circuitry.



However, there are some MCUs (and SoCs) that default their pins to instead activate an internal pull-up/down. For example, the LPC845 defaults all pins to pull-ups coming out of reset.
LPC845 Datasheet Section 8.11.1



Is there a reason defaulting pins to pull-up/down is preferable to tri-stated (other than the possible incremental power savings when coming out of a reset, or the marginal BOM cost savings)?



If anything, I rarely find that pins should be pulled-up coming out of reset (I typically need to pull them down, if at all).










share|improve this question











$endgroup$







  • 1




    $begingroup$
    I'd probably want that behavior to be configurable with fuses for the device, during programming. That's my thought, right now.
    $endgroup$
    – jonk
    2 days ago






  • 4




    $begingroup$
    Sounds like a good chip. The real question is why the vast majority of MCUs leave them in tri-state/inputs, exposing the pins to EMI and ESD during MCU boot-up. Because we all like EMC tests failing and ESD-damaged ICs, right?
    $endgroup$
    – Lundin
    2 days ago











  • $begingroup$
    @Lundin This is an interesting point. I could see EMI being an issue if the pins are not externally pulled, but how would ESD be mitigated by defaulting pins to a certain pull state coming out of reset? Aren't the input pin diodes sufficient?
    $endgroup$
    – TRISAbits
    2 days ago










  • $begingroup$
    @TRISAbits On modern MCUs the diodes should hopefully be ok... maybe. There's often no public spec on them. So it is good practice to have some manner of resistor between the pin and connectors/buttons/stuff that humans might poke at.
    $endgroup$
    – Lundin
    yesterday













6












6








6


2



$begingroup$


On many MCUs, pin-states default to tri-stated (a.k.a. analog inputs) when the MCU resets so as to not affect the circuits they are connected to until software configures the pins. The tri-stated pins also allow the HW designer to choose the pull state of each pin on a case-by-case basis in function of the underlying circuitry.



However, there are some MCUs (and SoCs) that default their pins to instead activate an internal pull-up/down. For example, the LPC845 defaults all pins to pull-ups coming out of reset.
LPC845 Datasheet Section 8.11.1



Is there a reason defaulting pins to pull-up/down is preferable to tri-stated (other than the possible incremental power savings when coming out of a reset, or the marginal BOM cost savings)?



If anything, I rarely find that pins should be pulled-up coming out of reset (I typically need to pull them down, if at all).










share|improve this question











$endgroup$




On many MCUs, pin-states default to tri-stated (a.k.a. analog inputs) when the MCU resets so as to not affect the circuits they are connected to until software configures the pins. The tri-stated pins also allow the HW designer to choose the pull state of each pin on a case-by-case basis in function of the underlying circuitry.



However, there are some MCUs (and SoCs) that default their pins to instead activate an internal pull-up/down. For example, the LPC845 defaults all pins to pull-ups coming out of reset.
LPC845 Datasheet Section 8.11.1



Is there a reason defaulting pins to pull-up/down is preferable to tri-stated (other than the possible incremental power savings when coming out of a reset, or the marginal BOM cost savings)?



If anything, I rarely find that pins should be pulled-up coming out of reset (I typically need to pull them down, if at all).







microcontroller gpio pullup pulldown tri-state






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago







TRISAbits

















asked 2 days ago









TRISAbitsTRISAbits

6461623




6461623







  • 1




    $begingroup$
    I'd probably want that behavior to be configurable with fuses for the device, during programming. That's my thought, right now.
    $endgroup$
    – jonk
    2 days ago






  • 4




    $begingroup$
    Sounds like a good chip. The real question is why the vast majority of MCUs leave them in tri-state/inputs, exposing the pins to EMI and ESD during MCU boot-up. Because we all like EMC tests failing and ESD-damaged ICs, right?
    $endgroup$
    – Lundin
    2 days ago











  • $begingroup$
    @Lundin This is an interesting point. I could see EMI being an issue if the pins are not externally pulled, but how would ESD be mitigated by defaulting pins to a certain pull state coming out of reset? Aren't the input pin diodes sufficient?
    $endgroup$
    – TRISAbits
    2 days ago










  • $begingroup$
    @TRISAbits On modern MCUs the diodes should hopefully be ok... maybe. There's often no public spec on them. So it is good practice to have some manner of resistor between the pin and connectors/buttons/stuff that humans might poke at.
    $endgroup$
    – Lundin
    yesterday












  • 1




    $begingroup$
    I'd probably want that behavior to be configurable with fuses for the device, during programming. That's my thought, right now.
    $endgroup$
    – jonk
    2 days ago






  • 4




    $begingroup$
    Sounds like a good chip. The real question is why the vast majority of MCUs leave them in tri-state/inputs, exposing the pins to EMI and ESD during MCU boot-up. Because we all like EMC tests failing and ESD-damaged ICs, right?
    $endgroup$
    – Lundin
    2 days ago











  • $begingroup$
    @Lundin This is an interesting point. I could see EMI being an issue if the pins are not externally pulled, but how would ESD be mitigated by defaulting pins to a certain pull state coming out of reset? Aren't the input pin diodes sufficient?
    $endgroup$
    – TRISAbits
    2 days ago










  • $begingroup$
    @TRISAbits On modern MCUs the diodes should hopefully be ok... maybe. There's often no public spec on them. So it is good practice to have some manner of resistor between the pin and connectors/buttons/stuff that humans might poke at.
    $endgroup$
    – Lundin
    yesterday







1




1




$begingroup$
I'd probably want that behavior to be configurable with fuses for the device, during programming. That's my thought, right now.
$endgroup$
– jonk
2 days ago




$begingroup$
I'd probably want that behavior to be configurable with fuses for the device, during programming. That's my thought, right now.
$endgroup$
– jonk
2 days ago




4




4




$begingroup$
Sounds like a good chip. The real question is why the vast majority of MCUs leave them in tri-state/inputs, exposing the pins to EMI and ESD during MCU boot-up. Because we all like EMC tests failing and ESD-damaged ICs, right?
$endgroup$
– Lundin
2 days ago





$begingroup$
Sounds like a good chip. The real question is why the vast majority of MCUs leave them in tri-state/inputs, exposing the pins to EMI and ESD during MCU boot-up. Because we all like EMC tests failing and ESD-damaged ICs, right?
$endgroup$
– Lundin
2 days ago













$begingroup$
@Lundin This is an interesting point. I could see EMI being an issue if the pins are not externally pulled, but how would ESD be mitigated by defaulting pins to a certain pull state coming out of reset? Aren't the input pin diodes sufficient?
$endgroup$
– TRISAbits
2 days ago




$begingroup$
@Lundin This is an interesting point. I could see EMI being an issue if the pins are not externally pulled, but how would ESD be mitigated by defaulting pins to a certain pull state coming out of reset? Aren't the input pin diodes sufficient?
$endgroup$
– TRISAbits
2 days ago












$begingroup$
@TRISAbits On modern MCUs the diodes should hopefully be ok... maybe. There's often no public spec on them. So it is good practice to have some manner of resistor between the pin and connectors/buttons/stuff that humans might poke at.
$endgroup$
– Lundin
yesterday




$begingroup$
@TRISAbits On modern MCUs the diodes should hopefully be ok... maybe. There's often no public spec on them. So it is good practice to have some manner of resistor between the pin and connectors/buttons/stuff that humans might poke at.
$endgroup$
– Lundin
yesterday










5 Answers
5






active

oldest

votes


















10












$begingroup$

Because it's good practice to never leave logic pins purely floating.
Brief TI Overview
Detailed TI overview
Amusing dramatized war story of a real-world example






share|improve this answer









$endgroup$












  • $begingroup$
    I completely agree. Floating pins are indeed a bad thing for power consumption. But any well behaved firmware should set all unused pins to a known state, so the power loss would only occur coming out of a reset (and this loss can be eliminated by placing external pulls). So is the idea that by giving a default state to a pin (pull-up/down) the FW needs less massaging to get lower power numbers?
    $endgroup$
    – TRISAbits
    2 days ago






  • 2




    $begingroup$
    I think you've cut to the heart of the matter here. If the firmware is well-behaved and/or the hardware designer had the good sense to apply proper pull-ups or pull-downs, then there would be absolutely no need for this type of initialization. And I'd guess that's why not all chip designers do this. It's all a matter of philosophy -- do you want to presume your users are smart enough to do The Right Thing, or do you want to protect them if they don't? It could be argued either way...
    $endgroup$
    – Mr. Snrub
    2 days ago










  • $begingroup$
    Certain MCUs have their digital input buffer logic disabled coming out of reset (e.g. PIC12/16/18), which presumably is intended to prevent leakages caused by shoot-through? If so, that would be an alternative to forcing pins in a certain known-state.
    $endgroup$
    – TRISAbits
    2 days ago






  • 1




    $begingroup$
    BTW, you mentioned leakage currents, but as illustrated in the "amusing dramatized war story", my bigger worry would be oscillations. Leakage currents will go away once the FW sets the pin to a good state, but if a floating pin oscillates then there is the danger of it causing the logic to go into an invalid state.
    $endgroup$
    – Mr. Snrub
    2 days ago






  • 1




    $begingroup$
    I really mean to say that oscillation on an input pin at any time, whether in reset or not, is probably Bad News. Yes if the oscillation occurred during the reset process, then I would be gravely concerned that the reset process may not fully initialize things to a known good state.
    $endgroup$
    – Mr. Snrub
    2 days ago


















6












$begingroup$

Other answers have given general reasons why a chip maker might make the choice to enable pull-ups by default. However, in the specific case of LPC845, there is an additional reason: it has specialized FAst Initialization Memory (FAIM) that can be used to set the state immediately after reset:




The FAIM contents provide a user-programmable initial configuration for aspects of the
microcontroller, which take effect immediately after reset, before code begins to run. For
instance, the standard I/O pads normally come out of reset with the internal pull-ups
enabled. In some systems this may cause excess current to flow, until software can
reconfigure the pads. However, by programming the FAIM appropriately, every pad's reset
configuration can be customized.




(LPC84x user manual section 4.2)



Thus they've chosen the safe (from power usage and EMI point of view) default, while allowing more advanced users to customize the setting.






share|improve this answer









$endgroup$












  • $begingroup$
    The downside with the FAIM is that it requires an additional programming step to set it up front, which means that your design should survive the incorrect pull-state until the FAIM is updated. Alternatively you can install a stronger external pull to overdrive the default internal setup, but you've now introduced a perpetual power loss through the external pull. I guess you can't have your cake and eat it too.
    $endgroup$
    – TRISAbits
    2 days ago










  • $begingroup$
    @TRISAbits Yeah. But after all even if it were tristated, you'd need the external pulldown on important pins, and if it is pulling to the default state, the average loss is not so much.
    $endgroup$
    – jpa
    yesterday










  • $begingroup$
    The point I was (poorly) making is that the external pull will have to be stronger than otherwise required in order to overdrive the internal pull. If the pins were tri-stated then the pull could be weaker, which would result is less power loss through the external pull.
    $endgroup$
    – TRISAbits
    yesterday


















4












$begingroup$

Back in the days there were Intel 8051 microcontrollers that only had open drain I/O pins, so most of the time you needed external pull-ups anyway to do useful things like connecting to pushbuttons or controlling CMOS inputs of other chips. This is most likely to have easy redesign of such boards with a modern microcontroller, or people from that era that are accustomed to designing with pulled-up open-collector I/Os. Back in the day, you mostly needed pull-ups if anything, and rarely pull-downs.






share|improve this answer









$endgroup$












  • $begingroup$
    That's a really interesting bit of insight, and explains why a lot of logic chips have active-low output-enable pins. Active-high logic doesn't mesh as well when the default pull-state is high. As an aside it also doesn't mesh well when directly connected to the gate of a NMOS, unless you want the transistor to turn on by default.
    $endgroup$
    – TRISAbits
    2 days ago






  • 2




    $begingroup$
    Also other chips of that era have active signals when low. TTL chips (74XX and 74LSXX series for example) can pull low stronger than push high. Therefore fast falling edge is sharper and more defined than slow exponentially rising edge. Also small currents flow in and out of chip inputs as they are not so high impedance. Therefore, pull-ups are sometimes necessary, and pull-ups can be weaker than pull-downs, so that's why you have active low logic with pull-ups, with pushbuttons grounding the inputs and outputs turning on LEDs by grounding the LED via resistor.
    $endgroup$
    – Justme
    2 days ago


















3












$begingroup$

Leaving GPIO pins as tri-stated inputs have many undesirable effects:



  1. As manufacturing process has certain variance and a lot of other circuitry is connected to GPIO (as output buffer and ESD protection), direction of resulting parasitic leakage is unpredictable, so the state can take either logic high or low;


  2. Again, due to process variation and temperature dependence, the pin leakage can be very small, resulting in either very slow change of logic state after, say, several minutes, which might be a challenge to accommodate in code, or it can drift in unpredictable direction.


  3. Leaving pins floating might lead to establishing some middle potential, where the pin input buffer may act as linear amplifier with substantial gain, causing either self-oscillations (due to parasitic positive feedback across power rails), or be susceptible to external electromagnetic interference. Oscillations can be somewhere internally, and lead to out-of range power consumption.


4... must forget something else... power-on transients?






share|improve this answer









$endgroup$




















    3












    $begingroup$

    From a systems point of view, having the pins start in a defined state is a benefit. For example, a motor might be attached that shouldn't be activated without command. Peripherals usually expect their interfaces to be in a certain state, and starting in high-Z may not provide the required state. As the internal pull ups/downs in a typical microcontroller are relatively weak, they may be overridden by a stronger external pull up/down where required. As an additional note, it is nice to see in the datasheet what the expected behaviour of the pins is, this is sometimes not included..!






    share|improve this answer









    $endgroup$








    • 1




      $begingroup$
      The problem with providing an external pull-up when an internal one is enabled is two-fold: [1] The external pull has to be properly sized to be far stronger (good rule of thumb is at least 10x). Otherwise you will create a voltage divider, which can set the voltage into that middle no-mans-land zone. [2] The stronger external pull introduces a continuous power loss (if the pin state is frequently opposite the pull direction), which will quickly consume more power than any loses from having tri-stated pins out of reset.
      $endgroup$
      – TRISAbits
      2 days ago










    • $begingroup$
      @TRISAbits Agreed on both points. Not that desirable to override, but most internals are 50-100K so not disasterous. Read the manual, as ever :)
      $endgroup$
      – awjlogan
      2 days ago











    • $begingroup$
      @TRISAbits And also it's not about power in this example, it's about how the wider system interacts at reset, not just the MCU.
      $endgroup$
      – awjlogan
      2 days ago











    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("schematics", function ()
    StackExchange.schematics.init();
    );
    , "cicuitlab");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "135"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f427888%2freasons-for-having-mcu-pin-states-default-to-pull-up-down-out-of-reset%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    10












    $begingroup$

    Because it's good practice to never leave logic pins purely floating.
    Brief TI Overview
    Detailed TI overview
    Amusing dramatized war story of a real-world example






    share|improve this answer









    $endgroup$












    • $begingroup$
      I completely agree. Floating pins are indeed a bad thing for power consumption. But any well behaved firmware should set all unused pins to a known state, so the power loss would only occur coming out of a reset (and this loss can be eliminated by placing external pulls). So is the idea that by giving a default state to a pin (pull-up/down) the FW needs less massaging to get lower power numbers?
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      I think you've cut to the heart of the matter here. If the firmware is well-behaved and/or the hardware designer had the good sense to apply proper pull-ups or pull-downs, then there would be absolutely no need for this type of initialization. And I'd guess that's why not all chip designers do this. It's all a matter of philosophy -- do you want to presume your users are smart enough to do The Right Thing, or do you want to protect them if they don't? It could be argued either way...
      $endgroup$
      – Mr. Snrub
      2 days ago










    • $begingroup$
      Certain MCUs have their digital input buffer logic disabled coming out of reset (e.g. PIC12/16/18), which presumably is intended to prevent leakages caused by shoot-through? If so, that would be an alternative to forcing pins in a certain known-state.
      $endgroup$
      – TRISAbits
      2 days ago






    • 1




      $begingroup$
      BTW, you mentioned leakage currents, but as illustrated in the "amusing dramatized war story", my bigger worry would be oscillations. Leakage currents will go away once the FW sets the pin to a good state, but if a floating pin oscillates then there is the danger of it causing the logic to go into an invalid state.
      $endgroup$
      – Mr. Snrub
      2 days ago






    • 1




      $begingroup$
      I really mean to say that oscillation on an input pin at any time, whether in reset or not, is probably Bad News. Yes if the oscillation occurred during the reset process, then I would be gravely concerned that the reset process may not fully initialize things to a known good state.
      $endgroup$
      – Mr. Snrub
      2 days ago















    10












    $begingroup$

    Because it's good practice to never leave logic pins purely floating.
    Brief TI Overview
    Detailed TI overview
    Amusing dramatized war story of a real-world example






    share|improve this answer









    $endgroup$












    • $begingroup$
      I completely agree. Floating pins are indeed a bad thing for power consumption. But any well behaved firmware should set all unused pins to a known state, so the power loss would only occur coming out of a reset (and this loss can be eliminated by placing external pulls). So is the idea that by giving a default state to a pin (pull-up/down) the FW needs less massaging to get lower power numbers?
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      I think you've cut to the heart of the matter here. If the firmware is well-behaved and/or the hardware designer had the good sense to apply proper pull-ups or pull-downs, then there would be absolutely no need for this type of initialization. And I'd guess that's why not all chip designers do this. It's all a matter of philosophy -- do you want to presume your users are smart enough to do The Right Thing, or do you want to protect them if they don't? It could be argued either way...
      $endgroup$
      – Mr. Snrub
      2 days ago










    • $begingroup$
      Certain MCUs have their digital input buffer logic disabled coming out of reset (e.g. PIC12/16/18), which presumably is intended to prevent leakages caused by shoot-through? If so, that would be an alternative to forcing pins in a certain known-state.
      $endgroup$
      – TRISAbits
      2 days ago






    • 1




      $begingroup$
      BTW, you mentioned leakage currents, but as illustrated in the "amusing dramatized war story", my bigger worry would be oscillations. Leakage currents will go away once the FW sets the pin to a good state, but if a floating pin oscillates then there is the danger of it causing the logic to go into an invalid state.
      $endgroup$
      – Mr. Snrub
      2 days ago






    • 1




      $begingroup$
      I really mean to say that oscillation on an input pin at any time, whether in reset or not, is probably Bad News. Yes if the oscillation occurred during the reset process, then I would be gravely concerned that the reset process may not fully initialize things to a known good state.
      $endgroup$
      – Mr. Snrub
      2 days ago













    10












    10








    10





    $begingroup$

    Because it's good practice to never leave logic pins purely floating.
    Brief TI Overview
    Detailed TI overview
    Amusing dramatized war story of a real-world example






    share|improve this answer









    $endgroup$



    Because it's good practice to never leave logic pins purely floating.
    Brief TI Overview
    Detailed TI overview
    Amusing dramatized war story of a real-world example







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 2 days ago









    Mr. SnrubMr. Snrub

    7406




    7406











    • $begingroup$
      I completely agree. Floating pins are indeed a bad thing for power consumption. But any well behaved firmware should set all unused pins to a known state, so the power loss would only occur coming out of a reset (and this loss can be eliminated by placing external pulls). So is the idea that by giving a default state to a pin (pull-up/down) the FW needs less massaging to get lower power numbers?
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      I think you've cut to the heart of the matter here. If the firmware is well-behaved and/or the hardware designer had the good sense to apply proper pull-ups or pull-downs, then there would be absolutely no need for this type of initialization. And I'd guess that's why not all chip designers do this. It's all a matter of philosophy -- do you want to presume your users are smart enough to do The Right Thing, or do you want to protect them if they don't? It could be argued either way...
      $endgroup$
      – Mr. Snrub
      2 days ago










    • $begingroup$
      Certain MCUs have their digital input buffer logic disabled coming out of reset (e.g. PIC12/16/18), which presumably is intended to prevent leakages caused by shoot-through? If so, that would be an alternative to forcing pins in a certain known-state.
      $endgroup$
      – TRISAbits
      2 days ago






    • 1




      $begingroup$
      BTW, you mentioned leakage currents, but as illustrated in the "amusing dramatized war story", my bigger worry would be oscillations. Leakage currents will go away once the FW sets the pin to a good state, but if a floating pin oscillates then there is the danger of it causing the logic to go into an invalid state.
      $endgroup$
      – Mr. Snrub
      2 days ago






    • 1




      $begingroup$
      I really mean to say that oscillation on an input pin at any time, whether in reset or not, is probably Bad News. Yes if the oscillation occurred during the reset process, then I would be gravely concerned that the reset process may not fully initialize things to a known good state.
      $endgroup$
      – Mr. Snrub
      2 days ago
















    • $begingroup$
      I completely agree. Floating pins are indeed a bad thing for power consumption. But any well behaved firmware should set all unused pins to a known state, so the power loss would only occur coming out of a reset (and this loss can be eliminated by placing external pulls). So is the idea that by giving a default state to a pin (pull-up/down) the FW needs less massaging to get lower power numbers?
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      I think you've cut to the heart of the matter here. If the firmware is well-behaved and/or the hardware designer had the good sense to apply proper pull-ups or pull-downs, then there would be absolutely no need for this type of initialization. And I'd guess that's why not all chip designers do this. It's all a matter of philosophy -- do you want to presume your users are smart enough to do The Right Thing, or do you want to protect them if they don't? It could be argued either way...
      $endgroup$
      – Mr. Snrub
      2 days ago










    • $begingroup$
      Certain MCUs have their digital input buffer logic disabled coming out of reset (e.g. PIC12/16/18), which presumably is intended to prevent leakages caused by shoot-through? If so, that would be an alternative to forcing pins in a certain known-state.
      $endgroup$
      – TRISAbits
      2 days ago






    • 1




      $begingroup$
      BTW, you mentioned leakage currents, but as illustrated in the "amusing dramatized war story", my bigger worry would be oscillations. Leakage currents will go away once the FW sets the pin to a good state, but if a floating pin oscillates then there is the danger of it causing the logic to go into an invalid state.
      $endgroup$
      – Mr. Snrub
      2 days ago






    • 1




      $begingroup$
      I really mean to say that oscillation on an input pin at any time, whether in reset or not, is probably Bad News. Yes if the oscillation occurred during the reset process, then I would be gravely concerned that the reset process may not fully initialize things to a known good state.
      $endgroup$
      – Mr. Snrub
      2 days ago















    $begingroup$
    I completely agree. Floating pins are indeed a bad thing for power consumption. But any well behaved firmware should set all unused pins to a known state, so the power loss would only occur coming out of a reset (and this loss can be eliminated by placing external pulls). So is the idea that by giving a default state to a pin (pull-up/down) the FW needs less massaging to get lower power numbers?
    $endgroup$
    – TRISAbits
    2 days ago




    $begingroup$
    I completely agree. Floating pins are indeed a bad thing for power consumption. But any well behaved firmware should set all unused pins to a known state, so the power loss would only occur coming out of a reset (and this loss can be eliminated by placing external pulls). So is the idea that by giving a default state to a pin (pull-up/down) the FW needs less massaging to get lower power numbers?
    $endgroup$
    – TRISAbits
    2 days ago




    2




    2




    $begingroup$
    I think you've cut to the heart of the matter here. If the firmware is well-behaved and/or the hardware designer had the good sense to apply proper pull-ups or pull-downs, then there would be absolutely no need for this type of initialization. And I'd guess that's why not all chip designers do this. It's all a matter of philosophy -- do you want to presume your users are smart enough to do The Right Thing, or do you want to protect them if they don't? It could be argued either way...
    $endgroup$
    – Mr. Snrub
    2 days ago




    $begingroup$
    I think you've cut to the heart of the matter here. If the firmware is well-behaved and/or the hardware designer had the good sense to apply proper pull-ups or pull-downs, then there would be absolutely no need for this type of initialization. And I'd guess that's why not all chip designers do this. It's all a matter of philosophy -- do you want to presume your users are smart enough to do The Right Thing, or do you want to protect them if they don't? It could be argued either way...
    $endgroup$
    – Mr. Snrub
    2 days ago












    $begingroup$
    Certain MCUs have their digital input buffer logic disabled coming out of reset (e.g. PIC12/16/18), which presumably is intended to prevent leakages caused by shoot-through? If so, that would be an alternative to forcing pins in a certain known-state.
    $endgroup$
    – TRISAbits
    2 days ago




    $begingroup$
    Certain MCUs have their digital input buffer logic disabled coming out of reset (e.g. PIC12/16/18), which presumably is intended to prevent leakages caused by shoot-through? If so, that would be an alternative to forcing pins in a certain known-state.
    $endgroup$
    – TRISAbits
    2 days ago




    1




    1




    $begingroup$
    BTW, you mentioned leakage currents, but as illustrated in the "amusing dramatized war story", my bigger worry would be oscillations. Leakage currents will go away once the FW sets the pin to a good state, but if a floating pin oscillates then there is the danger of it causing the logic to go into an invalid state.
    $endgroup$
    – Mr. Snrub
    2 days ago




    $begingroup$
    BTW, you mentioned leakage currents, but as illustrated in the "amusing dramatized war story", my bigger worry would be oscillations. Leakage currents will go away once the FW sets the pin to a good state, but if a floating pin oscillates then there is the danger of it causing the logic to go into an invalid state.
    $endgroup$
    – Mr. Snrub
    2 days ago




    1




    1




    $begingroup$
    I really mean to say that oscillation on an input pin at any time, whether in reset or not, is probably Bad News. Yes if the oscillation occurred during the reset process, then I would be gravely concerned that the reset process may not fully initialize things to a known good state.
    $endgroup$
    – Mr. Snrub
    2 days ago




    $begingroup$
    I really mean to say that oscillation on an input pin at any time, whether in reset or not, is probably Bad News. Yes if the oscillation occurred during the reset process, then I would be gravely concerned that the reset process may not fully initialize things to a known good state.
    $endgroup$
    – Mr. Snrub
    2 days ago













    6












    $begingroup$

    Other answers have given general reasons why a chip maker might make the choice to enable pull-ups by default. However, in the specific case of LPC845, there is an additional reason: it has specialized FAst Initialization Memory (FAIM) that can be used to set the state immediately after reset:




    The FAIM contents provide a user-programmable initial configuration for aspects of the
    microcontroller, which take effect immediately after reset, before code begins to run. For
    instance, the standard I/O pads normally come out of reset with the internal pull-ups
    enabled. In some systems this may cause excess current to flow, until software can
    reconfigure the pads. However, by programming the FAIM appropriately, every pad's reset
    configuration can be customized.




    (LPC84x user manual section 4.2)



    Thus they've chosen the safe (from power usage and EMI point of view) default, while allowing more advanced users to customize the setting.






    share|improve this answer









    $endgroup$












    • $begingroup$
      The downside with the FAIM is that it requires an additional programming step to set it up front, which means that your design should survive the incorrect pull-state until the FAIM is updated. Alternatively you can install a stronger external pull to overdrive the default internal setup, but you've now introduced a perpetual power loss through the external pull. I guess you can't have your cake and eat it too.
      $endgroup$
      – TRISAbits
      2 days ago










    • $begingroup$
      @TRISAbits Yeah. But after all even if it were tristated, you'd need the external pulldown on important pins, and if it is pulling to the default state, the average loss is not so much.
      $endgroup$
      – jpa
      yesterday










    • $begingroup$
      The point I was (poorly) making is that the external pull will have to be stronger than otherwise required in order to overdrive the internal pull. If the pins were tri-stated then the pull could be weaker, which would result is less power loss through the external pull.
      $endgroup$
      – TRISAbits
      yesterday















    6












    $begingroup$

    Other answers have given general reasons why a chip maker might make the choice to enable pull-ups by default. However, in the specific case of LPC845, there is an additional reason: it has specialized FAst Initialization Memory (FAIM) that can be used to set the state immediately after reset:




    The FAIM contents provide a user-programmable initial configuration for aspects of the
    microcontroller, which take effect immediately after reset, before code begins to run. For
    instance, the standard I/O pads normally come out of reset with the internal pull-ups
    enabled. In some systems this may cause excess current to flow, until software can
    reconfigure the pads. However, by programming the FAIM appropriately, every pad's reset
    configuration can be customized.




    (LPC84x user manual section 4.2)



    Thus they've chosen the safe (from power usage and EMI point of view) default, while allowing more advanced users to customize the setting.






    share|improve this answer









    $endgroup$












    • $begingroup$
      The downside with the FAIM is that it requires an additional programming step to set it up front, which means that your design should survive the incorrect pull-state until the FAIM is updated. Alternatively you can install a stronger external pull to overdrive the default internal setup, but you've now introduced a perpetual power loss through the external pull. I guess you can't have your cake and eat it too.
      $endgroup$
      – TRISAbits
      2 days ago










    • $begingroup$
      @TRISAbits Yeah. But after all even if it were tristated, you'd need the external pulldown on important pins, and if it is pulling to the default state, the average loss is not so much.
      $endgroup$
      – jpa
      yesterday










    • $begingroup$
      The point I was (poorly) making is that the external pull will have to be stronger than otherwise required in order to overdrive the internal pull. If the pins were tri-stated then the pull could be weaker, which would result is less power loss through the external pull.
      $endgroup$
      – TRISAbits
      yesterday













    6












    6








    6





    $begingroup$

    Other answers have given general reasons why a chip maker might make the choice to enable pull-ups by default. However, in the specific case of LPC845, there is an additional reason: it has specialized FAst Initialization Memory (FAIM) that can be used to set the state immediately after reset:




    The FAIM contents provide a user-programmable initial configuration for aspects of the
    microcontroller, which take effect immediately after reset, before code begins to run. For
    instance, the standard I/O pads normally come out of reset with the internal pull-ups
    enabled. In some systems this may cause excess current to flow, until software can
    reconfigure the pads. However, by programming the FAIM appropriately, every pad's reset
    configuration can be customized.




    (LPC84x user manual section 4.2)



    Thus they've chosen the safe (from power usage and EMI point of view) default, while allowing more advanced users to customize the setting.






    share|improve this answer









    $endgroup$



    Other answers have given general reasons why a chip maker might make the choice to enable pull-ups by default. However, in the specific case of LPC845, there is an additional reason: it has specialized FAst Initialization Memory (FAIM) that can be used to set the state immediately after reset:




    The FAIM contents provide a user-programmable initial configuration for aspects of the
    microcontroller, which take effect immediately after reset, before code begins to run. For
    instance, the standard I/O pads normally come out of reset with the internal pull-ups
    enabled. In some systems this may cause excess current to flow, until software can
    reconfigure the pads. However, by programming the FAIM appropriately, every pad's reset
    configuration can be customized.




    (LPC84x user manual section 4.2)



    Thus they've chosen the safe (from power usage and EMI point of view) default, while allowing more advanced users to customize the setting.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 2 days ago









    jpajpa

    1,546711




    1,546711











    • $begingroup$
      The downside with the FAIM is that it requires an additional programming step to set it up front, which means that your design should survive the incorrect pull-state until the FAIM is updated. Alternatively you can install a stronger external pull to overdrive the default internal setup, but you've now introduced a perpetual power loss through the external pull. I guess you can't have your cake and eat it too.
      $endgroup$
      – TRISAbits
      2 days ago










    • $begingroup$
      @TRISAbits Yeah. But after all even if it were tristated, you'd need the external pulldown on important pins, and if it is pulling to the default state, the average loss is not so much.
      $endgroup$
      – jpa
      yesterday










    • $begingroup$
      The point I was (poorly) making is that the external pull will have to be stronger than otherwise required in order to overdrive the internal pull. If the pins were tri-stated then the pull could be weaker, which would result is less power loss through the external pull.
      $endgroup$
      – TRISAbits
      yesterday
















    • $begingroup$
      The downside with the FAIM is that it requires an additional programming step to set it up front, which means that your design should survive the incorrect pull-state until the FAIM is updated. Alternatively you can install a stronger external pull to overdrive the default internal setup, but you've now introduced a perpetual power loss through the external pull. I guess you can't have your cake and eat it too.
      $endgroup$
      – TRISAbits
      2 days ago










    • $begingroup$
      @TRISAbits Yeah. But after all even if it were tristated, you'd need the external pulldown on important pins, and if it is pulling to the default state, the average loss is not so much.
      $endgroup$
      – jpa
      yesterday










    • $begingroup$
      The point I was (poorly) making is that the external pull will have to be stronger than otherwise required in order to overdrive the internal pull. If the pins were tri-stated then the pull could be weaker, which would result is less power loss through the external pull.
      $endgroup$
      – TRISAbits
      yesterday















    $begingroup$
    The downside with the FAIM is that it requires an additional programming step to set it up front, which means that your design should survive the incorrect pull-state until the FAIM is updated. Alternatively you can install a stronger external pull to overdrive the default internal setup, but you've now introduced a perpetual power loss through the external pull. I guess you can't have your cake and eat it too.
    $endgroup$
    – TRISAbits
    2 days ago




    $begingroup$
    The downside with the FAIM is that it requires an additional programming step to set it up front, which means that your design should survive the incorrect pull-state until the FAIM is updated. Alternatively you can install a stronger external pull to overdrive the default internal setup, but you've now introduced a perpetual power loss through the external pull. I guess you can't have your cake and eat it too.
    $endgroup$
    – TRISAbits
    2 days ago












    $begingroup$
    @TRISAbits Yeah. But after all even if it were tristated, you'd need the external pulldown on important pins, and if it is pulling to the default state, the average loss is not so much.
    $endgroup$
    – jpa
    yesterday




    $begingroup$
    @TRISAbits Yeah. But after all even if it were tristated, you'd need the external pulldown on important pins, and if it is pulling to the default state, the average loss is not so much.
    $endgroup$
    – jpa
    yesterday












    $begingroup$
    The point I was (poorly) making is that the external pull will have to be stronger than otherwise required in order to overdrive the internal pull. If the pins were tri-stated then the pull could be weaker, which would result is less power loss through the external pull.
    $endgroup$
    – TRISAbits
    yesterday




    $begingroup$
    The point I was (poorly) making is that the external pull will have to be stronger than otherwise required in order to overdrive the internal pull. If the pins were tri-stated then the pull could be weaker, which would result is less power loss through the external pull.
    $endgroup$
    – TRISAbits
    yesterday











    4












    $begingroup$

    Back in the days there were Intel 8051 microcontrollers that only had open drain I/O pins, so most of the time you needed external pull-ups anyway to do useful things like connecting to pushbuttons or controlling CMOS inputs of other chips. This is most likely to have easy redesign of such boards with a modern microcontroller, or people from that era that are accustomed to designing with pulled-up open-collector I/Os. Back in the day, you mostly needed pull-ups if anything, and rarely pull-downs.






    share|improve this answer









    $endgroup$












    • $begingroup$
      That's a really interesting bit of insight, and explains why a lot of logic chips have active-low output-enable pins. Active-high logic doesn't mesh as well when the default pull-state is high. As an aside it also doesn't mesh well when directly connected to the gate of a NMOS, unless you want the transistor to turn on by default.
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      Also other chips of that era have active signals when low. TTL chips (74XX and 74LSXX series for example) can pull low stronger than push high. Therefore fast falling edge is sharper and more defined than slow exponentially rising edge. Also small currents flow in and out of chip inputs as they are not so high impedance. Therefore, pull-ups are sometimes necessary, and pull-ups can be weaker than pull-downs, so that's why you have active low logic with pull-ups, with pushbuttons grounding the inputs and outputs turning on LEDs by grounding the LED via resistor.
      $endgroup$
      – Justme
      2 days ago















    4












    $begingroup$

    Back in the days there were Intel 8051 microcontrollers that only had open drain I/O pins, so most of the time you needed external pull-ups anyway to do useful things like connecting to pushbuttons or controlling CMOS inputs of other chips. This is most likely to have easy redesign of such boards with a modern microcontroller, or people from that era that are accustomed to designing with pulled-up open-collector I/Os. Back in the day, you mostly needed pull-ups if anything, and rarely pull-downs.






    share|improve this answer









    $endgroup$












    • $begingroup$
      That's a really interesting bit of insight, and explains why a lot of logic chips have active-low output-enable pins. Active-high logic doesn't mesh as well when the default pull-state is high. As an aside it also doesn't mesh well when directly connected to the gate of a NMOS, unless you want the transistor to turn on by default.
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      Also other chips of that era have active signals when low. TTL chips (74XX and 74LSXX series for example) can pull low stronger than push high. Therefore fast falling edge is sharper and more defined than slow exponentially rising edge. Also small currents flow in and out of chip inputs as they are not so high impedance. Therefore, pull-ups are sometimes necessary, and pull-ups can be weaker than pull-downs, so that's why you have active low logic with pull-ups, with pushbuttons grounding the inputs and outputs turning on LEDs by grounding the LED via resistor.
      $endgroup$
      – Justme
      2 days ago













    4












    4








    4





    $begingroup$

    Back in the days there were Intel 8051 microcontrollers that only had open drain I/O pins, so most of the time you needed external pull-ups anyway to do useful things like connecting to pushbuttons or controlling CMOS inputs of other chips. This is most likely to have easy redesign of such boards with a modern microcontroller, or people from that era that are accustomed to designing with pulled-up open-collector I/Os. Back in the day, you mostly needed pull-ups if anything, and rarely pull-downs.






    share|improve this answer









    $endgroup$



    Back in the days there were Intel 8051 microcontrollers that only had open drain I/O pins, so most of the time you needed external pull-ups anyway to do useful things like connecting to pushbuttons or controlling CMOS inputs of other chips. This is most likely to have easy redesign of such boards with a modern microcontroller, or people from that era that are accustomed to designing with pulled-up open-collector I/Os. Back in the day, you mostly needed pull-ups if anything, and rarely pull-downs.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 2 days ago









    JustmeJustme

    1,7921411




    1,7921411











    • $begingroup$
      That's a really interesting bit of insight, and explains why a lot of logic chips have active-low output-enable pins. Active-high logic doesn't mesh as well when the default pull-state is high. As an aside it also doesn't mesh well when directly connected to the gate of a NMOS, unless you want the transistor to turn on by default.
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      Also other chips of that era have active signals when low. TTL chips (74XX and 74LSXX series for example) can pull low stronger than push high. Therefore fast falling edge is sharper and more defined than slow exponentially rising edge. Also small currents flow in and out of chip inputs as they are not so high impedance. Therefore, pull-ups are sometimes necessary, and pull-ups can be weaker than pull-downs, so that's why you have active low logic with pull-ups, with pushbuttons grounding the inputs and outputs turning on LEDs by grounding the LED via resistor.
      $endgroup$
      – Justme
      2 days ago
















    • $begingroup$
      That's a really interesting bit of insight, and explains why a lot of logic chips have active-low output-enable pins. Active-high logic doesn't mesh as well when the default pull-state is high. As an aside it also doesn't mesh well when directly connected to the gate of a NMOS, unless you want the transistor to turn on by default.
      $endgroup$
      – TRISAbits
      2 days ago






    • 2




      $begingroup$
      Also other chips of that era have active signals when low. TTL chips (74XX and 74LSXX series for example) can pull low stronger than push high. Therefore fast falling edge is sharper and more defined than slow exponentially rising edge. Also small currents flow in and out of chip inputs as they are not so high impedance. Therefore, pull-ups are sometimes necessary, and pull-ups can be weaker than pull-downs, so that's why you have active low logic with pull-ups, with pushbuttons grounding the inputs and outputs turning on LEDs by grounding the LED via resistor.
      $endgroup$
      – Justme
      2 days ago















    $begingroup$
    That's a really interesting bit of insight, and explains why a lot of logic chips have active-low output-enable pins. Active-high logic doesn't mesh as well when the default pull-state is high. As an aside it also doesn't mesh well when directly connected to the gate of a NMOS, unless you want the transistor to turn on by default.
    $endgroup$
    – TRISAbits
    2 days ago




    $begingroup$
    That's a really interesting bit of insight, and explains why a lot of logic chips have active-low output-enable pins. Active-high logic doesn't mesh as well when the default pull-state is high. As an aside it also doesn't mesh well when directly connected to the gate of a NMOS, unless you want the transistor to turn on by default.
    $endgroup$
    – TRISAbits
    2 days ago




    2




    2




    $begingroup$
    Also other chips of that era have active signals when low. TTL chips (74XX and 74LSXX series for example) can pull low stronger than push high. Therefore fast falling edge is sharper and more defined than slow exponentially rising edge. Also small currents flow in and out of chip inputs as they are not so high impedance. Therefore, pull-ups are sometimes necessary, and pull-ups can be weaker than pull-downs, so that's why you have active low logic with pull-ups, with pushbuttons grounding the inputs and outputs turning on LEDs by grounding the LED via resistor.
    $endgroup$
    – Justme
    2 days ago




    $begingroup$
    Also other chips of that era have active signals when low. TTL chips (74XX and 74LSXX series for example) can pull low stronger than push high. Therefore fast falling edge is sharper and more defined than slow exponentially rising edge. Also small currents flow in and out of chip inputs as they are not so high impedance. Therefore, pull-ups are sometimes necessary, and pull-ups can be weaker than pull-downs, so that's why you have active low logic with pull-ups, with pushbuttons grounding the inputs and outputs turning on LEDs by grounding the LED via resistor.
    $endgroup$
    – Justme
    2 days ago











    3












    $begingroup$

    Leaving GPIO pins as tri-stated inputs have many undesirable effects:



    1. As manufacturing process has certain variance and a lot of other circuitry is connected to GPIO (as output buffer and ESD protection), direction of resulting parasitic leakage is unpredictable, so the state can take either logic high or low;


    2. Again, due to process variation and temperature dependence, the pin leakage can be very small, resulting in either very slow change of logic state after, say, several minutes, which might be a challenge to accommodate in code, or it can drift in unpredictable direction.


    3. Leaving pins floating might lead to establishing some middle potential, where the pin input buffer may act as linear amplifier with substantial gain, causing either self-oscillations (due to parasitic positive feedback across power rails), or be susceptible to external electromagnetic interference. Oscillations can be somewhere internally, and lead to out-of range power consumption.


    4... must forget something else... power-on transients?






    share|improve this answer









    $endgroup$

















      3












      $begingroup$

      Leaving GPIO pins as tri-stated inputs have many undesirable effects:



      1. As manufacturing process has certain variance and a lot of other circuitry is connected to GPIO (as output buffer and ESD protection), direction of resulting parasitic leakage is unpredictable, so the state can take either logic high or low;


      2. Again, due to process variation and temperature dependence, the pin leakage can be very small, resulting in either very slow change of logic state after, say, several minutes, which might be a challenge to accommodate in code, or it can drift in unpredictable direction.


      3. Leaving pins floating might lead to establishing some middle potential, where the pin input buffer may act as linear amplifier with substantial gain, causing either self-oscillations (due to parasitic positive feedback across power rails), or be susceptible to external electromagnetic interference. Oscillations can be somewhere internally, and lead to out-of range power consumption.


      4... must forget something else... power-on transients?






      share|improve this answer









      $endgroup$















        3












        3








        3





        $begingroup$

        Leaving GPIO pins as tri-stated inputs have many undesirable effects:



        1. As manufacturing process has certain variance and a lot of other circuitry is connected to GPIO (as output buffer and ESD protection), direction of resulting parasitic leakage is unpredictable, so the state can take either logic high or low;


        2. Again, due to process variation and temperature dependence, the pin leakage can be very small, resulting in either very slow change of logic state after, say, several minutes, which might be a challenge to accommodate in code, or it can drift in unpredictable direction.


        3. Leaving pins floating might lead to establishing some middle potential, where the pin input buffer may act as linear amplifier with substantial gain, causing either self-oscillations (due to parasitic positive feedback across power rails), or be susceptible to external electromagnetic interference. Oscillations can be somewhere internally, and lead to out-of range power consumption.


        4... must forget something else... power-on transients?






        share|improve this answer









        $endgroup$



        Leaving GPIO pins as tri-stated inputs have many undesirable effects:



        1. As manufacturing process has certain variance and a lot of other circuitry is connected to GPIO (as output buffer and ESD protection), direction of resulting parasitic leakage is unpredictable, so the state can take either logic high or low;


        2. Again, due to process variation and temperature dependence, the pin leakage can be very small, resulting in either very slow change of logic state after, say, several minutes, which might be a challenge to accommodate in code, or it can drift in unpredictable direction.


        3. Leaving pins floating might lead to establishing some middle potential, where the pin input buffer may act as linear amplifier with substantial gain, causing either self-oscillations (due to parasitic positive feedback across power rails), or be susceptible to external electromagnetic interference. Oscillations can be somewhere internally, and lead to out-of range power consumption.


        4... must forget something else... power-on transients?







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        Ale..chenskiAle..chenski

        28.4k11866




        28.4k11866





















            3












            $begingroup$

            From a systems point of view, having the pins start in a defined state is a benefit. For example, a motor might be attached that shouldn't be activated without command. Peripherals usually expect their interfaces to be in a certain state, and starting in high-Z may not provide the required state. As the internal pull ups/downs in a typical microcontroller are relatively weak, they may be overridden by a stronger external pull up/down where required. As an additional note, it is nice to see in the datasheet what the expected behaviour of the pins is, this is sometimes not included..!






            share|improve this answer









            $endgroup$








            • 1




              $begingroup$
              The problem with providing an external pull-up when an internal one is enabled is two-fold: [1] The external pull has to be properly sized to be far stronger (good rule of thumb is at least 10x). Otherwise you will create a voltage divider, which can set the voltage into that middle no-mans-land zone. [2] The stronger external pull introduces a continuous power loss (if the pin state is frequently opposite the pull direction), which will quickly consume more power than any loses from having tri-stated pins out of reset.
              $endgroup$
              – TRISAbits
              2 days ago










            • $begingroup$
              @TRISAbits Agreed on both points. Not that desirable to override, but most internals are 50-100K so not disasterous. Read the manual, as ever :)
              $endgroup$
              – awjlogan
              2 days ago











            • $begingroup$
              @TRISAbits And also it's not about power in this example, it's about how the wider system interacts at reset, not just the MCU.
              $endgroup$
              – awjlogan
              2 days ago
















            3












            $begingroup$

            From a systems point of view, having the pins start in a defined state is a benefit. For example, a motor might be attached that shouldn't be activated without command. Peripherals usually expect their interfaces to be in a certain state, and starting in high-Z may not provide the required state. As the internal pull ups/downs in a typical microcontroller are relatively weak, they may be overridden by a stronger external pull up/down where required. As an additional note, it is nice to see in the datasheet what the expected behaviour of the pins is, this is sometimes not included..!






            share|improve this answer









            $endgroup$








            • 1




              $begingroup$
              The problem with providing an external pull-up when an internal one is enabled is two-fold: [1] The external pull has to be properly sized to be far stronger (good rule of thumb is at least 10x). Otherwise you will create a voltage divider, which can set the voltage into that middle no-mans-land zone. [2] The stronger external pull introduces a continuous power loss (if the pin state is frequently opposite the pull direction), which will quickly consume more power than any loses from having tri-stated pins out of reset.
              $endgroup$
              – TRISAbits
              2 days ago










            • $begingroup$
              @TRISAbits Agreed on both points. Not that desirable to override, but most internals are 50-100K so not disasterous. Read the manual, as ever :)
              $endgroup$
              – awjlogan
              2 days ago











            • $begingroup$
              @TRISAbits And also it's not about power in this example, it's about how the wider system interacts at reset, not just the MCU.
              $endgroup$
              – awjlogan
              2 days ago














            3












            3








            3





            $begingroup$

            From a systems point of view, having the pins start in a defined state is a benefit. For example, a motor might be attached that shouldn't be activated without command. Peripherals usually expect their interfaces to be in a certain state, and starting in high-Z may not provide the required state. As the internal pull ups/downs in a typical microcontroller are relatively weak, they may be overridden by a stronger external pull up/down where required. As an additional note, it is nice to see in the datasheet what the expected behaviour of the pins is, this is sometimes not included..!






            share|improve this answer









            $endgroup$



            From a systems point of view, having the pins start in a defined state is a benefit. For example, a motor might be attached that shouldn't be activated without command. Peripherals usually expect their interfaces to be in a certain state, and starting in high-Z may not provide the required state. As the internal pull ups/downs in a typical microcontroller are relatively weak, they may be overridden by a stronger external pull up/down where required. As an additional note, it is nice to see in the datasheet what the expected behaviour of the pins is, this is sometimes not included..!







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 days ago









            awjloganawjlogan

            3,79911328




            3,79911328







            • 1




              $begingroup$
              The problem with providing an external pull-up when an internal one is enabled is two-fold: [1] The external pull has to be properly sized to be far stronger (good rule of thumb is at least 10x). Otherwise you will create a voltage divider, which can set the voltage into that middle no-mans-land zone. [2] The stronger external pull introduces a continuous power loss (if the pin state is frequently opposite the pull direction), which will quickly consume more power than any loses from having tri-stated pins out of reset.
              $endgroup$
              – TRISAbits
              2 days ago










            • $begingroup$
              @TRISAbits Agreed on both points. Not that desirable to override, but most internals are 50-100K so not disasterous. Read the manual, as ever :)
              $endgroup$
              – awjlogan
              2 days ago











            • $begingroup$
              @TRISAbits And also it's not about power in this example, it's about how the wider system interacts at reset, not just the MCU.
              $endgroup$
              – awjlogan
              2 days ago













            • 1




              $begingroup$
              The problem with providing an external pull-up when an internal one is enabled is two-fold: [1] The external pull has to be properly sized to be far stronger (good rule of thumb is at least 10x). Otherwise you will create a voltage divider, which can set the voltage into that middle no-mans-land zone. [2] The stronger external pull introduces a continuous power loss (if the pin state is frequently opposite the pull direction), which will quickly consume more power than any loses from having tri-stated pins out of reset.
              $endgroup$
              – TRISAbits
              2 days ago










            • $begingroup$
              @TRISAbits Agreed on both points. Not that desirable to override, but most internals are 50-100K so not disasterous. Read the manual, as ever :)
              $endgroup$
              – awjlogan
              2 days ago











            • $begingroup$
              @TRISAbits And also it's not about power in this example, it's about how the wider system interacts at reset, not just the MCU.
              $endgroup$
              – awjlogan
              2 days ago








            1




            1




            $begingroup$
            The problem with providing an external pull-up when an internal one is enabled is two-fold: [1] The external pull has to be properly sized to be far stronger (good rule of thumb is at least 10x). Otherwise you will create a voltage divider, which can set the voltage into that middle no-mans-land zone. [2] The stronger external pull introduces a continuous power loss (if the pin state is frequently opposite the pull direction), which will quickly consume more power than any loses from having tri-stated pins out of reset.
            $endgroup$
            – TRISAbits
            2 days ago




            $begingroup$
            The problem with providing an external pull-up when an internal one is enabled is two-fold: [1] The external pull has to be properly sized to be far stronger (good rule of thumb is at least 10x). Otherwise you will create a voltage divider, which can set the voltage into that middle no-mans-land zone. [2] The stronger external pull introduces a continuous power loss (if the pin state is frequently opposite the pull direction), which will quickly consume more power than any loses from having tri-stated pins out of reset.
            $endgroup$
            – TRISAbits
            2 days ago












            $begingroup$
            @TRISAbits Agreed on both points. Not that desirable to override, but most internals are 50-100K so not disasterous. Read the manual, as ever :)
            $endgroup$
            – awjlogan
            2 days ago





            $begingroup$
            @TRISAbits Agreed on both points. Not that desirable to override, but most internals are 50-100K so not disasterous. Read the manual, as ever :)
            $endgroup$
            – awjlogan
            2 days ago













            $begingroup$
            @TRISAbits And also it's not about power in this example, it's about how the wider system interacts at reset, not just the MCU.
            $endgroup$
            – awjlogan
            2 days ago





            $begingroup$
            @TRISAbits And also it's not about power in this example, it's about how the wider system interacts at reset, not just the MCU.
            $endgroup$
            – awjlogan
            2 days ago


















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Electrical Engineering Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f427888%2freasons-for-having-mcu-pin-states-default-to-pull-up-down-out-of-reset%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Is flight data recorder erased after every flight?When are black boxes used?What protects the location beacon (pinger) of a flight data recorder?Is there anywhere I can pick up raw flight data recorder information?Who legally owns the Flight Data Recorder?Constructing flight recorder dataWhy are FDRs and CVRs still two separate physical devices?What are the data elements shown on the GE235 flight data recorder (FDR) plot?Are CVR and FDR reset after every flight?What is the format of data stored by a Flight Data Recorder?How much data is stored in the flight data recorder per hour in a typical flight of an A380?Is a smart flight data recorder possible?

            Which is better: GPT or RelGAN for text generation?2019 Community Moderator ElectionWhat is the difference between TextGAN and LM for text generation?GANs (generative adversarial networks) possible for text as well?Generator loss not decreasing- text to image synthesisChoosing a right algorithm for template-based text generationHow should I format input and output for text generation with LSTMsGumbel Softmax vs Vanilla Softmax for GAN trainingWhich neural network to choose for classification from text/speech?NLP text autoencoder that generates text in poetic meterWhat is the interpretation of the expectation notation in the GAN formulation?What is the difference between TextGAN and LM for text generation?How to prepare the data for text generation task

            Is there a general name for the setup in which payoffs are not known exactly but players try to influence each other's perception of the payoffs?Osborne, Nash equilibria and the correctness of beliefsIs there a name for this family of games (Binomial games?)?Perfect Bayesian EquilibriumCalculating mixed strategy equilibrium in battle of sexesPure Strategy SPNEIs there a commitment mechanism which allows players to achieve pareto optimal solutions?Extensive Form GamesAn $n$-player prisoner's dilemma where a coalition of 2 players is better off defectingTit-For-Stat Strategy Best RepliesPotential solutions of the $n$-player Prisoner's Dilemma