EENG 383

Lab 9 - Signal acquisition

Lab: 9
Status Live

InLab 9

Some self guided activities.

Lab 9 assignment

Create an embedded application that writes audio data to the SD Card that, in the next lab, will be played back through the speaker. The general architecture of the lab is shown below. You will use an ISR to collect microphone samples and store them in one of two buffers, the blue buffer in the figure below. While samples are being stored in the blueBuffer, the redBuffer is being sent out to the SD Card over the SPI but through the SDCARD_WriteBlock interface function supplied in this inLab. Once blueBuffer is full and the redBuffer has been sent, their roles are swapped. The blueBuffer is then sent to the SD Card and, while this is being done, new microphone samples are sent to the redBuffer. This is called double buffering and an important technique in signal processing.


Software

At start-up your program should present a splash screen - this would be a great place for some ASCII art. The splash screen should also contain connection instruction for the development board; for this assignment tell the user there are no jumpers to install! When you press "?" at the terminal you should be greeted with the following menu.
-------------------------------------------------
?: help menu
o: k
Z: Reset processor
z: Clear the terminal
-------------------------------------------------
i: Initialize SD card
-------------------------------------------------
a/A decrease/increase read address
r: read a block of 512 bytes from SD card
1: write perfect 26 value sine wave to 128 blocks
-------------------------------------------------
+/-: Increase/Decrease the sample rate by 10 us
W: Write microphone => SD card at 1600 us
s: spool memory to a csv file
-------------------------------------------------

Excel Instructions

In order to plot the spooled data, follow these instructions. You should have something that looks like the following.

When you plot the first 1024 entries of the sine wave you should get something that looks like the following.

Turn-in

You may work with a single partner (or alone) to complete this lab. Submit your main.c file on Canvas using the instructions posted there. You should take note of the Rubric that will be used to evaluate your assignment. Please form a group before submitting using the instructions posted on Canvas. You will demonstrate your code at the beginning of lab.

Be prepared to show the graders your Excel plot with the sine wave and audio waveform "test one, two, three".