|
麻烦了
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);
TIM_DeInit(TIM3);
TIM_TimeBaseStructure.TIM_Prescaler = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseStructure.TIM_Period = 0xAFC8;//50Hz 32点采样 TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseInit(TIM3,&TIM_TimeBaseStructure);
TIM_UpdateDisableConfig(TIM3,DISABLE); TIM_ARRPreloadConfig(TIM3,ENABLE); TIM_SelectOutputTrigger(TIM3,TIM_TRGOSource_Update);//选择TIM3的更新事件作为TRGO,触发ADC自动转换 TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE); //允许TIM3更新事件中断 TIM_Cmd(TIM3, ENABLE);//开启TIM3
NVIC我也开了,但是现在这个情况太奇怪了 |
|