Data Sheet

PRELIMINARY
VS1063a Datasheet
10 OPERATION
10.7 Audio Encoding
This chapter explains how to use the encoding and codec modes of VS1063a.
VS1063 has a stereo ADC, thus also two-channel (separate AGC, if AGC enabled) and stereo
(common AGC, if AGC enabled) modes are available. Mono encoding can select either left or
right channel, or a mono down-mix of the left and right channels. The left channel is either MIC
or LINE1 depending on the SCI_MODE register, the right channel is LINE2.
10.7.1 Encoding Control Registers
Register Bits Description
SCI_MODE 2, 12, 14 Start ENCODE mode, select MIC/LINE1
SCI_AICTRL0 15:0 Samplerate 8000. . . 48000 Hz (read at encoding startup)
SCI_AICTRL1 15:0 Encoding gain (1024 = 1×) or 0 for automatic gain control
SCI_AICTRL2 15:0 Maximum autogain amplification (1024 = 1×, 65535 = 64×)
SCI_AICTRL3 2:0 ADC mode 0. . . 4
3 Reserved, set to 0
7:4 Encoding format 0. . . 6
8:9 reserved, set to 0
10 No RIFF WAV header inserted (or expected in codec mode)
11 Pause enable
12 reserved, set to 0
13 UART TX enable
14 AEC enable
15 codec mode (both encode and decode)
SCI_WRAMADDR 15. . . 0 Quality / bitrate selection for Ogg Vorbis and MP3
If you use the VS1063a Patches package, activate encoding mode by first setting the bit
SM_ENCODE in register SCI_MODE, then writing 0x50 to SCI_AIADDR. Otherwise, activate
encoding by setting bits SM_RESET and SM_ENCODE in SCI_MODE.
Line input 1 is used instead of differential mic input if SM_LINE1 is set. Before activating encod-
ing, user must write the right values to SCI_AICTRL0, SCI_AICTRL3, and SCI_WRAMADDR.
These values are only read at encoding startup. SCI_AICTRL1 and SCI_AICTRL2 can be
altered anytime, but it is preferable to write good init values before activation.
SCI_AICTRL1 controls linear encoding gain. The gain is
AICT RL1
1024
, so 1024 is equal to digital
gain 1.0, 2000 is 1.95, 512 is 0.5 and so on. If the user wants to use automatic gain control
(AGC), SCI_AICTRL1 should be set to 0. Typical speech applications usually are better off
using AGC, as this takes care of relatively uniform speech loudness in encodings.
SCI_AICTRL2 controls the maximum AGC gain. This can be used to limit the amplification of
noise when there is no signal. If SCI_AICTRL2 is zero, the maximum gain is initialized to 65535
(64×), i.e. whole range is used.
Version: 0.42, 2011-11-24 55