pbindahouse 0 Posted June 26, 2013 Share Posted June 26, 2013 I have an external button ( P1.5) How do I create an interrupt when the button is pushed? all I have is a timer A interrupt which runs at regular intervals. How does one create an interrupt that runs on an asynchronous event? Thanks Quote Link to post Share on other sites
rockets4kids 204 Posted June 26, 2013 Share Posted June 26, 2013 You don't generally want to have a pushbutton generate interrupts, as the bounce in the switch will cause a whole chain of interrupts. You could add external de-bounce circuitry, but it is generally easier to sample the pin to determine effective state change. Quote Link to post Share on other sites
lalalandrus 16 Posted June 26, 2013 Share Posted June 26, 2013 one can implement a simple RC circuit to debounce as well. it is implemented on the launchpad for pin 1.3. look at the schematic another way to use once in the interrupt__delay_cycles(n) to debounce it n cycles within the interrupt, not the most efficient but it will do to get one started. Quote Link to post Share on other sites
roadrunner84 466 Posted June 26, 2013 Share Posted June 26, 2013 I'd like to help you, but your question is directly answered in (a lot of) other threads. Please try to put some effort in searching the forum before asking a question, or at least state what you've tried and where you got stuck. Quote Link to post Share on other sites
rockets4kids 204 Posted June 26, 2013 Share Posted June 26, 2013 one can implement a simple RC circuit to debounce as well. it is implemented on the launchpad for pin 1.3. look at the schematic R34 and C24 are not populated on Rev 1.5 LaunchPads. And even when they are on Rev 1.4 Launchpads, the design is sub-optimal. R/C debounce is only reliable only with careful consideration to design and component selection. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.