Any other pin works properly with “InterruptIn” but not the PC_11, I tried rize and fall without success.
do you have any idea why only PC_11 is not triggering?
#include "mbed.h"
InterruptIn button(PC_11); //button press HIGH
DigitalOut led(PB_1); //LED
void flip()
{
led = !led;
}
int main()
{
button.rise(&flip); //
while (1) { // wait around, interrupts will interrupt this!
ThisThread::sleep_for(250);
}
}
I think that I found the problem, I am also using the pin PB_11 as interrupt and seems is not possible
to get 2 interrupt pins with the same number “11” at the same time.
The number of available external interrupt lines (channels) is usually less than the number of GPIO pins. That’s why the GPIO pins are grouped and each group is connected to different external interrupt line. If it happens that you select two (or more) pins that are in the same group (connected to the same external interrupt line) then only the latest will work. I’d recommend to read the user manual of your MCU to see how the GPIOs are grouped and connected to the individual external interrupt lines. Most likely PB11 and PC11 are in the same group.