Hi all,
In my applicaton, I sample data via Mcbsp and DMA, 2 channels on Mcbsp RX , 16 word/ channel, data is stored in Uint16 A[2048] as following
A[0] --ch1
A[1] -- ch2
A[2] --ch1
A[3] - ch2
....
A[2046] -- ch1
A[2047 ---ch2
DMA configuration code is
// configure burst
DMACH2BurstConfig(0, 0, 0);
// DmaRegs.CH2.BURST_SIZE.all = 0; // 1 word/burst
// DmaRegs.CH2.SRC_BURST_STEP = 0; // no effect when using 1 word/burst
// DmaRegs.CH2.DST_BURST_STEP = 0; // no effect when using 1 word/burst
// configure transfer
DMACH2TransferConfig((Uint16)2048 -1, 0, 1);
// DmaRegs.CH2.TRANSFER_SIZE = (Uint16)MCBSPA_RDMA_DATASIZE -1; // Interrupt every 127 bursts/transfer
// DmaRegs.CH2.SRC_TRANSFER_STEP = 0; // Don't move source address
// DmaRegs.CH2.DST_TRANSFER_STEP = 1; // Move to next word in buffer after each word in a burst
// configure address
DMACH2AddrConfig((Uint16*)(&A[0]),&McbspaRegs.DRR1.all);
// DmaRegs.CH2.SRC_ADDR_SHADOW = (Uint32) &McbspaRegs.DRR1.all; // Start address = McBSPA DRR
// DmaRegs.CH2.SRC_BEG_ADDR_SHADOW = (Uint32) &McbspaRegs.DRR1.all; // Not needed unless using wrap function
// DmaRegs.CH2.DST_ADDR_SHADOW = (Uint32) &rdata[0]; // Start address = Receive buffer (for McBSP-A)
// DmaRegs.CH2.DST_BEG_ADDR_SHADOW = (Uint32) &rdata[0]; // Not needed unless using wrap function
// configure wrap
DMACH2WrapConfig(0xFFFF, 0, 0xFFFF, 0);
// DmaRegs.CH2.DST_WRAP_SIZE = 0xFFFF; // Put to maximum - don't want destination wrap
// DmaRegs.CH2.SRC_WRAP_SIZE = 0xFFFF; // Put to maximum - don't want source wrap
// configure mode
DMACH2ModeConfig((Uint16)DMA_MREVTA, 1, 0, 0, 0, 0, 0,SIXTEEN_BIT, 1,1);
Now i want data to be stored as
ch1: A[0]~A[1023
ch2: A[1024] ~A[2047]
how to configure DMA? thanks in advance.
↧
Question about McBsp's DMA configuration
↧