DCMI DMA方式下,即作为DMA源的数据宽度只能为DMA_PeripheralDataSize_Word。
DMA目标为TFT或者外部SRAM(16bit)时候 设定为halfword传输
现在的问题是这样:
1.如果是TFT,请求一次DMA(32bit-16bit),fsmc两次传输,DMA目标地址不变,TFT内部地址在有个写入数据后地址指针自动增加 DCMI数据显
示到TFT没有啥问题,一切正常。
2.如果是外部SRAM(16bit)的时候,请求一次DMA(32bit-16bit),fsmc两次传输,我想这个应该没有啥问题吧,DMA一次,DMA目标地址
SRAM(16bit)自动加。将DMA到SRAM的数据按地址对应写道TFT的现象是:TFT第一个1/4区域和横着的第二个1/4区域显示一个完整的图,后边的
1/2没有数据。反过来说:
SRAM的数据就是只有一半,将奇数地址和偶数地址,只有其中一个地址的16bit数据DMA到了sram。请教各位这个还是说哪儿设置得不对吗?
//TFT
DMA_DeInit(DMA2_Stream1);
DMA_InitStructure.DMA_Channel = DMA_Channel_1;
DMA_InitStructure.DMA_PeripheralBaseAddr = DCMI_DR_ADDRESS;
DMA_InitStructure.DMA_Memory0BaseAddr = FSMC_LCD_ADDRESS; //FSMC_SARM_ADDRESS;//;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
DMA_InitStructure.DMA_BufferSize = 38400;//153600 76800 38400
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;// DMA_PeripheralDataSize_Word DMA_PeripheralDataSize_HalfWord
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;// DMA_MemoryDataSize_HalfWord DMA_MemoryDataSize_Word
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; //DMA_Mode_Normal DMA_Mode_Circular
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable; //DMA_FIFOMode_Disable DMA_FIFOMode_Enable
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull; // DMA_FIFOThreshold_HalfFull
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; //DMA_MemoryBurst_INC4 DMA_MemoryBurst_Single
DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; //DMA_PeripheralBurst_INC4 DMA_PeripheralBurst_Single
DMA_Init(DMA2_Stream1, &DMA_InitStructure);
//SRAM
DMA_DeInit(DMA2_Stream1);
DMA_InitStructure.DMA_Channel = DMA_Channel_1;
DMA_InitStructure.DMA_PeripheralBaseAddr = DCMI_DR_ADDRESS;
DMA_InitStructure.DMA_Memory0BaseAddr = FSMC_SARM_ADDRESS;//FSMC_SARM_ADDRESS;//;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
DMA_InitStructure.DMA_BufferSize = 38400;//153600 76800 38400
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;//DMA_PeripheralDataSize_Word DMA_PeripheralDataSize_HalfWord
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;//DMA_MemoryDataSize_HalfWord DMA_MemoryDataSize_Word
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; //DMA_Mode_Normal DMA_Mode_Circular
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable; //DMA_FIFOMode_Disable DMA_FIFOMode_Enable
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull; // DMA_FIFOThreshold_HalfFull
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; //DMA_MemoryBurst_INC4 DMA_MemoryBurst_Single
DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; //DMA_PeripheralBurst_INC4 DMA_PeripheralBurst_Single
DMA_Init(DMA2_Stream1, &DMA_InitStructure);
|