跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

How do I create push button interrupts on a Synergy kit?

Latest Updated:12/08/2017

Question:

How do I create interrupts for buttons on my Synergy Kit?

Answer:

It is easy to use push buttons to generate an interrupt on Synergy Kits.

First: Look at the schematic for the kit to determine which MCU pins are connected to the push button. Set these pins as inputs in the configurator. If you are using the BSP, these will probably already be configured correctly.

Next: In the configurator make sure they are enabled for IRQ. Now define a name for the callback function associated with the interrupt. Create a callback routine that responds to the push button interrupt. You may want to use a de-bouncing routine to eliminate follow-on interrupts caused by a switch bounce. 

For an example: The tone generator project includes a good example and description of a push button (section 3.1). A PDF description of the Application Example is available here: https://www.renesas.com/search/keyword-search.html#q=r12an0051

The project is located here: https://www.renesas.com/software/D6000226.html