Pull down button on Port B


+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    235

    Default Pull down button on Port B

    Using weak pullups on port B of 16f1936. A button to ground will cause an interrupt on IOCBN.
    Question: should I use a low value resistor in line with this pull down button?

    Wayne

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Pull down button on Port B

    if your query is to do with ameliorating effect of debounce capacitor

    google ai says

    effect of debounce capacitor on contact life


    Adding a debounce capacitor can both extend and shorten switch contact life, depending on its circuit placement and whether it is used with a current-limiting resistor.
    1. Protection Against Arcing (Positive Effect)
    When a switch opens, especially with inductive loads (like motors or relays), a high-voltage spike can occur, causing an electrical arc that erodes the contacts.
    Arc Suppression: A capacitor placed across the switch contacts acts as a temporary short, absorbing the energy that would otherwise cause a spark.
    Longevity: By quickly quenching the arc, the capacitor reduces material transfer (erosion) and prevents contacts from "welding" together, significantly extending electrical life.
    2. High Inrush Current (Negative Effect)
    If a capacitor is placed directly across the switch without a series resistor, it can damage the contacts during closure.
    Current Spikes: When the switch closes, the capacitor discharges nearly instantaneously. This creates a massive surge of current—potentially hundreds of amperes for a few nanoseconds—which can cause a brief but severe arc or even weld the contacts shut.
    Contact Erosion: For sensitive switches like reed relays, this tiny but intense arc can rapidly erode the contact area and shorten their lifespan.
    3. Best Practice: The RC Snubber
    To balance these effects, engineers typically use an RC network (a resistor and capacitor in series) rather than just a capacitor.
    The Resistor's Role: It limits the discharge current when the switch closes, protecting the contacts from inrush spikes.
    The Capacitor's Role: It still provides the necessary dV/dt limiting to prevent arcing when the switch opens.
    Result: Properly sized RC components ensure the longest possible contact life by mitigating both opening-arc erosion and closing-surge welding.
    Warning I'm not a teacher

  3. #3
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    235


    Did you find this post helpful? Yes | No

    Default Re: Pull down button on Port B

    thanks Richard for the reply. My point is to limit the current surge when the PortB pin drops from 5v to 0v at the button push. My thinking is there is a spike of current that may damage the PortB pin. Of course with no load there may be little current anyway. comments anyone?

    Wayne

  4. #4
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    235


    Did you find this post helpful? Yes | No

    Default Re: Pull down button on Port B

    Solved: Microchip Applacation note AN552
    "The series 100Ω resistors are used for Electrostatic Discharge (ESD) protection."

    OK, I think I was on the right track. In fact I was considering 100Ω resistors in my design then came across AN552.

    Wayne

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default Re: Pull down button on Port B

    Ther only way high current may damage the input pin is by inducing that current from an external source. I do not know how is your settup exctly, but if you do have long wires or nearby high voltage cables, or even relays, motors etc, there could be a small chance of hurting that input.

    You may:

    1. put an external lower value pull-up resistor, say 470 ohm
    2. put a capacitor in parallel with the switch but close to the pic input and gnd
    3. add that 100 ohm resistor

    In any case, if ESD is of concern, i'd not trust the 100 ohm resistor alone. Would use all 3 above.

    Even better on the pic side of that 100 ohm at its pin, adding a ferrite ring would increase the resistance for fast spikes maybe up to 1K.

    I had no problems up to this moment with just internal pull-up only, and with cable to the button less than 8cm. No false trigger or even port mulfunction.

    Ioannis

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Pull down button on Port B

    I had no problems up to this moment with just internal pull-up only, and with cable to the button less than 8cm. No false trigger or even port mulfunction.
    keep in mind AN552 refers to ancient technology that has no esd protection of any kind [like esd diodes], with contemporary chips i would expect no trouble either.
    Warning I'm not a teacher

Similar Threads

  1. Enabling weak internal pull up resistors on port B
    By dbodenheimer in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 8th October 2010, 16:55
  2. Weak pull Up 12F629
    By Lionheart in forum General
    Replies: 1
    Last Post: - 9th December 2008, 22:07
  3. 12F683 internal pull up
    By hvacrtech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th July 2008, 03:35
  4. Using weak pull-up
    By Sharky in forum General
    Replies: 6
    Last Post: - 11th September 2007, 07:44
  5. 18F4585 adc-in Pull-up ????
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th April 2006, 16:00

Members who have read this thread : 7

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts