Lessons Learned

A project log for WAV-1K

An SD card reader and WAV file player in 1KB of code.

luciolucio 01/05/2017 at 09:420 Comments

Lessons learned:

1- The (FAT16) file system has been here further optimised to reflect the lesser degree of scalability expected from an ASM project (required to fit in 1Kbyte of code). Funny how when I wrote this code first (Early 2003) it was for a PIC18. I then ported it to PIC24 (featured in the Flying PIC24 book) and then to the PIC32 (featured in the Exploring the PIC32 book). It even served as an inspiration for the earliest MLA libs. Now it has gone full circle and returned to an 8-bit PIC16.

2- The audio play samples read back from the SD card is actually quite fast, so much in fact that I can afford to perform the playback of 44kHz sampled PCM WAV files with ease, giving good sound quality (20kHz bandwidth).

3- MPLAB Code Configurator (despite producing C code) was very useful to produce the required peripherals configuration templates that I then translated into ASM, saving a ton of time and guess work. Who wants to read data sheets anymore?