2008-11-02 01:49 AM
Trouble with timer capture interrupts for STR912 microcontroller...
2011-05-17 12:56 AM
In your code, when you define GPIO6, you specify pins 0 and 2 as being timer capture inputs.
Pin 0 is indeed TIM0_ICAP1, but pin 2 is TIM1_ICAP1 , and not TIM2_ICAP1 you need to change it to pins 0 and 4 to make it work. Daniel2011-05-17 12:56 AM
I use interrupt Capture_1 for timer TIM0, and all interrupts work succesfully; all OK.
But if I try to use interrupts Capture_1 and Capture_2 for timer TIM1 (Tim2), it doesn't work. For example: see attached file! What I do wrong?, who can help me?2011-05-17 12:56 AM
In your code, when you define GPIO6, you specify pins 0 and 2 as being timer capture inputs.
Pin 0 is indeed TIM0_ICAP1, but pin 2 is TIM1_ICAP1 , and not TIM2_ICAP1 you need to change it to pins 0 and 4 to make it work. Daniel2011-05-17 12:56 AM
Thank you!!!
But my trouble doesn't solved... I try to setCode:
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_4; GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; but timers don't work in capture mode properly. What I do wrong? Who can help me, please!2011-05-17 12:56 AM
Hi,
If my memory is good (TBC), i had this trouble this is a BUG in the ST library: The previous interrupt is disabled before you install a second (), look the code in the timer, this bug is in the 91x_tim.c. Add a breakpoint and you should look your register is reseted before add a new interrupt, you will lost possibility to fire the previous. Sorry for the lack of detail, but i repply from my personnel computer, i haven't access to my project Good luck. Damien HOYEN