AnsweredAssumed Answered

STM32F207G-Nucleo TIM_DMA example sets the repeat count for a timer that doesn't have a repetition counter???

Question asked by Mike Katz on Nov 7, 2017
Latest reply on Nov 10, 2017 by waclawek.jan

The following is a code snippet from the

STMCubeF2\Projects\STM32F207ZG-Nucleo\Examples\TIM\TIM_DMA\Src\main.c file:

  TimHandle.Instance               = TIMx;   TimHandle.Init.Period            = uwTimerPeriod;   TimHandle.Init.RepetitionCounter = 3;   TimHandle.Init.Prescaler         = 0;   TimHandle.Init.ClockDivision     = 0;   TimHandle.Init.CounterMode       = TIM_COUNTERMODE_UP;   TimHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;   if (HAL_TIM_PWM_Init(&TimHandle) != HAL_OK)   {    /* Initialization Error */    Error_Handler();   }
STMCubeF2\Projects\STM32F207ZG-Nucleo\Examples\TIM\TIM_DMA\Inc\main.h file contains:
/* Definition of TIM instance */#define TIMx                             TIM3

This example is using timer 3.  However, according to RM0033 Refernce manual(STM32F205xx, STM32F207xx, STM32F215xx and STM32F217xx
advanced ARM-based 32-bit MCUs) the STM32F207 only has Repetition Counter for the advanced timers 1 and 8.

Am I missing something?

Also, this example does not do any setup of DMA prior to calling HAL_TIM_PWM_Start_DMA(). 

How does this function know which Timer 3 register to write to?

I ported this example to Timer 1 using STM32CubeMx and the duty cycle does not change as in the example.

Outcomes