cancel
Showing results for 
Search instead for 
Did you mean: 

identify the PORT generating an EXTI

dbilancione
Associate II
Posted on July 14, 2013 at 15:10

dear all,

   I hope this finds you well. I am relatively new to such technology and I am working on some drivers. The board I am using has 4 LEDs, a joystick and a couple of buttons (WAKEUP and USER). I have implemented a simple program where I was polling the state of the joystick and the push-buttons and switching LEDs ON and OFF. The next step was to modify the program and use interrupts to switch LEDs instead, according to the push-button/the joystick pin pressed.

The LEFT joystick pin is connected to PC0 whereas the WAKEUP button to PA0. These are multiplexed on EXTI_LINE0. I have swiftly looked in the reference manual but I could not find a way to identify the port which is generating the interrupt on EXTI_LINE0. Is there a way to check that?

thank you!

#stm32f4 #exti #gpio
7 REPLIES 7
Posted on July 14, 2013 at 15:29

Well not really, the multiplexing is not something that's actively supported, because the results can be indeterminable.

Your only option is to look at the current state of the pins.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dbilancione
Associate II
Posted on July 14, 2013 at 15:41

thank you for the swift reply clive! that is what I thought but I was hoping for a better option.

regards

dbilancione
Associate II
Posted on July 14, 2013 at 16:30

hey clive. I have tried what you suggest but I am having an issue ... basically, if I initialize the LEFT button first then the WAKEUP button (using a function similar to the one available in the STM32F4DISCOVERY utilities) the interrupt is triggered by the WAKEUP button only; if, on the other hand, I initialize the WAKEUP button first then the LEFT button the interrupt is triggered by the LEFT button only. any idea of what the cause of that might be?

thank you

Posted on July 14, 2013 at 17:59

Well I suspect EXTICR via SYSCFG_EXTILineConfig() thwarts your ability to drive EXTI0 from TWO GPIO banks at the same time.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dbilancione
Associate II
Posted on July 14, 2013 at 21:34

that's sensible. all of a sudden, the core is not working properly as it used to. I am trying to generate these interrupts - the idea would be to test them all - but I have started with one and it worked (WAKEUP button). moved on to two but the processor only serves one - the one triggered by the WAKEUP button whereas it never reaches the IRQHandler for the USER button (they are on different EXTI_Lines). any idea what might be causing that?

Thank you!

Posted on July 14, 2013 at 23:00

Likely something with the code which I can't see. Are you sure you have the right IRQHandler name, and that you are clearing the right source?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dbilancione
Associate II
Posted on July 15, 2013 at 04:03

you nailed it! I missed the second underscore for the EXTI15_10_IRQn and the EXTI9_5_IRQn.

thank you ever so much! you've been extremely helpful!!!