|
不用DMA,对AD的值直接进行读取,在例程的基础上取消了关于DMA的设定,然后直接设定ADC,但是为什么读取的值总是61(0x3d). ADC_InitStructure.ADC_Mode = ADC_Mode_Independent
ADC_InitStructure.ADC_ScanConvMode = DISABLE ADC_InitStructure.ADC_ContinuousConvMode = ENABLE ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right ADC_InitStructure.ADC_NbrOfChannel = 1
ADC_Init(ADC1, &ADC_InitStructure); /* ADC1 regular channel10 configuration */ ADC_RegularChannelConfig(ADC1, ADC_Channel_10, 1, ADC_SampleTime_55Cycles5);
/* Enable ADC1 DMA */ // ADC_DMACmd(ADC1, ENABLE);
/* Enable ADC1 */ ADC_Cmd(ADC1, ENABLE);・
/* Enable ADC1 reset calibaration register */ ADC_ResetCalibration(ADC1); /* Check the end of ADC1 reset calibration register */ while(ADC_GetResetCalibrationStatus(ADC1 /* Start ADC1 calibaration */ ADC_StartCalibration(ADC1); /* Check the end of ADC1 calibration */ while(ADC_GetCalibrationStatus(ADC1)); /* Start ADC1 Software Conversion */ ADC_SoftwareStartConvCmd(ADC1, ENABLE); ADC_ConvertedValue = (ADC1->DR); 是不是我最后的读取AD的语句有问题啊?
|
|