AnsweredAssumed Answered

STM32F103R8T6 Timer4 Input Capture problem

Question asked by max.sorokolat on Mar 24, 2014
Latest reply on Mar 26, 2014 by max.sorokolat
Hi!
There is a problem with Timer4 Input Capture use.  Initially everything was developed under the STM32L100R8T6 controler, but so happened that it was necessary to pass to STM32F103R8T6. 
This code perfectly works at STM32L100:

  RCC_APB1PeriphClockCmd (RCC_APB1Periph_TIM4, ENABLE);
  TIM_TimeBaseStructInit (& timer);
  timer.TIM_Prescaler = 72 - 1;
  timer.TIM_Period = 65535;
  TIM_TimeBaseInit (TIM4, & timer);

  TIM_ICInitTypeDef timICStruct;
  timICStruct.TIM_Channel = TIM_Channel_1;
  timICStruct.TIM_ICPolarity = TIM_ICPolarity_BothEdge;
  timICStruct.TIM_ICSelection = TIM_ICSelection_DirectTI;
  timICStruct.TIM_ICPrescaler = TIM_ICPSC_DIV1;
  timICStruct.TIM_ICFilter = 0x08;

  TIM_ICInit (TIM4, & timICStruct);
  TIM_ITConfig (TIM4, TIM_IT_CC1, ENABLE);
  TIM_Cmd(TIM4, ENABLE);
 
On STM32F103 this code doesn't catch both Edges, works similarly with RisingEdge.
Help to solve a problem, or describe how "on the fly" to change Edges.
Thanks in advance.

Outcomes