Hi
I am trying to replace an MQX software debounce control that we have with port filtering on the input of an interrupt driven bit on a port. Is this a reasonable thing to do? I can see that using the 1 kHz LPO clock and the max field width, we can only get 64ms debounce and we normally need about 200 for a mechanical switch. I thought we would do a time difference and reject the changes under 200ms, or can someone suggest a better design?
Is there functionality to use the lwgpio driver to set the filter characteristics for DFER , DFCR and DFWR registers for a given port on the K20dx256 for example? I know how to do this with bit bashing, but I wondered if there was a way in the lwgpio API's? I can't see one.
Any advice is welcome and appreciated. Thank you.
Robert Lewis
Hello Robert,
Unfortunately there is no option in the LWGPIO to have this feature, I strongly suggest that this may be solved by hardware using a Capacitor and resistor, but I think you can implement this option in any case if you want to apply to software solution:
- Read the signal, start a timer and then read again
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------