cancel
Showing results for 
Search instead for 
Did you mean: 

Number of external interrupts available

terence-b
Associate II
Posted on November 27, 2013 at 09:24

Hi

I'm currently using EXTI0 to EXTI4 already. When I configure EXTI5 and above, I have an error when setting it in the NVIC, since EXTI5_IRQn and above are not defined in stm32f4xx.h.

From the Reference manual I got the impression that I can use up to EXTI15. Am I missing something?

Thanks in advance,

Terence
6 REPLIES 6
Posted on November 27, 2013 at 10:35

Am I missing something?

Yes, that the interrupts are combined for higher order EXTI#, so EXTI9_5_IRQn would catch EXTI5 thru EXTI9 and you should qualify the source(s) and handle each appropriately.

[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/EXTI%20configuration%20to%20different%20lines&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=79]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FEXTI%20configuration%20to%20different%20lines&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=79

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
terence-b
Associate II
Posted on November 29, 2013 at 16:31

Hi Clive

Sorry I did no reply earlier. Thanks for your help; I configured EXTI7, and I'm using EXTI9_5_IRQHandler as the main routine for handling this interrupt. I also have a sub-routine using the function EXTI_GetITStatus to check for EXTI7, since I will have more interrupts between 5 to 9 in the near future.

Presently I'm having another problem. The interrupt is being triggered even when there is no pulse, but the triggering does not follow the same pattern of the case when there is the pulse. In fact, when the pulse arrives, the interrupt is triggered and executed. When no triggering pulse arrives, the interrupt is still triggered and executed, but this time at a very fast and continuous rate (I set/reset a bit to check this and observe on a scope).

Can you suggest a solution for this? Do you suggest using a software approach, or it is better if I connect a capacitor on the input trigger pin.

Thanks in advance,

Terence

Hence, 

Posted on November 29, 2013 at 17:09

Do you have a scope/analyzer with enough bandwidth to observe glitches?

The inputs should be filtered at the pin, by the synchronizer circuit. Perhaps you can be more specific about the source and nature of the signals you are attaching.

You might want to look at what your IRQHandler is doing.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
terence-b
Associate II
Posted on November 29, 2013 at 18:01

The triggering signal is a 5V pulse, coming from an incremental encoder mounted on a motor. On my scope , apart from the pulse itself which comes once every revolution of the motor (zero pulse), I can see glitches, which although not more than 1.4 V in amplitude, are triggering the interrupt. However, if I'm not mistaken V High min for the STM32F407 is 1.8V, and 1.4V does not exceed this voltage.

I was thinking of lowering the pulse voltage using a voltage divider, because this would also decrease the amplitude of the glitches.

Thanks,

Terence 

Posted on December 01, 2013 at 00:44

Wouldn't a TIM unit in encoder (decoder) mode be more appropriate? You can alter the clocking and filtering with them.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
terence-b
Associate II
Posted on December 02, 2013 at 11:08

Hi Clive1

I already have Timer 8 in encoder mode, and it's working nicely, both for up counting and down counting. However I also need to reset the timer counting every time a third pulse comes (called the zero pulse). This comes on every revolution of the motor. And I'm using an EXTI to pick the z-pulse. With the VD I saw an improvement, but still the EXTI is being triggered more than once for a given pulse i.e there is still wringing, eventhough it decreased considerably.

In page 325 of the reference manual there is written explicitly that the third encoder pulse may be connected to an external interrupt input and trigger a counter reset, but as usual, it's not as straight forward as it seems.

Thanks