Senior
January 7, 2020
Solved
Timer count of 1 ms
- January 7, 2020
- 6 replies
- 3781 views
Hello
I want to configure timer which increment count by every millisecond
what are value of prescaller or other parameter should configure in it ?
i am attaching you my clock configuration with this
RCC->APB1ENR |= (1<<1); // Enable clock for TIM3
TIM3->PSC = 65535; // Int clk divided by 1000(999+1) // 2160000 // 65535
TIM3->EGR = TIM_EGR_UG; // Forcing to generate a update
TIM3->ARR = 9999; // Counts from 0 to 7999
TIM3->CR1 = TIM_CR1_CEN; // timer start TIM_CR1_OPM
I want that TIM3->CNT should increment by every millisecond
