VS1053b Datasheet 10 OPERATION
WriteVS10xxRegister(SCI_AICTRL0, 16000U);
WriteVS10xxRegister(SCI_AICTRL1, 0);
WriteVS10xxRegister(SCI_AICTRL2, 4096U);
WriteVS10xxRegister(SCI_AICTRL3, 0);
WriteVS10xxRegister(SCI_MODE, ReadVS10xxRegister(SCI_MODE) |
SM_ADPCM | SM_LINE1);
#ifdef I_HAVE_THE_VS1053B_PATCHES_PACKAGE
/* Strongly recommended to use the VS1053b Patches package. Get it at
http://www.vlsi.fi/en/support/software/vs10xxpatches.html */
LoadVS1053PatchesPackage(); /* Loads patches and starts recording */
#else
/* If not using the VS1053b Patches package, you need to do these steps */
WriteVS10xxPatch();
#endif
selects 16 kHz, stereo mode with automatic gain control and maximum amplification of 4×.
It is strongly recommended to always run the VS1053b Patches package, available at
http://www.vlsi.fi/en/support/software/vs10xxpatches.html , when encoding. If you are not run-
ning the VS1053b Patches package, you need to implement WriteVS10xxPatch() for the exam-
ple above. The function must perform the following SCI writes:
Register Reg. No Values
SCI_WRAMADDR 0x7 0x8050
SCI_WRAM 0x6
0x0000,0x1790,0xf400,0x5400,0x0000,0x0a10,0xf400,0x5600,
0xb080,0x0024,0x0007,0x9257,0x3f00,0x0024,0x0030,0x0297,
0x3f00,0x0024,0x0000,0x004d,0x0014,0x958f,0x0000,0x1b4e,
0x280f,0xe100,0x0006,0x2016,0x2a00,0x17ce,0x3e12,0xb817,
0x3e14,0xf812,0x3e01,0xb811,0x0007,0x9717,0x0020,0xffd2,
0x0030,0x11d1,0x3111,0x8024,0x3704,0xc024,0x3b81,0x8024,
0x3101,0x8024,0x3b81,0x8024,0x3f04,0xc024,0x2808,0x4800,
0x36f1,0x9811,0x2814,0x9c91,0x0000,0x004d,0x2814,0x9940,
0x003f,0x0013,
SCI_AIADDR 0xa 0x0050
This small and incomplete patch is also available from VLSI Solution’s web page
http://www.vlsi.fi/en/support/software/vs10xxpatches.html by the name of VS1053b IMA AD-
PCM Encoder Fix.
10.8.2 Reading PCM / IMA ADPCM Data
After PCM / IMA ADPCM recording has been activated, registers SCI_HDAT0 and SCI_HDAT1
have new functions.
The PCM / 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.
Note: if SCI_HDAT1 ≥768, it may be better to wait for the buffer to overflow and clear before
reading samples. That way you may avoid buffer aliasing.
Version: 1.31, 2017-11-17 55