2012-12-16 05:20 AM
During programming trials on a STM32F051 discovery cardlet I found out that the TIM1 update interrupt does not work while using TIM1 channel 4 for PWM input signal evaluation. The update flag UIF is set, but no interrupt happens. Other interrupt events of TIM1 function correcly. I circumvented that problem by using the compare feature of a free channel of TIM1. Is this missing interrupt a design problem or a single failure on my specific chip?
Any help is appreciated. Here are the specific F051 chip data: STM32F051 R8T6 GH221 W6 CHN GH 207 #stm32f051 #tim1 #uif2012-12-17 07:56 AM
Hey,
I havent tried the described situation but you might want to check out the interrupt priority/subpriority levels. If PWM interrupt has higher priority then it cannot be triggered/interrupted over the timer interrupt.2012-12-21 01:01 AM
Hi Crt,
thank you for your comment. I think there is no conflict with priorities because the UI is the only pending event. I have also tried to trigger the UI by setting the UG bit in the TIM1_EGR register. The UIF switches on correctly, but software does not branch to the interrupt routine. I think interrupt setup is correct because other interrupt responses of TIM1 (e.g. CC4IF) function correctly. I have now a new cardlet with ST32F050C6 up and running, but this chip version shows the same problem: UIF of TIM1 does not generate interrupt. The UIF can be set by a counter update or by EG.2012-12-21 07:08 AM
Problem solved :-))
TIM1 uses 2 interrupt vectors instead just 1 as all the other timers do. I assumed UI to be supported by the same interrupt as CC1/2/3/4. That's not the case. I have fixed the error and TIM1 UIF function is as expected now. Roland