I try to use timer1 on STM32f103c8t6 (bluepill). I was read the datasheet and internet response/questions. However I can't understand "how can I adjust period value with registers". I was using timers with HAL library and calculate timing calculations, period and prescaler values etc.
(period)*(prescaler) / (clock Speed) = second
This is my already know formula.
My Clock Speed is 72Mhz and I was adjust Prescaler to 1000. I want to Period value to 72000 and I will have 1 second timer. But I don't know how can ı adjust period value, where is it.
void TIM1_Config(){
RCC-> APB2ENR |= 0x00000400; //TIM1 CLK Enable
TIM1-> CR1 |= 0x0083; //Auto Reload,Update Request Source, Counter Enable
TIM1-> DIER |= 0x0003; //CC1 Interrupt Enable, Update Interrupt Enable
TIM1-> ARR = 0x0064; //100 is set as Auto Reload Value
TIM1-> PSC |= 0x03E8; //1000 is set as Prescaler Value
TIM1-> (period value I need it)???? // it will set 72000
}