2013-11-27 12:24 AM
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,Terence2013-11-27 01:35 AM
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¤tviews=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=792013-11-29 07:31 AM
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,TerenceHence,2013-11-29 08:09 AM
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.2013-11-29 09:01 AM
2013-11-30 03:44 PM
Wouldn't a TIM unit in encoder (decoder) mode be more appropriate? You can alter the clocking and filtering with them.
2013-12-02 02:08 AM
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