2013-07-14 06:10 AM
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 #gpio2013-07-14 06:29 AM
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.2013-07-14 06:41 AM
thank you for the swift reply clive! that is what I thought but I was hoping for a better option.
regards2013-07-14 07:30 AM
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 you2013-07-14 08:59 AM
Well I suspect EXTICR via SYSCFG_EXTILineConfig() thwarts your ability to drive EXTI0 from TWO GPIO banks at the same time.
2013-07-14 12:34 PM
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!2013-07-14 02:00 PM
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?
2013-07-14 07:03 PM
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!!!