Hello I’ve gotten a MicroSD card to work for recording audio to the card as WAV and for reading the WAV off of the card and into memory. However, I’ve run up against a catch-22 when trying to do both (not simultaneously, but one after another in the same program) that I’ve read on the forum is probably because I’m using breadboard wires to connect the data pins from the SD card reader to the Daisy:
I’ve gathered that if using breadboard wires then use this line: sd_cfg.speed = daisy::SdmmcHandler::Speed::SLOW;
When this line is not used (ideal), writing to SD card works great but reading fails in that doesn’t happen at all and I get an error from the SD card function library.
When this line is used (to compensate for wire resistance I believe?), reading works great but the process of writing fails in that the SD card creates a WAV file that has artifacts.
I’ve tried my shortest breadboard cables, but this scenario persists. I can only assume that to have my cake and eat it too, I will need to commit my circuit to a PCB or protoboard for better connection integrity.
So, in designing a pcb, I want to know other’s experience/answers about what length and width trace worked for connecting the data lines for both reading a WAV and writing a WAV file.
Thanks and if anybody has got both reading and writing working on a breadboard, that would be magical too.
@Takumi_Ogata I also had some feedback about filter capacitors and TVS diodes. My sd card breakout for breadboard appears to have them so that probably doesn’t fix this issue but why weren’t these included in the Daisy Field? As that is my reference for doing my pcb.
From my understanding, the length of wire is important and it’s challenging to put it together on a breadboard. But it seems like you are able to read and write (just not back to back) so there could be something with the code? The usual case that I see is not being able to even read.
I asked the engineer who designed the Field, and it sounded like it could have went either way and decided with not having it.
@Takumi_Ogata Thanks for asking the engineer. Do you also know if Daisy Field has been successful for writing to SD card without artifacts? My artifacts were pops and crackles.
For actually testing reading and writing, I did so for each separately and not back to back:
To test writing to SD card I would verify by taking the SD card out and playing the file on my computer to see if it had audible artifacts.
To test reading I would load a perfectly good wav file onto the SD card from my computer and then try to to play it on the seed.
So ideally I would be writing and reading back to back but in my testing I would only do one of these things each time I tested (I have one button for record and one for read and I made separate test projects just with writing or reading). And the deciding variable for their success or failure was using the the SLOW line. But what was really confusing was that this deciding variable had an inverse relationship on the test’s results (as described in my post).
If I were to interpret the results it seems that reading data needs a short wire or to SLOW the data. While the writing data needs to go fast and SLOWing the data causes failure. Wire length may not be important.
But it’s all conjecture. I’d like to hear if this is a plausible theory from people more knowledgable about hardware (and also some news about successes so maybe I can see if I have indeed made errors in software). In the meantime I guess I’ll try to keep my traces the same length as the daisy field pcb and hope for the best.
Qu-Bit’s Stardust is an example of Daisy powered device that does both read and write.
And I just confirmed with the team that Field’s SD card circuit is intended for both reading and writing so referencing that for your PCB should be ok!
There could be something happening software-wise when you’re writing.
Thank you for confirming this. It is comforting to know others have succeeded and that I can set myself up in hardware for success with the field example. After I get the pcb made then I should know for sure if the issue is in my software. Much appreciated.