Home Forums Sparkfun MP3 Shield Library Support Forum Interference with millis() function Reply To: Interference with millis() function


About the your CPU % observation. It is significantly dependent upon the bit rate of the audio file. A 192K will take a lot more than a 44K. Additionally you can significantly increase efficiency by setting:



#define USE_MP3_REFILL_MEANS USE_MP3_SimpleTimer

along with setting MP3_REFILL_PERIOD to an appropriate period to accommodate the bitrate of the audio file.

This will more efficiently bundle the Reads from the SdCard and subsequent writes to the VS1053 into larger chunks. Noting that the SdFat Library pre-reads a cache of 500 bytes and the MP3 library writes little chunks of 32 bytes at a time, until the DREQ is full. Where I have seen a logic analyzer traces of it showing a lot of chunking that is removed when down more as a periodic refill. Better matching the SdFat’s 500 byte read.