7 Replies Latest reply on Nov 24, 2015 12:24 PM by userc_40572

    Problem with writing data from memory to DAC using DMA

      In my project I need to produce different sequences of voltages using a VDAC. After each sequence is finished a new sequence is chosen and produced with the VDAC.


      In order to do this I use a vector in the memory to which each voltage sequence is written, then the voltage sequence is transferred to the VDAC data register using a DMA. To test this technique I built a simple project that do the steps mentioned above, then measure the VDAC output voltages with a SAR ADC and write them into another vector using yet another DMA. You can see a snippet of the project attached.


      Doing this I encountered a problem. In first value of each voltage sequence instead of producing the chosen voltage the last voltage from the previous voltage sequence is produced (I can see this using the vector sampled from the ADC). For example, I write 4 voltage sequences each of length 8. The voltage is monotonous inside each sequence and between sequences. The voltage produced in the 8th and 9th place is the same, also in the 16th and 17th place and so on (this shouldn't happen because of the voltage always rises). I am attaching two snippets of this problem that I took during debug.


      I suspect that somehow I am defining the DMA TD (Transaction Description) the wrong way but I have no idea why. 


      See attached the test project.


      Will appriciate any help.