Dear all,
for our project we need to debounce two Gpio Inputs from the imx6ull-emmc v1.1 module.
so i think it is possible with a device tree overlay. i found this option here from another topic
debounce-interval = <10>;
but it is only used in gpio-keys. so does anybody knows how i could add this to the pin SODIMM_102 and SODIMM_104?
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello Florian,
To debounce GPIO inputs on the iMX6ULL module using a device tree overlay, you indeed can use the debounce-interval property, similar to how it’s used within the gpio-keys node. However, this property is specific to the gpio-keys driver, which means it’s not directly applicable to general GPIO pin configuration outside of a gpio-keys context.
If your application allows treating these GPIOs as input keys, you could define them within a gpio-keys node in your device tree overlay. Here’s how you could approach it for SODIMM_102 and SODIMM_104:
Thank you for contacting us. May I ask what specific use you will have for the gpios? Will you be using them for buttons?
Probably the easiest way to debounce them in that case would be a hardware debounce through capacitors.
Should you want to use wakeup, there is an example in this link.
Capacitor discharge current, which is limited only by closed contacts resistance, I fear may lead to premature button failure. Adding extra current limiting resistor may further complicate input circuit, for the best you would need comparator… The easiest, I believe, is software debouncing. Once you (de)press the button (input edge interrupt), you signal button event and start debounce timer. Once timer expires, you reread input, and if new readout value doesn’t agree with last valid edge (button got (de)released during debounce period), you signal new event and start debounce timer again. Worst buttons and switches have 50ms or longer bouncing time, so something like 50ms should be your debouncing timer expiration value. New switches may be better, but it so annoying to see rotary knob heavily misbehaving on few years old device, so you should keep as high as suitable for your application.