ADC的EOC1位由1变为0说明DMA已经拿了ADC的数据了,但是EOC2没有置0
原因:这里我用的是双重模式,ADC每次采集完数据OVR位都会置一,从而导致后续的DMA请求失能
但是DMA拿了数据之后不会给到我定义的内存中去(DMA代码如下)
想问一下ADC一采集OVR位置一这个问题怎么解决
void DMA_Init_Config()
{
DMA_InitTypeDef DMA_InitStruct;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2,ENABLE);
DMA_DeInit(ADC_DMA_STREAM);
//外设基地址,即ADC->CDR的地址
DMA_InitStruct.DMA_PeripheralBaseAddr = ADC_CDR_ADDR;
DMA_InitStruct.DMA_Memory0BaseAddr = (u32)ADC_ConvertedValue;
DMA_InitStruct.DMA_DIR = DMA_DIR_PeripheralToMemory;
DMA_InitStruct.DMA_BufferSize = 2;
DMA_InitStruct.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStruct.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStruct.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
DMA_InitStruct.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
DMA_InitStruct.DMA_Mode = DMA_Mode_Circular;
DMA_InitStruct.DMA_Priority = DMA_Priority_Medium;
DMA_InitStruct.DMA_FIFOMode = DMA_FIFOMode_Disable;
DMA_InitStruct.DMA_Channel = ADC_DMA_CHANNEL;
DMA_Init(ADC_DMA_STREAM,&DMA_InitStruct);
DMA_Cmd(ADC_DMA_STREAM,ENABLE);
}