DMA priority problem Kinetis K2x

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

DMA priority problem Kinetis K2x

1,098 次查看
klemeniskra
Contributor I

Hello,

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

标签 (1)
0 项奖励
回复
1 回复

826 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Klemen,

I checked the DMA priority setting, there without any problem for related register setting (DMA0/DMA4/DMA5).

The DMA priority is one part could affect the LCD display and audio sounds, customer also need to consider the other part, such as LCD related DMA channel and audio DMA channel related interrupt.

For the DMA channels related interrupt priority also could affect the DMA trigger could be response frequently or not.

Wish it helps.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复