AnsweredAssumed Answered

Stm32F100B

Question asked by Toader.Alexandra on Apr 5, 2017
Latest reply on Apr 6, 2017 by Toader.Alexandra

I want to know how TIM2 of STM32F100 works. Can someone help me?


TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
uint16_t PrescalerValue = 0;
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);

TIM_TimeBaseStructure.TIM_ClockDivision = 0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_Prescaler = (uint16_t) (SystemCoreClock / 1000) - 1;
TIM_TimeBaseStructure.TIM_Period = 999;

I don't understand why TIM_Period is 999.

Outcomes