2017-04-05 07:19 AM
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.
2017-04-06 04:42 AM
I'm sorry to disturbed you but i don't get it. So i have this library 'STM32F10x_StdPeriph_Lib_V3.5.0' where is this folder Project -> STM32F10x_StdPeriph_Examples -> TIM -> TimeBase ->main. In this main i have done the modification on TIM2 how you said it. But dosen't work. TIMCLK=24MHz and P=500ms. The led is off always one second. How can i make it to stay for 0.5 second?