VS1103b
VS1103
B
VS1103b - MIDI/ADPCM AUDIO
CODEC
Features
•
Mixes three audio sources
–
General MIDI 1+ / SP-MIDI
–
WAV (PCM + IMA ADPCM)
–
Microphone or line input
•
Encodes IMA ADPCM from microphone,
line input or mixed output
•
Input streams can use different sample rates
•
EarSpeaker Spatial Processing
•
Bass and treble controls
•
Operates with a single 12. . . 13 MHz clock
•
Internal PLL clock multiplier
•
Low-power operation
•
High-quality on-chip stereo DAC with no
phase error between channels
•
Stereo earphone driver capable of driving a
30Ω load
•
Separate operating voltages for analog, dig-
ital and I/O
•
5.5 KiB On-chip RAM for user code / data
•
Serial control and data interfaces
•
Can be used as a slave co-processor
•
SPI flash boot for special applications
•
UART for debugging purposes
•
New functions may be added with software
and 4 GPIO pins
Description
VS1103b is a single-chip MIDI/ADPCM/WAV au-
dio decoder and ADPCM encoder that can handle
upto three simultaneous audio streams. It can also
act as a Midi synthesizer.
VS1103b contains a high-performance, proprietary
low-power DSP processor core VS DSP
4
, work-
ing data memory, 5 KiB instruction RAM and
0.5 KiB data RAM for user applications, serial
control and input data interfaces, 4 general pur-
pose I/O pins, an UART, as well as a high-quality
variable-sample-rate mono ADC and stereo DAC,
followed by an earphone amplifier and a common
buffer.
VS1103b receives its input bitstreams through se-
rial input buses, which it listens to as a system
slave. The input streams are decoded and passed
through digital volume controls to an 18-bit over-
sampling, multi-bit, sigma-delta DAC. Decoding
is controlled via a serial control bus. In addition
to basic decoding, it is possible to add application
specific features, like DSP effects, to user RAM
memory.
mic
audio
line
audio
GPIO
VS1103
MIC AMP
4
GPIO
MUX
Mono
ADC
Stereo
DAC
Stereo Ear−
phone Driver
audio
L
R
output
X ROM
DREQ
SO
SI
SCLK
XCS
XDCS
Serial
Data/
Control
Interface
X RAM
VSDSP
4
Y ROM
RX
TX
UART
Y RAM
Clock
multiplier
Instruction
RAM
Instruction
ROM
Version 1.01, 2007-09-03
1
VLSI
Solution
y
VS1103b
VS1103
B
CONTENTS
Contents
1 Disclaimer
2
3
Definitions
Characteristics & Specifications
3.1
3.2
3.3
3.4
3.5
3.6
4
Absolute Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Recommended Operating Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Analog Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Power Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Digital Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Switching Characteristics - Boot Initialization . . . . . . . . . . . . . . . . . . . . . . .
8
8
9
9
9
10
11
11
11
12
12
12
12
13
15
15
15
15
15
16
16
Packages and Pin Descriptions
4.1
Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1.1
4.1.2
4.2
LQFP-48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BGA-49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LQFP-48 and BGA-49 Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . .
5
SPI Buses
5.1
5.2
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SPI Bus Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2.1
5.2.2
5.3
5.4
VS1002 Native Modes (New Mode) . . . . . . . . . . . . . . . . . . . . . . . .
VS1001 Compatibility Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Request Pin DREQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Serial Protocol for Serial Data Interface (SDI) . . . . . . . . . . . . . . . . . . . . . . .
Version 1.01, 2007-09-03
2
VLSI
Solution
y
VS1103b
5.4.1
5.4.2
5.4.3
5.4.4
VS1103
B
CONTENTS
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SDI in VS1002 Native Modes (Recommended) . . . . . . . . . . . . . . . . . .
SDI in VS1001 Compatibility Mode . . . . . . . . . . . . . . . . . . . . . . . .
Passive SDI Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16
16
17
17
17
17
18
18
19
20
21
21
21
22
23
23
23
23
24
26
26
27
28
28
5.5
Serial Protocol for Serial Command Interface (SCI) . . . . . . . . . . . . . . . . . . . .
5.5.1
5.5.2
5.5.3
5.5.4
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI Multiple Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6
5.7
SPI Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SPI Examples with SM SDINEW and SM SDISHARED set . . . . . . . . . . . . . . .
5.7.1
5.7.2
5.7.3
Two SCI Writes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two SDI Bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI Operation in Middle of Two SDI Bytes . . . . . . . . . . . . . . . . . . . .
6
Functional Description
6.1
6.2
Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Supported Audio Codecs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2.1
6.2.2
6.3
Supported RIFF WAV Formats . . . . . . . . . . . . . . . . . . . . . . . . . . .
Supported MIDI Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Flow of VS1103b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3.1
6.3.2
Normal Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Real-Time RT-Midi Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.4
6.5
Serial Data Interface (SDI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Serial Control Interface (SCI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Version 1.01, 2007-09-03
3
VLSI
Solution
y
VS1103b
VS1103
B
CONTENTS
6.6
SCI Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.1
6.6.2
6.6.3
6.6.4
6.6.5
6.6.6
6.6.7
6.6.8
6.6.9
SCI MODE (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI STATUS (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI BASS (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI CLOCKF (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI DECODE TIME (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI AUDATA (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI WRAM (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI WRAMADDR (W) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI IN0 and SCI IN1 (R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
29
31
31
32
33
33
33
33
34
34
34
35
35
36
37
37
37
37
38
38
38
39
40
6.6.10 SCI AIADDR (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.11 SCI VOL (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.12 SCI MIXERVOL (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.13 SCI ADPCMRECCTL (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.14 SCI AICTRL[x] (RW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7
Operation
7.1
7.2
7.3
7.4
Clocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Software Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADPCM Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.4.1
7.4.2
7.4.3
7.4.4
Activating ADPCM Recording . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reading IMA ADPCM Data . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding a RIFF Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Playing ADPCM Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Version 1.01, 2007-09-03
4
VLSI
Solution
y
VS1103b
7.4.5
7.4.6
VS1103
B
CONTENTS
Sample Rate Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40
40
42
42
42
42
43
43
44
44
45
45
45
45
45
45
46
47
48
49
50
50
51
51
7.5
7.6
7.7
7.8
SPI Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Play/Decode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Feeding PCM data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SDI Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.8.1
7.8.2
7.8.3
7.8.4
Sine Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pin Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Memory Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 VS1103b Registers
8.1
8.2
8.3
8.4
8.5
8.6
8.7
8.8
8.9
Who Needs to Read This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Processor Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
VS1103b Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SCI Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Serial Data Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DAC Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GPIO Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interrupt Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A/D Modulator Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.10 Watchdog
v1.0 2002-08-26
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.10.1 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.11 UART
v1.0 2002-04-23
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.11.1 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Version 1.01, 2007-09-03
5