DMA Software Request

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

cross mob
lock attach
Attachments are accessible only for community members.
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Hi all, i'm trying to transfer content of an array (SRAM) to a ControlRegister via DMA CPU Request, i'm trying to transfer 1 element of the array per request, but i haven't been able to do it, it seems like it transfer all the array per request.

   

I understand that if i set REQUEST_PER_BURST to 1 it makes the DMA Controller to transfer 1 byte per request, so i ask for a transfer every 500ms, but when i read the content of the ControlRegister on the DMA Transfer Completed interrupt i read the last element of my array and not the element i'm expecting, as i say i'm expecting transfer 1 element per request, not all 10.

   

Does anybody had test this kind of transfer?

   

I haven't found any example or question similar on the forum, find project attached.

   

Thanks in advance

   

Carlos

0 Likes
1 Solution
Anonymous
Not applicable

Hello Carlos

   

DMA Transfer Completed interrupt is triggered after sending the number of bytes given as Transfer Count. In your case TC is 10.

   

So the interrupt will be triggered only after sending all the 10 bytes.

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are trying to use a software approach to control each TD transfer, but there is no API for that. What you are using is an API that accessed the DMA controller to start a channel, I'm not quite sure if that will work.

   

Better solution would be:

   

Enable DMA Hardware Request and connect the timer tc to DMA drq (you may leave the isr, but you have to remove the call to CyDmaChSetRequest(). Now on each timer tc one byte should be transferred from flash to the control register.

   

Remember that the isr_DMA is called when the TD has finished, not after the transfer of a single byte.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hello Carlos

   

DMA Transfer Completed interrupt is triggered after sending the number of bytes given as Transfer Count. In your case TC is 10.

   

So the interrupt will be triggered only after sending all the 10 bytes.

0 Likes
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Hi Bob and SmartPSoC, yes i was able to figure out that DMA interrupt asserts after the whole transfer is done after read Bob reply but i didn't reply back, thanks again for help n00bs liek me and the rest of the forum!!!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Happy new year, Carlos! Good to see you're back again!

   

 

   

Bob

0 Likes