帮忙看看下面初始化错在那里
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_DeInit(TIM1);//复位定时器1
TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
TIM_TimeBaseStructure.TIM_Period = 16000;//自动重装值 [email=2ms@32000000]2ms@32000000[/email]
TIM_TimeBaseStructure.TIM_Prescaler = 3;//予分频 时钟预分频+1
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;//倍频系数
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Down;//计数方向
TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure);
TIM_ARRPreloadConfig(TIM1,ENABLE); //允许重装 TIM_Period
TIM_ITConfig(TIM1,TIM_IT_Update,ENABLE);//允许更新中断
TIM_Cmd(TIM1, ENABLE); //TIM1 运行 |