I can't seem to get DMA to advance on DAC trigger

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.
ChPi_4437311
Level 1
Level 1

I am trying to use the code form Psoc 6 example "CE220924_VDAC_Sine_DMA01" to make an DAC produce a sin wave with 100 points in a DMA advencing into the DAC write buffer on the DAC trigger cycle. However I can't get the DMA to write the next value to the DAC. The DAC just outputs the first value over all clock cycles.

My code is in a zip folder attached. Let me know if there are any problems with it.

0 Likes
1 Solution
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi ChPi_4437311

DMA is not advancing due to incorrect configuration. Please change the DMA configuration to the following:

pastedImage_0.png

Fields changed:

1. Chain to descriptor - Changed from Nothing to Descriptor_1. This will make sure that the DMA is running continuously even without CPU intervention.

2. X loop transfer:

     a. Number of data elements to transfer changed form 1 to 100. This will enable the entire array to be transferred. If this is set to 1, only the first element will keep getting transferred and will result in constant DC voltage.

     b. Destination increment every cycle by - changed from 1 to 0. This will make sure that the data is being sent to the correct destination (ADC register). If this is set to 1, the destination address will keep incrementing and will result in error.

Do try this out.

Best regards

Hari

View solution in original post

0 Likes
1 Reply
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi ChPi_4437311

DMA is not advancing due to incorrect configuration. Please change the DMA configuration to the following:

pastedImage_0.png

Fields changed:

1. Chain to descriptor - Changed from Nothing to Descriptor_1. This will make sure that the DMA is running continuously even without CPU intervention.

2. X loop transfer:

     a. Number of data elements to transfer changed form 1 to 100. This will enable the entire array to be transferred. If this is set to 1, only the first element will keep getting transferred and will result in constant DC voltage.

     b. Destination increment every cycle by - changed from 1 to 0. This will make sure that the data is being sent to the correct destination (ADC register). If this is set to 1, the destination address will keep incrementing and will result in error.

Do try this out.

Best regards

Hari

0 Likes