有的人项目,电源有时会超出5.5V,系统是用431做基准,当输入电压过高(431做基准较小)时进中断。但速度却慢到了3-5mS才响应。这是什么原因?
初始化ADC如下:
ADC1_Init(ADC1_CONVERSIONMODE_CONTINUOUS, REF_431_ADC,
ADC1_PRESSEL_FCPU_D2, ADC1_EXTTRIG_TIM,
DISABLE, ADC1_ALIGN_RIGHT, ADC1_SCHMITTTRIG_ALL, DISABLE);
ADC1_StartConversion();
ADC1_SetHighThreshold(0xffff);
ADC1_SetLowThreshold(470<<6);
ADC1_ITConfig(ADC1_IT_AWDIE,ENABLE);
中断程序如下:
void ADC1_IRQHandler(void) interrupt 22
#endif /* _COSMIC_ */
{
TIM2->CCER1 = 0;
LED4_ON;
su1a.mode = MIN_POWER;
}
波形如附件:上面的是LED4,下面的是MCU电源电压
|