ADC_DR中已经有转换结果,但是EOC这个标志位始终没有被硬件置一是为什么?
下面是ADC初始化的代码:
void ADC_init(){
ADC_InitTypeDef ADC_InitStructure;
ADC_calibaration(ADC1);
ADC_InitStructure.ADC_Mode=ADC_Mode_Independent;
ADC_InitStructure.ADC_ScanConvMode=DISABLE;
ADC_InitStructure.ADC_ContinuousConvMode=DISABLE;
ADC_InitStructure.ADC_ExternalTrigConv=ADC_ExternalTrigConv_None;
ADC_InitStructure.ADC_DataAlign=ADC_DataAlign_Right;
ADC_InitStructure.ADC_NbrOfChannel=1;//1通道
ADC_Init(ADC1,&ADC_InitStructure);
adc_ch = 0;
adc_4051_ch = 0;
adc_states = ADC_INIT;
ADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_71Cycles5);
ADC_Cmd(ADC1, ENABLE);
}
|