2
\$\begingroup\$

If a GPIO pin is not interrupt configurable as external interrupt, is it still possible by any chance to detect the button press on the pin without polling just like an interrupt?

\$\endgroup\$
4
  • 3
    \$\begingroup\$ Seems unlikely, which micro? There may be bodges like configuring the pin as analogue and having an analogue watchdog interrupt when it goes above/below a level, or similar with a comparator or timer input capture or something. \$\endgroup\$
    – Colin
    Sep 24, 2020 at 10:07
  • \$\begingroup\$ Here it is. Please refer to page number 12. The pin is P71/GE_SPDQ0/GE_HBCSX0 35 [cypress.com/file/236586/download] \$\endgroup\$
    – Nikeboy
    Sep 24, 2020 at 10:56
  • \$\begingroup\$ @Nikeboy You must log in or register to access this page. \$\endgroup\$
    – schnedan
    Sep 24, 2020 at 11:55
  • 2
    \$\begingroup\$ Depends on what other internal peripheral modules are connected to that pin. Maybe there's a timer which you could configure to generate an interrupt after a single count or something like that. Can you share some more info - which micro and which pin? \$\endgroup\$
    – brhans
    Sep 24, 2020 at 12:24

1 Answer 1

2
\$\begingroup\$

Not directly, but if you have a periodic interrupt going for other purposes you could add a poll of your button in there. If you don't, you could add a periodic interrupt at some nominal rate (20-100ms) and poll your button there (assuming this is a human-pushed button, you don't need any more resolution than that).

This doesn't save you the wasted time of reading a button that hasn't changed, but it does save you the hassle of polling in the background.

\$\endgroup\$
1
  • \$\begingroup\$ That makes complete sense. Thanks a lot :) \$\endgroup\$
    – Nikeboy
    Sep 25, 2020 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.