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?
Asked
Active
Viewed 135 times
2
-
3Seems 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. – Colin Sep 24 '20 at 10:07
-
Here it is. Please refer to page number 12. The pin is P71/GE_SPDQ0/GE_HBCSX0 35 [https://www.cypress.com/file/236586/download] – Nikeboy Sep 24 '20 at 10:56
-
@Nikeboy You must log in or register to access this page. – schnedan Sep 24 '20 at 11:55
-
2Depends 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? – brhans Sep 24 '20 at 12:24
1 Answers
2
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.

td127
- 2,932
- 6
- 13