cancel
Showing results for 
Search instead for 
Did you mean: 

timer code

David.Cheng
Associate II
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

0 REPLIES 0