Skip to main content
Michal Dudka
Lead
May 4, 2022
Solved

STM32F429 TIM1 trigger flag (TIF) issue

I have TIM1 configured in one pulse mode triggered by rising edge on TIM1_CH1 to generate single pulse. Timer works correctly (generate single pulse for each rising edge on input). Datasheet claims that TIF flag is set on trigger event in all modes but gated mode. In gated mode flag is set when timer starts and also when stops. I am running timer in trigger mode but flag is rised when trigger event and also when timer stops. Like in gated mode. Looks like a bug. Has anyone observed this problem as well?

This topic has been closed for replies.
Michal Dudka
Michal DudkaBest answer
Lead
May 4, 2022

Problem solved (as always my mistake). I've used TI1F_ED instead TI1FP1. TI1F_ED generate impulses on rising and falling edge of input signal. My input pulse has accidentally almost same length like timer ouput pulse and therefore second inpulse from Timer edge detector comes at same time as timer stops. That confused me and i hought that second "trigger" flag comes from timer stop...but in reality it comes from falling edge of input signal.

4 replies

waclawek.jan
Super User
May 4, 2022

Hm interesting.

Are you sure the trigger source does not generate another pulse which you see as the second TIF?

How exactly do you observe this?

JW

Michal Dudka
Lead
May 4, 2022

I am pretty sure. I am monitoring input signal on PCB by scope and it is clean. I am also monitoring timer output pin and see one pulse and also watching UPDATE flag (rised only once when timer stops). Everything works as it should except TIF, which behave like in "GATE" mode...

waclawek.jan
Super User
May 4, 2022

Thanks for coming back with the solution. Sounds confusing indeed.

Please select your post as Best so that thread is marked as solved.

JW