Playing Audio Files - Waveshare Music Shield User Manual

Table of Contents

Advertisement

Music Shield User Manual
SCI_HDAT1/SCI_HDAT0 Register: After IMA ADPCM recording has been activated, registers SCI
HDAT0 and SCI HDAT1 have new functions. The IMA ADPCM sample buffer is 1024 16-bit words. The
fill status of the buffer can be read from SCI HDAT1. If SCI HDAT1 is greater than 0, you can read as
many 16-bit words from SCI HDAT0. If the data is not read fast enough, the buffer overflows and
returns to empty state.

2.4. Playing Audio Files

It is easy to use VS1053 as a hardware audio decoder to play audio files, only requires 3 steps to
implement.
1)
Reset VS1053
The hardware and software reset at the boot up time and initialize the VS1053, preparing
to decode the next music file.
2)
Configure VS1053 registers
The registers to be configured are Mode Register (SCI_MODE), Clock Register (SCI_CLOCKF)
Bass Register (SCI_BASS), Vol Register (SCI_VOL Register), etc.
3)
Transmit audio data
If configuration complete, audio data can be transmitted to VS1053 constantly. VS1053 will
decode the audio data, if decodable, until the audio data transmitting is finished. (Note:
only if the DREQ is high can VS1053 receive data.)
2.5. Recording
The steps of Recording and playing are similar, first reset and then configure the related registers.
The registers to be set mainly are:
Register
Bits
SCI_MODE
2, 12, 14
SCI_AICTRL0
15..0
SCI_AICTRL1
15..0
SCI_AICTRL2
15..0
SCI_AICTRL3
1..0
2
15..3
IMA ADPCM recording mode is activated by setting bits SM RESET and SM ADPCM in SCI MODE.
Line input 1 is used instead of differential mic input if SM LINE1 is set.
Revision 1.1. Date: December 7, 2015. Author: W. L. Yan. Editor: Felix.
Description
Start ADPCM mode, select MIC/LINE1
Sample rate 8000..48000 Hz (read at recording startup)
Recording gain (1024 = 1×) or 0 for automatic gain control
Maximum autogain amplification (1024 = 1×, 65535 = 64×)
0 = joint stereo (common AGC), 1 = dual channel (separate AGC),
2 = left channel, 3 = right channel
0 = IMA ADPCM mode, 1 = LINEAR PCM mode
reserved, set to 0
share awesome hardware
7

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vs1053b

Table of Contents