Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 5 months ago.
InterruptIn not working except PC_13 pin on ST Nucleo F103RB !!!!!
- include "mbed.h"
InterruptIn event(PC14); DigitalOut led(LED1);
void trigger() { printf("triggered!\n"); }
int main() { event.rise(&trigger); while(1) { led = !led; wait(0.25); } }
Above code is not working on STM32F103RB nucleo board, but works for USER_BUTTON(i.e PC_13).please help!!!
Question relating to:
1 Answer
10 years, 5 months ago.
If I name the pin PC_14 instead of PC14, it works fine for me...
If I do so , it gives me error... Error: Identifier "PC14" is undefined in "main.cpp",
posted by 25 Jul 2014I get the compile error if I use PC14 (from your original code)
If I use PC_14, the interrupt is behaving as expected for me.
What do you have connected on PC14?
If the pin is floating, I get many spurious interrupt due noise being picked up by the pin.
If the pin is connected to a push button, I get the same behavior as PC_13: one message sent to the terminal every time I press.
once in a while I get 2 messages probably due to the bouncing of the switch.
For me all this is normal behavior.
posted by 25 Jul 2014
A note: What does "not working mean" ? Is there compiler error ? Linker error? Runtime error? Share more details.
posted by Martin Kojtal 24 Jul 2014code will compile, but program flow will not come out from "InterruptIn event(PC14);" line while running..
posted by prabin yadav 24 Jul 2014