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
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
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
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
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
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
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.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.
Warning I'm not a teacher
Bookmarks