Hi,
I'm trying to use the DMA to fill a Ping-Pong buffer from the McASP.
Currently I access the McASP in 32 bit mode and also have 32bit*N buffers.
When I present a sinewave at the analog input I hardly see a sinewave appearing in the buffers. It mostly looks like it misses large parts of the waveform.
I've checked all examples and other post I could find and it seems everything is setup correctly. I'm also not having overruns or missed DMA events. I've attached a screenshot of what ends up in the buffer.
My buffers are defined like:
static int ping_receive[1024]={0};
static int pong_receive[1024]={0};
I've setup the DMA PaRAM sets as follows:
paramSet.opt=0;
paramSet.srcAddr=SOC_MCASP_0_DATA_REGS;
paramSet.aCnt=4;
paramSet.bCnt=1024;
paramSet.destAddr=(unsigned int)ping_receive;
paramSet.srcBIdx=0;
paramSet.destBIdx=4;
paramSet.linkAddr=43<<5;
paramSet.bCntReload=0;
paramSet.srcCIdx=0;
paramSet.destCIdx=0;
paramSet.cCnt=1;
EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, EDMA3_CHA_MCASP0_RX, ¶mSet);
EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, 42, ¶mSet);
paramSet.destAddr=(unsigned int)pong_receive;
paramSet.linkAddr=42<<5;
EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, 43, ¶mSet);
I would not be totally surprised if the lower half of the sinewave is incorrect, as the I2S setup functions seems to pad the value with zero's and I would expect it to pad with bit 15 to get a correct two's complement integer, but then at least the upper half of the sinewave should be correct.
I've no idea how to debug a issue like this. Can someone give some tips on how to figure out what's happening?
Thanks in advance.
Kind regards,
Remco Poelstra