Week 3 Status -phil

As scheduled, work was done on sound production this week. The objective was to read data from the SD to get buffered data and write to the DAC simultaneously using DMA with previously buffered data. A basic implementation was achieved this week, but we have been plagued by bugs. Notably the DMA transfer occurs twice for some unknown reason.

I am definitely behind schedule as sound production was supposed to be done this week. Hopefully a breakthrough can be made within the next couple of days.

test_rep

DAC output on top and SD card output on bottom. After the first cycle data repeats twice.

Week 2 Status -phil

A lot of time was spent working on the SD card and FAT32 interface. Both are now complete. A few weird bugs were discovered while working on reading the SD card, one of which took hours to resolve and still does not have a solution, but has been worked around. Once the SD card interface was deemed satisfactory, work was started on accessing the FAT file system of the SD card. Most of the libraries for FAT were very lengthy (at least 1000 lines) and were difficult to understand for someone who is fairly new to C. A fairly simple FAT16 library was used as a guideline for creating our own FAT32 accessing code. The code can interpret the boot sector, go to the root directory, then read data one sector at a time and follow cluster chains. WinHex, a memory viewing software, was very useful for verifying what data should be read at certain data locations.

The next step is to work on using DMA to output buffered data to the DAC in parallel to reading new data. Timing may be an issue because the data has to be read and formatted for the DAC before a DMA transfer finishes. Also a 12 bit DAC is being used for 16 bit data samples, so the sound quality will be decreased in downsizing. If the quality sounds poor, we may need to upgrade to a 16 bit DAC.

Week 1 Status -phil

Week 1 mostly consisted of figuring out the steps needed to interface with an SD card from the PIC. Multiple sources were found that discussed and gave example code about SPI transfer and the inner workings of the file system on the card (FAT32). Initially a C++ library was going to be used for interfacing with the SD card peripheral, but this was dropped in favor of a simpler C library. The C library is currently being adapted to work with the PIC32 and the SDHC card being used. The SPI module was the first area looked at and was successfully modified to work with our devices. There was a troublesome reading issue with the PIC where the SD card would send a signal and the PIC would not accept it into the SPI receiver buffer. This was due to an overflow flag, which prevented new information from entering the buffer. The overflow register was reset before every read event in order to fix the error.