Data Sheet
PRELIMINARY
VS1063a Datasheet
10 OPERATION
10.7.2 The Encoding Procedure
The encoding procedure from start to finish goes as follows:
1. Pre-initialization; Setup system:
• Load the VS1063a Patches package, available at
http://www.vlsi.fi/en/support/software/vs10xxplugins.html . Note that the package is
required for conforming MP3 bitstreams: without it recording quality will be signifi-
cantly lower and the bitstream may have errors.
2. Initialization; Set samplerate and parameters:
• SCI_AICTRL0 for samplerate (SCI_WRAMADDR for bitrate/quality setting)
• SCI_AICTRL1 for gain/AGC
• SCI_AICTRL2 for AGC max gain
• SCI_AICTRL3 for channel selection, encoding format and options
• If used, fill in UART configuration.
• If used, fill in Ogg Vorbis serial number.
• SCI_WRAMADDR to set bitrate/quality (mp3 and Ogg Vorbis only)
• Activate encoding with one of the two ways:
– Recommended: If you use the VS1063a Patches package, start encoding as
follows: set bit SM_ENCODE in SCI_MODE, then write 0x50 to AIADDR.
– If you do not use the VS1063a Patches package, start encoding mode by setting
SM_ENCODE and SM_SOFTRESET in register SCI_MODE.
3. Recording:
• Depending on whether you selected SCI or UART data transfers with bit 13 of
SCI_AICTRL3, read data through SCI_HDAT0/SCI_HDAT1 as described in Chap-
ter 10.7.3, or through the UART.
4. Finalizing recording:
• When you want to finish encoding a file, set bit SM_CANCEL in SCI_MODE.
• After a while (typically less than 100 ms), SM_CANCEL will clear.
• If using SCI for data transfers, read all remaining words using SCI_HDAT1/SCI_HDAT0.
Then read parametric_x.endFillByte. If the most significant bit (bit 15) is set to 1, then
the file is of an odd length and bits 7:0 contain the last byte that still should be written
to the output file. Now write 0 to endFillByte.
• When all samples have been transmitted, SM_ENCODE bit of SCI_MODE will be
cleared by VS1063a, and SCI_HDAT1 and SCI_HDAT0 are cleared.
5. Now you can give a software reset to enter player mode or start encoding again.
Version: 0.42, 2011-11-24 57