Using GPIO interrupts
#2
(06-30-2021, 06:39 AM)antonlyap Wrote: I'm experimenting with GPIO interrupts on my RockPro64. I used the "Watching buttons" example from here: https://www.npmjs.com/package/epoll, but I changed the pin number to 156 (GPIO4_D4, pin 31 on the header).

The hardware is as follows: there's a mechanical switch between the supply (a buck converter with 3V output) and GPIO4_D4 and a 10k pull-down resistor between GPIO4_D4 and ground.

My issue is that when the button is released, the script just constantly spits out "released" (falling edge) events as fast as it can. When I close the switch, I get a couple of rising edge events, then a few falling edge events and then again a few rising edges. Then rising edge events pop up occasionally while the switch is still closed. I also found out that if I connect GPIO4_D4 directly to ground (with the switch open), the falling edge interrupts aren't emitted as frequently.

I'm aware of the fact that mechanical switches have contact bouncing, but is it normal that the events are repeated several times? Has anyone made a working hardware and software setup to detect interrupts with RockPro64? I would appreciate if you share your experiences Smile Thanks!

export is depreciated and was actually removed in the newer kernels.
gpiolib is the route you are supposed to take now.

You may want to consider enabling the internal pulldown resistor to see if that helps.
  Reply


Messages In This Thread
Using GPIO interrupts - by antonlyap - 06-30-2021, 06:39 AM
RE: Using GPIO interrupts with sysfs and epoll - by pgwipeout - 06-30-2021, 06:59 AM
RE: Using GPIO interrupts - by antonlyap - 06-30-2021, 01:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  GPIO on the RockPro64 - all pins high? colinmarc 2 210 11-18-2022, 10:20 AM
Last Post: colinmarc
  GPIO Expander HAT for ROCKPro64 and Quartz64 CounterPillow 7 2,452 07-18-2022, 10:05 PM
Last Post: zer0sig
  GPIO performance 100x slower compared to Raspberry Pi 3 axelf 9 7,007 08-19-2020, 04:41 PM
Last Post: Gienek
  GPIO in sleep mode Mentaluproar 2 2,528 04-08-2019, 03:50 PM
Last Post: Mentaluproar

Forum Jump:


Users browsing this thread: 1 Guest(s)