![Waveshare Music Shield User Manual Download Page 8](http://html1.mh-extra.com/html/waveshare/music-shield/music-shield_user-manual_3870066008.webp)
Music Shield User Manual
8
Revision 1.1. Date: December 7, 2015. Author: W. L. Yan. Editor: Felix.
share awesome hardware
(The mic on Music Shield is connected to differential mic input while the earphone is connected
to Line input 2.)
Before activating ADPCM recording, user must write the right values to SCI AICTRL0 and SCI
AICTRL3. These values are only read at recording startup. SCI AICTRL1 and SCI AICTRL2 can be altered
anytime, but it is preferable to write good init values before activation. See the section
Activating
PCM / ADPCM Recording Mode
of VS1053b datasheet for more details.
If the registers have been configured correctly, the audio data can be read constantly. If SCI
HDAT1 is greater than 0, you can read as many 16-bit words from SCI HDAT0. (See the section
Reading PCM / IMA ADPCM Data
of VS1053b datasheet)
Note: the recording data do not contain any RIFF header of the audio file. So to make your
recording data a RIFF / WAV file, you have to add a header before the actual data. See the section
Adding a PCM RIFF Header
of VS1053b datasheet.
2.6.
Real-Time MIDI
If GPIO0 is low and GPIO1 is high during boot, real-time MIDI mode is activated. In this mode the
PLL is configured to 4.0×, the UART is configured to the MIDI data rate 31250 bps, and real-time MIDI
data is then read from UART and SDI. Both input methods should not be used simultaneously. If you
use SDI, first send 0xff and then send the MIDI data byte.
(The RX of UART on the Music Shield is connected to MIDI input.)
Note: If GPIO1 is not high, Real-Time MIDI can also be started with a small patch code using SCI.