Skip to main content
Visitor II
August 23, 2019
Question

timer code

  • August 23, 2019
  • 0 replies
  • 558 views
static void TIM1_Config(void)
{
 
 CLK_PeripheralClockConfig(CLK_Peripheral_TIM1, ENABLE);
 TIM1_DeInit();
 
 
 // 2m/ 40
 TIM1_TimeBaseInit(39, TIM1_CounterMode_Down, 0xffff, 0); //timer freq = (clock CPU/16) -> 1bit = 1uS -> 92*1uS=92uS
 
 TIM1->EGR |= (1 << TIM1_EGR_UG);
 //TIM1_CCPreloadControl(ENABLE);
 //TIM1_ITConfig(TIM1_IT_Update, ENABLE);
 //TIM1_Cmd(ENABLE);
 
}

does the code generate some speed interrupts ? it makes code run error

    This topic has been closed for replies.