cancel
Showing results for 
Search instead for 
Did you mean: 

update events from Tim7 using IRQ

developer2
Senior
Posted on August 27, 2014 at 13:50

Hi All, 

i'm having issue on STM32F407 with update events,

sometimes i'm getting IRQ immediatelly after init and sometimes first event is regular update event, 

did i missed some initialization step ? 

please help me ...

here is my code: 

  TIM_TimeBaseStructure.TIM_Period = 2000; // ARR

  TIM_TimeBaseStructure.TIM_Prescaler = 20999; // PSC ... 

  TIM_TimeBaseStructure.TIM_ClockDivision = 0; // CR1:CKD TIM67 doesn't have

  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;

  TIM_TimeBaseInit( TIM7, &TIM_TimeBaseStructure);

  TIM_ClearFlag( TIM7, TIM_FLAG_Update );

  TIM_ITConfig( TIM7, TIM_IT_Update, ENABLE);

  TIM_ClearITPendingBit( TIM7, TIM_IT_Update );

  TIM_ClearFlag( TIM7, TIM_FLAG_Update );

  TIM_SetCounter( TIM7, 0);

  TIM_Cmd( TIM7, ENABLE );

Thanks for all replies, 

Kind regards

0 REPLIES 0