20BIT ADC > MEM via DMA. Maximum Transfer Count?

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

cross mob
Anonymous
Not applicable

Dear all,

   

I am using the DMA to read out the data of the delta sigma ADC and store these values into RAM.

   

Afterwards I use them to calculate several things. My Code for this task is the same as in the example, the only difference is, that the ADC is running in 17Bit mode (but also has uint32 as a result). I was trying to store more samples into the RAM, so I changed the BUFFER_SIZE to highe values.

   

Until a buffer size of 512 everything is ok. but when I increase the buffer to 1024 it doesn't work the way I expected. After 544 correct sampled and stored values every value is 0.

   

Has anyone a solution for this?

   

Thanks in advance,
Thomas

0 Likes
1 Reply
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think you hit a limitation of the CyDmaTdSetConfiguration() call: the transferCount cannot exceed 4095 bytes. And when I calculate correctly, you have 4096 there (4 bytes per burst for the uint32, and 1024 values).

   

OTOH, the documentation says that the DMA won't be configured in such cases, so you shouldn't see any values.

   

If you hit this limit, you just need to create multiple TDs and chain them together, each for 512 values. (I did this before and could provide sample code).

0 Likes