AnsweredAssumed Answered

DMA priority problem Kinetis K2x

Question asked by Klemen Iskra on Apr 23, 2015
Latest reply on Apr 26, 2015 by Hui_Ma



I'm having problems with setting up priorities for various DMA channels, using DMA0 for display via flexbus, and DMA4 and DMA5 for speaker output via FTM2. I have custom board with Kinetis K20.

DMA0 is configured to transmit data from external RAM to display controller, DMA4 is for positive and DMA5 is for negative output of speaker. All is working well, but there is a problem, when data transfer for all DMA channels is triggered simultaneously. In our case is when new screen is loaded and playing sound. When this happens, new screen data loading on LCD display is visually OK, but sound is distorted, you can hear little pauses in between when sound is playing. When only speaker-dedicated DMA channels (DMA4 and DMA4) are running, sound is clear.


Sound bitrate is 22050 byte/s.  One screen transition takes about 20 ms.


I set DMA priorities, but there is no difference:


     1.       DMA0 priority is set  so can be temporarily suspended by higher priority channel      DMA_DCHPRI0 =  DMA_DCHPRI0_ECP_MASK;


     2.       DMA4 and DMA5 are set so can temporarily suspend any lower priority channel (no need to add flags to their registers)


Like I said before, there is no difference when I set DMA0 suspension ability, sound is still distorted. What am I doing wrong?


Regards, Klemen