AnsweredAssumed Answered

update events from Tim7 using IRQ

Question asked by ml.michal on Aug 27, 2014
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