Hi everyone,
I have been trying to set up an interrupt by pressing the SW1 button on the RSK RZ/N2L, but it does not work. The button is located on P16_3. I set it as IRQ7, as specified by the RSK document. I have attached a picture of the pin configuration.
When it comes to the interrupt configuration, I used the following, which seems to be fine:
And lastly, the code is simple, just enable the interrupt and wait. Once a button press occurs, trigger interrupt and toggle a value:
Still, if I put a breakpoint in debugging or just code to turn on an LED in the callback function, the function is never triggered if I press SW1. Could I be missing something fundamentally like the additional setup for the pin where the button is connected? I have tried to see if Digital filtering on the interrupt or Schmitt trigger on the pin would fix the issue but still no interrupt being triggered on button press. I have been able to create a polling approach that works, but that is not what I am looking for. Does someone have an idea what could be going on?
Best regards
Hi Beri,Our team is investigating your issue and will reach to you as soon as possible.Kind Regards.
I can not see any issue with external interrupts. Interrupt on button press SW1 is working simply fine with me. When button is pressed, I can reach the breakpoint placed inside the IRQ07 call back function.
it is working fine with both Digital filtering enable and disable.
I simply try with following following code. Please recheck your code.
Thank you very much for the reply, Kazi; I think the button I have is defective since it did enter the interrupt callback routine once randomly, and in polling I have to constantly press it until it registers it was pressed.
I think the reason behind is clear,
where are you re-writing the g_external_irq_complete = 0 for holding you in the while loop for next interrupt?