93
Figure 6-21 Software Stack of the Micro SD music player
The audio chip should be configured before sending audio signal to the audio chip. The main
program uses I2C protocol to configure the audio chip working in master mode; the audio output
interface working in I2S 16-bits per channel and with sampling rate according to the wave file
contents. In audio playing loop, the main program reads 512-byte audio data from the SD Card, and
then writes the data to DAC FIFO in the Audio Controller. Before writing the data to the FIFO, the
program will verify if the FIFO is full. The design also mixes the audio signal from the
microphone-in and line-in for the Karaoke-style effects by enabling the BYPASS and SITETONE
functions in the audio chip.
AS the demonstration running, users can get the status information through nios2-terminal. You can
enable repeat mode by turning on the switch0, you can adjust the volume by pressing key1 or key2.
And also you can choice the song by pressing key0 or key3.
Design Tools
•
Quartus II 13.0
•
Nios II Eclipse 13.0