DMA Problems

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User10696
Level 4
Level 4
First solution authored
I am trying to use the DMA to transfer data from memory to the USIC in I2S mode.
My data is a 200 word 16bit array. The USIC is set to transfer 16 bits.
I have programed the DMA with Block size 200 and source and destination as 16 bit.
When I start the transfer only every second word is output via the I2S bus. A total of 100 values are transferred.

Something must be wrong with my settings, but I do not understand what. Can someone with DMA experience help me?
0 Likes
3 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,

Can I check if the DMA app is working good?

You can reference to this example which is not using any Apps.

https://www.infineonforums.com/threads/2392-XMC_HOT-XMC4500-How-to-do-DMA-of-ADC-result-registers-to...
0 Likes
User10696
Level 4
Level 4
First solution authored
I have solved my first problem by setting the data buffer to 32bits. It seems the DMA always expects 32bits, but only uses the number of bits set. This seems a bit strange and wastes RAM as my buffer is twice the size needed.

I have managed to get my program to work for one transfer, but the second time I try to send data it does not work correctly.
I am using the linked list with the source my data buffer and the destination as the USIC TBUF. At the start of the second transmission all the DMA registers have the same value as at the start of the first transmission. The Link lists are also set the same. But the second transmission does not work correctly, only some of the data is transferred and there are pauses between the blocks.
Does the DMA channel need to be reset in some way after a transmission? I have not been able to find an example using link lists.

Any help is most welcome!
0 Likes
User10696
Level 4
Level 4
First solution authored
I must update my previous posting.

Changing the size to 32 bit seemed to solve the problem, but I later found it causes other problems. Some of the time the wrong 16 bits are used. It seems the initialization of the source register has a problem. Totally randomly either the upper 16 bit or the lower 16 bit are transferred!

Going back to the original problem:
What are the correct DMA settings when I want to has a 16 bit buffer array and transfer the data to the TBUF of a USIC? The obvious answer using 16 source and destination transfers does NOT work. This setting only transfers every second word from the buffer.

What am I doing wrong?
0 Likes