Need help using FATFS on SDHC w/ PIC32MZ to write Wav file
I've read through so many of the FATFS/SD threads but cannot seem to find what I need.
I have developed a SPI driver and I successfully initialie my card and read back the CSD register/etc.
My SPI/SD access is good.
The application is a data recorder. Have a 192kHz 24 bit ADC and want to write directly to SD. Never read, write only. FAT file format, Wav file.
In interfacing with elm-chans FATFs
, I found that the PIC24 examples were blocking. That is, a Do() and/or While() at low level functions. For instance, wherever the disk_write() function of diskio.c is called, it is expected to return a successful status, as opposed to a "not ready," or something so it can be polled. Reading through the PIC24 examples (and other implementations on this forum) also seem to use blocking during SD access.
How am I supposed to do anything if I have to wait during a write?
I think I am missing some understanding about integrating FATFS on a PIC, can anybody help me?
Simply put: How can I write .wav file data as ADC data rolls in?
I have SPI writes working well, need to integrate a FAT FS that won't block my code. I can't see how to write the function disk_write() without blocking or re-writing higher level functions as well.
Thanks in advance for your help