在DAC输出正弦波的时候,配置DMA时,我把配置的顺序改变了,波形也响应的改变了。。。这是什么原因
这是我配置的DMA顺序::
DMA_InitStructure.DMA_BufferSize=32;
DMA_InitStructure.DMA_DIR=DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_M2M=DMA_M2M_Disable;
DMA_InitStructure.DMA_MemoryBaseAddr=(uint32_t)&DualSine12bit;
DMA_InitStructure.DMA_MemoryDataSize=DMA_MemoryDataSize_Word;
DMA_InitStructure.DMA_MemoryInc=DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_Mode=DMA_Mode_Circular;
DMA_InitStructure.DMA_PeripheralBaseAddr= DAC_DHR12RD;
DMA_InitStructure.DMA_PeripheralDataSize=DMA_PeripheralDataSize_Word;
DMA_InitStructure.DMA_PeripheralInc=DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_Priority=DMA_Priority_High;
DMA_Init(DMA2_Channel4, &DMA_InitStructure);
DMA_Cmd( DMA2_Channel4,ENABLE);
这是例程配置DMA的顺序:
DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12RD;
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&DualSine12bit ;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize = 32;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word;
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
DMA_InitStructure.DMA_Priority = DMA_Priority_High; |