The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: GPIO debounce not working
#1
It seems that the debounce function in GPIO does not work in the way it should.
I use GPIO (pin 14) to initiate a smooth shutdown: "sudo shutdown -h now"
This signal comes from a glitch free source: a mini supercap based UPS, that powers the PI for at least 30 seconds to prevent SD card damage.
(0V = UPS OK, 3.3V indicates a powerfailure, and shutdown is required)

I tried different settings for debounde (1000ms...2000ms) but this does not add any delay in response, which I would expect.

Upon first detection (edge) of the pin level change, the shutdown is instantly carried out.


I started to notice this, as when a big transformer in the room next door was turned off, this also stopped the music.
Upon check, it was found that the PI nicely shutdown-ed itself...

As these EMI spikes from the transformer are very short, a 2ms debounce would have worked, a 1000ms for sure would make
the PI blind to any noisy input Big Grin

@ Tim,
Could you have a check if my statement is correct?

Second: marvelous player you & the team put together!
i use a PI3B+, Allo BOSS DAC & 7" standard touch display.. it works really good.

Regards from Taiwan
Reply


Messages In This Thread
GPIO debounce not working - by Jewa_TWN - 06-23-2019, 07:16 AM
RE: GPIO debounce not working - by Tim Curtis - 06-23-2019, 12:55 PM
RE: GPIO debounce not working - by Jewa_TWN - 06-24-2019, 07:12 AM
RE: GPIO debounce not working - by Tim Curtis - 06-24-2019, 01:20 PM
RE: GPIO debounce not working - by Jewa_TWN - 06-25-2019, 08:19 AM
RE: GPIO debounce not working - by Jewa_TWN - 06-29-2019, 09:12 AM
RE: GPIO debounce not working - by Jewa_TWN - 07-20-2019, 09:39 AM

Forum Jump: