我用的STM32103系列,外部是25M,定时设置后,出不来0.5us,最快也是2us.请各位DX给看看,代码如下
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
// TIM_OCInitTypeDef TIM_OCInitStructure ;
TIM_DeInit( TIM3);//复位TIM3定时器
/* TIM3 configuration */
TIM_TimeBaseStructure.TIM_Period = 10;
TIM_TimeBaseStructure.TIM_Prescaler = 1;
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;//0x0; // 时钟分割
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //计数方向向上计数
TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure);
/* Clear TIM3 update pending flag[清除TIM3溢出中断标志] */
TIM_ClearFlag(TIM3, TIM_FLAG_Update);
/* Enable TIM3 Update interrupt [TIM3溢出中断允许]*/
TIM_ITConfig(TIM3, TIM_IT_Update, ENABLE);
/* TIM3 enable counter [允许tim3计数]*/
TIM_Cmd(TIM3, ENABLE);
望ST公司的FAE给实际测试并提供解决方式,谢谢. |