Datasheet
HH
VS1053B OGG VORBIS ENCODER VSMPG
2.3.2 Loading and Starting the Code
To load and start the VS1053b Ogg Vorbis Encoder, do the following steps:
1. Set the VS1053b clock to the highest value just below 55.3 MHz. Example: if the
external clock is 12.288 MHz, this can be done by setting the clock to 4.5X, or
55.296 MHz by writing 0xC000 to register SCI_CLOCKF (3). If you use another
input clock, adjust SCI_CLOCKF accordingly.
Examples: Value for 12 MHz is 0xC3e8, 12.288 MHz is 0xC000, 13 MHz is 0xA4E2.
2. Set SCI_BASS (2) to 0.
3. Reset VS1053b by setting bit SM_RESET (2) to 1 in register SCI_MODE (0). At
the same time, clear bit SM_ADPCM (12) to 0. Remember that resetting takes
time, so don’t do any firther register writes before the DREQ pin has risen!
4. Disable all interrupts except the SCI interrupt by writing 0x2 to VS1053’s internal
register VS1053_INT_ENABLE. This is done by first writing 0xC01A to SCI_WRAMADDR
(7), then 0x2 to SCI_WRAM (6).
5. Load the plugin profile you intend to run (Chapter 4). Note that you will have to
redo this each time you want to activate recording.
6. Set bit SM_ADPCM (12) in register SCI_MODE (0) to 1. At the same time, you
can also select LINE input instead of MIC input by setting bit SM_LINE1 (14) to 1.
If you want to use the VU meter in stereo mode, set also bit SM_LAYER12 (1) to
1. Do not set SM_RESET (2) at the same time!
7. Set recording level control registers SCI_AICTRL1 (13) and SCI_AICTRL2 (14).
Typical good values for conservative AGC are 0 and 4096, respectively. For a HiFi
application, recommended values are 1024 and 0, respectively.
8. If you want to use a VU meter, write 0x8000 to SCI_AICTRL0 (12) if using a mono
profile or 0x8080 is using a stereo profile.
9. Set a proper value (often 0) to SCI_AICTRL3 (15).
10. If you use a profile that support Vox, set Vox registers. For details, see Chapter 2.5.
11. Activate the encoder by writing 0x34 to register SCI_AIADDR (10).
12. Wait until DREQ pin is high before reading any data.
Rev. 1.70c 2012-11-16
Page 9(39)