Question
Setting Timer to 1ms
Posted on June 03, 2014 at 17:04
Hi All,
I am using STM32 F0 Discovery board with Raisonance IDE, I am with LED blink using TIM. I want to blink for every 1s but I dont know how to set the timer, Please tell me how the calculation is done for 1s and 1ms. And what should be the value of Prescalar value,TIM_Period n TIM_Prescaler. Right now I have put random values. Please guide me.PrescalerValue = (uint16_t) (SystemCoreClock /2400000 ); /* Time base configuration */ TIM_TimeBaseStructure.TIM_Period = 1000; TIM_TimeBaseStructure.TIM_Prescaler = 0; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Down;