Hi to all.
I have teensy 3.6 with on board sd card module and would like to use the sdfat library with available sram for buffers 204800 bytes that means that i can use 400 buffers of 512 bytes for each block read from sd.Microcontroller audio players have two buffers,one is pushed out(DAC values) while the other one is filled again before the first one comes to the end.Thats why 44.4Khz is the maximum 8bit wav playing so none of the buffer underflows with the result of disturbing output frequency.Well in my case istead of pushing DAC values i want to push bytes with port manipulation.Could someone share a code similar to audio player and explain me where the reads take place,also how and where the buffer exchange (ping-pong) is done and replace the DAC output with port manipultion??The main problem i face is that the output frequency is not stable because of the sd card latency for that reason the reads have to be done in "parallel" so that always have available bytes to push out in a stable rate (maybe with a timer interrupt at 40Khz).I really need help to complete my thesis,thanks a lot!!!
I have teensy 3.6 with on board sd card module and would like to use the sdfat library with available sram for buffers 204800 bytes that means that i can use 400 buffers of 512 bytes for each block read from sd.Microcontroller audio players have two buffers,one is pushed out(DAC values) while the other one is filled again before the first one comes to the end.Thats why 44.4Khz is the maximum 8bit wav playing so none of the buffer underflows with the result of disturbing output frequency.Well in my case istead of pushing DAC values i want to push bytes with port manipulation.Could someone share a code similar to audio player and explain me where the reads take place,also how and where the buffer exchange (ping-pong) is done and replace the DAC output with port manipultion??The main problem i face is that the output frequency is not stable because of the sd card latency for that reason the reads have to be done in "parallel" so that always have available bytes to push out in a stable rate (maybe with a timer interrupt at 40Khz).I really need help to complete my thesis,thanks a lot!!!