11 years ago.

How to use DMA DAC output with KL25Z ?

Hello everybody,

I use KL25Z board to output wave files chosen from an sdcard conencted to SPI, and so far I managed to read clean 32khz 16bits wav using a ticker and a 2048 bytes buffer. I find that it's unusable at 44.1khz where I get stuttering, maybe I think it's because of a low sdcard readspeed, or it gets too much interrupted by the ticker (does it make sense or am I wrong ?).

So I thought of three ways to go to 44.1khz or 48khz (or even mixing two files in realtime if it even is possible), and to be able to compute other things while playing sound : - tightening the C++ code to have less operations (with this I can go to a bit less to 40khz, but then I can't compute anything else), - raising sdcard readspeed, I have tried different sdcards and raised spi frequency but it doesn't change anything (it gets worse if I lower frequency), - using DMA to output to the DAC (and/or reading the sdcard ?), but I don't understand how and the MODDMA library doesn't compile for the KL25Z.

Would somebody know how to help me ?

Thank you.

1 Answer

11 years ago.

MODDMA won't have support for the KL25. To use the DMA you will have to look at the KL25 reference guide: http://cache.freescale.com/files/32bit/doc/ref_manual/KL25P80M48SF0RM.pdf. Although I would first check which operation costs most time, I doubt it is writing to the DAC.