background image
MAS 3504D
G.729 Annex A
Voice Codec
Edition Sept. 25, 2000
6251-522-2AI
ADVANCE INFORMATION
MICRONAS
MICRONAS
background image
MAS 3504D
ADVANCE INFORMATION
2
Micronas
Contents
Page
Section
Title
4
1.
Introduction
4
1.1.
Features
5
1.2.
Application Overview
5
1.2.1.
Decoder Mode
5
1.2.2.
Encoder Mode
6
2.
Functional Description of the MAS 3504D
6
2.1.
DSP Core
6
2.2.
Firmware (Internal Program ROM)
6
2.2.1.
G.729 Encoder
6
2.2.2.
G.729 Decoder
6
2.3.
Program Download Feature
6
2.4.
Clock Management
6
2.5.
Power Supply Concept
6
2.5.1.
Internal Voltage Monitor
7
2.5.2.
DC/DC Converter
7
2.5.3.
Stand-by Functions
8
2.5.4.
Start-up Sequence
8
2.6.
Interfaces
8
2.6.1.
Parallel Input Output Interface (PIO)
8
2.6.2.
Parallel Data Output
9
2.6.3.
Parallel Data Input
9
2.6.3.1.
DMA Handshake Protocol
10
2.6.3.2.
End of DMA Transfer
10
2.6.4.
Audio Input Interface (SDI)
10
2.6.5.
Audio Output Interface (SDO)
11
2.6.5.1.
Example 1:16 Bits/Sample (I
2
S Compatible Data Format)
11
2.6.5.2.
Example 2:32 Bit/Sample (Inverted SOI)
12
3.
Control Interfaces
12
3.1.
I
2
C Bus Interface
12
3.1.1.
Device and Subaddresses
13
3.2.
Command Structure
13
3.2.1.
Conventions for the Command Description
14
3.3.
Detailed MAS 3504D Command Syntax
14
3.3.1.
Run
14
3.3.2.
Write Register
14
3.3.3.
Write D0 Memory
14
3.3.4.
Write D1 Memory
15
3.3.5.
Read Register
15
3.3.6.
Read D0 Memory
15
3.3.7.
Read D1 Memory
15
3.4.
Version Number
16
3.5.
Register Table
16
3.5.1.
DC/DC Converter (Reg. $8e)
16
3.5.2.
User Control (Reg. $fd)
17
3.5.2.1.
Data Transmission Format
background image
Contents, continued
Page
Section
Title
ADVANCE INFORMATION
MAS 3504D
Micronas
3
17
3.5.2.2.
Encoder Operation
17
3.5.2.3.
Decoder Operation
17
3.5.2.4.
Pause and Mute
18
3.5.3.
Volume Control (Reg. $fc)
18
3.5.4.
Interface Control
18
3.5.4.1.
Wordlength Control (Reg. $74)
18
3.5.4.2.
Input Configuration (Reg. $61)
18
3.5.4.3.
Output Configuration (Reg. $e1)
18
3.5.5.
Hardware Control (Reg. $fa)
21
4.
Specifications
21
4.1.
Outline Dimensions
22
4.2.
Pin Connections and Short Descriptions
24
4.2.1.
Pin Descriptions
24
4.2.1.1.
Power Supply Pins
24
4.2.1.2.
DC/DC Converter Pins
24
4.2.1.3.
Control Lines
24
4.2.1.4.
Parallel Interface Lines
24
4.2.1.4.1.
PIO Handshake Lines
24
4.2.1.4.2.
PIO Data Lines
25
4.2.1.5.
Voltage Supervision And Other Functions
25
4.2.1.6.
Serial Input Interface
25
4.2.1.7.
Serial Output Interface
25
4.2.1.8.
Miscellaneous
26
4.2.2.
Pin Configurations
27
4.2.3.
Internal Pin Circuits
28
4.2.4.
Electrical Characteristics
28
4.2.4.1.
Absolute Maximum Ratings
29
4.2.4.2.
Recommended Operating Conditions
30
4.2.4.3.
Characteristics
31
4.2.4.3.1.
I
2
C Characteristics
32
4.2.4.3.2.
I
2
S Bus Characteristics – SDI
33
4.2.4.3.3.
I
2
S Characteristics – SDO
34
4.2.4.4.
DC/DC Converter Characteristics
35
4.2.4.5.
Typical Performance Characteristics
40
5.
Data Sheet History
background image
MAS 3504D
ADVANCE INFORMATION
4
Micronas
G.729 Annex A Voice Codec
1. Introduction
The MAS 3504D is a single-chip codec for use in
memory-based voice recording and playback applica-
tions. Due to embedded memories, the embedded DC/
DC up-converter, and the very low power consump-
tion, the MAS 3504D is ideally suited for portable elec-
tronics.
The MAS 3504D implements a voice encoder and
decoder that is compliant to the ITU Standard G.729
Annex A. This standard works on 8 kHz, 16 bit, mono
audio data that is compressed to 1 bit per audio sam-
ple. One second of compressed audio data uses
1000 bytes of memory.
1.1. Features
– Single-chip G.729 decoder
– G.729 Annex A encoder
– ITU compliance tests passed
– Parallel input and parallel output of coded bitstream
data
– Input audio data read from an I
2
S bus (in various
formats)
– Output audio data delivered via an I
2
S bus (in vari-
ous formats)
– Digital volume / mute
– Low power dissipation (150 mW for encoder, 80 mW
for decoder @ 3.3 V)
– Supply voltage range: 1.0 V to 3.6 V due to built-in
DC/DC converter (1-cell battery operation)
– Adjustable power supply supervision
– Power-off function
– Additional functionality achievable via download
software (ADPCM encoder/decoder)
Fig. 1–1: MAS 3504D block diagram
CLKI
decoded output
voice audio data
/3/
/3/
Serial In
I
2
C
RISC DSP Core
PIO
/3/
/8+5/
/2/
serial control
MAS 3504D
parallel I/O
DC/DC
Converter
Clock
Synthesizer
Serial Out
I
2
S
background image
ADVANCE INFORMATION
MAS 3504D
Micronas
5
1.2. Application Overview
The MAS 3504D can be applied in two major environ-
ments: as standalone decoder or as encoder/decoder
combination. For decoding only mode, the DAC 3550A
fits perfectly to the requirements of the MAS 3504D. It
is a high-quality multi sample rate DAC (8 kHz ...
50 kHz) with internal crystal oscillator, which is only
needed for generating the decoder Clock, and inte-
grated stereo headphone amplifier plus 2 stereo
inputs.
1.2.1. Decoder Mode
In a memory-based voice playback environment, the
decoding is started with a command from a controller.
Then the MAS 3504D continuously requests frames of
G.729 data every 10 ms via the parallel (PIO) inter-
face.
A delayed response of the host to the request signal
(max. 20 milliseconds) will be tolerated by the
MAS 3504D as long as the input buffer does not run
empty. A PC might use its DMA capabilities to transfer
the data in the background to the MAS 3504D without
interfering with its foreground processes.
The source of the bit stream may be a memory (e.g.
ROM, Flash) or PC peripherals, such as CD-ROM
drive, a hard disk or a floppy disk drive.
1.2.2. Encoder Mode
For encoding a support routine must be downloaded to
the MAS 3504D via I
2
C. After the encoder is started, it
begins to encode the incomming audio data and writes
the coded datastream to the parallel (PIO) interface.
A delayed response of the host to the data available
signal (max. 20 milliseconds) will be tolerated by the
MAS 3504D as long as the output buffer does not
overrun.
Fig. 1–2: Block diagram of a MAS 3504D, decoding a stored bit stream in a decoding only application
Fig. 1–3: Block diagram of a MAS 3504D in an encoding/decoding application
ROM, CD-ROM,
RAM, Flash Mem. ..
Host
(PC, Controller)
I
2
S
line out
I
2
C
demand signal
demand clock
G.729 bit stream
CLKI
CLKOUT
18.432 MHz
MAS 3504D
DAC
3550A
ROM, CD-ROM,
RAM, Flash Mem. ..
Host
(PC, Controller)
clock
line in
I
2
C
CLKI
G.729 bit stream
Mic in
Handshake signals
line out
strobe
data out
data in
I
2
S lines
MAS 3504D
PLL
AD/DA
background image
MAS 3504D
ADVANCE INFORMATION
6
Micronas
2. Functional Description of the MAS 3504D
2.1. DSP Core
The hardware of the MAS 3504D consists of a high
performance Digital Signal Processor and appropriate
interfaces. The processor works with a memory word
length of 20 bits and an extended range of 32 bits in its
accumulators. The instruction set of the DSP is highly
optimized for audio data compression and decompres-
sion. Thus, only very small areas of internal RAM and
ROM are required. All data input and output actions
are based on a ‘non cycle stealing’ background DMA
that does not cause any computational overhead.
2.2. Firmware (Internal Program ROM)
The firmware fully contains a G.729 voice decoder.
With an additional support routine the IC is extended to
a G.729 Annex A encoder.
The G.729 standard compresses 8 kHz/16 bit mono
voice data in frames of 80 samples to 10 bytes each,
what results in a compressed bitstream of 1 bit/sam-
ple. The encoding according to Annex A has reduced
complexity, but is fully compatible to the initial G.729
standard. Therefore the MAS 3504D can decode bit-
streams that were encoded by other G.729 encoders
and it can encode bitstreams that can be decoded with
other G.729 decoders.
2.2.1. G.729 Encoder
For encoding operation the MAS 3504D has to be pre-
pared by downloading an additional routine to support
the encoder. After starting the encoder, 80 audio sam-
ples are continously read via the serial input interface.
Each audio block of 80 samples is encoded to a G.729
data frame consisting of 10 bytes which is sent via the
parallel interface. It is possible to monitor the input
audio samples also directly via the serial output inter-
face.
2.2.2. G.729 Decoder
The MAS 3504D expects a sequence of valid G.729
frames (10 bytes each) as input. The compressed data
is sent via the parallel interface. Each frame is
decoded to 80 audio samples, modified by the volume/
mute control and sent out via the serial output inter-
face.
2.3. Program Download Feature
The overall function of the MAS 3504D can be altered
by downloading up to 1 kWord program code into the
internal RAM and by executing this code instead of the
ROM code. During this time, G.729 processing is not
possible.
The code must be downloaded by the ‘write to mem-
ory’ command (see Section 3.3.) into an area of inter-
nal RAM. A ‘run’ command starts the operation.
Micronas provides modules for encoding and decoding
audio data with ADPCM.
Detailed information about downloading is provided in
combination with the MAS 3504D software develop-
ment package from Micronas.
2.4. Clock Management
The MAS 3504D should be driven by a single clock at
a frequency of 18.432 MHz.
The CLKI signal acts as a reference for the embedded
clock synthesizer that generates the internal system
clock.
2.5. Power Supply Concept
The MAS 3504D offers an embedded controlled DC/
DC converter and voltage monitoring circuits for bat-
tery based power supply concepts. It works as an up-
converter. The application circuit for the DC/DC con-
verter is shown in Fig. 2–1.
2.5.1. Internal Voltage Monitor
An internal voltage monitor compares the input voltage
at the VSENS
pin with an internal reference value that
is adjustable via I
2
C bus. The PUP output pin becomes
inactive when the voltage at the VSENS pin drops
below the programmed value of the reference voltage.
It is important that the WSEN must not be activated
before the PUP is generated. The PUP signal thresh-
olds are listed in Table 3–8.
background image
ADVANCE INFORMATION
MAS 3504D
Micronas
7
2.5.2. DC/DC Converter
The DC/DC converter of the MAS 3504D is used to
generate a fixed power supply voltage even if the chip
is powered by battery cells in portable applications.
The DC/DC converter is designed for the application of
1 or 2 batteries or NiCd cells. The DC/DC converter is
switched on by activating the DCEN pin. Its output
power is sufficient for other ICs as well.
A 22
µ
H inductor is required for the application. The
important specification item is the inductor saturation
current rating, which should be greater than 2.5 times
the DC load current. The DC resistance of the inductor
is important for efficiency. The primary criterion for
selecting the output filter capacitor is low equivalent
series resistance (ESR), as the product of the inductor
current variation and the ESR determines the high-fre-
quency amplitude seen on the output voltage. The
Schottky diode should have a low voltage drop V
D
for a
high overall efficiency of the DC/DC converter. The
current rating of the diode should also be greater than
2.5 times the DC output current. The VSENS pin is
always connected to the output voltage at the low ESR
capacitor.
2.5.3. Stand-by Functions
The digital part of the MAS 3504D and the DC/DC
converter are turned on by setting WSEN. If only the
DC/DC converter should work, it can remain active
bysetting DCEN alone to supply other parts of the
application even if the audio decoding part of the
MAS 3504D is not being used. The WSEN power-up
pin of the digital part should be handled by the control-
ler.
Please pay attention to the fact, that the I
2
C interface is
working only if the processor is powered up
(WSEN = 1).
Fig. 2–1: DC/DC converter application circuit
voltage monitor
DC/DC
converter
Start-up
oscillator
Frequency
divider
optional
filter
x2
+32
0...15
32...47
64...94
10
16
+
+
VSS
AVSS
AVDD
VDD
CLKI
DCSO
DCSG
DCEN
PUP
WSEN
VSENS
V
in
0.9 V
22
µ
H
C
out
330
µ
F
Low ESR
C
in
330
µ
F
DCCF
$8e
9
47 k
µController
47 k
Power-On
Push Button
background image
MAS 3504D
ADVANCE INFORMATION
8
Micronas
2.5.4. Start-up Sequence
The DC/DC converter operates at a minimum input
voltage of 0.9 V. In case WSEN is active, the
MAS 3504D is in the DSP operation mode. The start-
up script should be as follows:
1. in the power-off state DCEN and WSEN are inactive
2. set DCEN to > 0.9 V
3. hold DCEN until controller operates, detects if
PUP
is high, and sets WSEN to high.
Please also refer to Figure 2–2.
Note: Connecting DCEN directly to VDD leads to unex-
pected states of the DCCF register.
The PUP signal should be read out by the system con-
troller and used to set WSEN.
2.6. Interfaces
The MAS 3504D uses an I
2
C control interface, a paral-
lel I/O interface (PIO) for G.729- or ADPCM-data, a
digital audio input interface (SDI) for audio data input
and a digital audio output interface (SDO) for the
decoded audio data (I
2
S or similar).
The G.729 bit stream generated by an encoder is
aligned in frames of 10 bytes. The parallel data
required from the G.729 decoder must be sent in byte-
swapped order related to the standard specification.
The G.729 encoder also sends the encoded bit stream
byte-swapped to the PIO interface.
2.6.1. Parallel Input Output Interface (PIO)
The parallel interface of the MAS 3504D consists of
the lines PI0...PI4, PI8, PI12...PI19, and several con-
trol lines.
Fig. 2–2: DC/DC startup
2.6.2. Parallel Data Output
In encoding mode, PIO lines PI12
...
PI19 are switched
to the MAS 3504D data output which hence will be an
8-bit parallel output port with MSB first (at position
PI19) for the G.729 bit stream data.
The data is transfered in bursts of 10 bytes (1 frame)
each 10 ms. If the transmission of headers is enabled,
there is an additional 10 byte burst before each
sequence of 50 frames.
Handshaking for PIO output mode is accomplished
through the RTW, PCS, and PI12
..
PI19 signal lines
(see Fig. 2–3). The PR line has to be set to high level.
RTW will go low as soon as a byte is available in the
output buffer and will stay low until a byte has been
read. Reading of a byte is performed with a PCS pulse.
Data is latched out from the MAS 3504D on the falling
edge of PCS and removed from the bus on the rising
edge of PCS.
Fig. 2–3: Parallel Data Output (PIO) Timing
> 0.9 V
WSEN > 2 V
DCEN
=1
DSP
operation
µController
DC/DC
On
button
RTW
PIxx
PCS
t
3
t
0
t
1
t
2
t
4
t
5
background image
ADVANCE INFORMATION
MAS 3504D
Micronas
9
2.6.3. Parallel Data Input
In decoding mode, PIO lines PI12
...
PI19 are switched
to the MAS 3504D data input which hence will be an 8-
bit parallel input port with MSB first (at position PI19)
for the G.729 bit stream data. In order to write data to
this parallel port, a special handshake protocol has to
be used by the controller (see Fig. 2–4).
2.6.3.1. DMA Handshake Protocol
The data transfer can be started after the EOD pin of
the MAS 3504D is set to high. After verifying this, the
controller indicates the transmission of data by activat-
ing the PR line. The MAS 3504D responds by setting
the RTR line to the low level. The MAS 3504D reads
the data PI[19:12] after the rising edge of the PR. The
next data word write operation will again be initialized
by setting the PR line via the controller. Please refer to
Figure 2–4 and Table 2–2 for the exact timing.
Fig. 2–4: Handshake protocol for writing G.729 data to the PIO-DMA
Table 2–1: PIO Output Mode Timing
1)
Symbol
Pin
Min.
Max.
Unit
t
0
RTW, PCS
0.010
1800
µ
s
t
1
PCS
0.330
µ
s
t
2
PCS, RTW
0.010
µ
s
t
3
RTW
0.330
10000
µ
s
t
4
PI
0.330
µ
s
t
5
PI
0.081
µ
s
1)
see Figure 2–3
EOD
PR
RTR
PI[19:12]
high
low
high
low
high
low
high
low
t
st
t
rpr
t
rtrq
t
set
t
h
t
r
t
pr
t
pd
t
eodq
t
eod
Byte 15
Byte 1
MAS 3504D latches the PIO DATA
background image
MAS 3504D
ADVANCE INFORMATION
10
Micronas
2.6.3.2. End of DMA Transfer
The above procedure will be repeated until the
MAS 3504D sets the EOD signal to “0”, which indi-
cates that the transfer of one data block has been exe-
cuted. Subsequently, the controller should set PR to
“0”, wait until EOD rises again, and then repeat the
procedure (see Section 2.6.3.1. ) to send the next
block of data. The DMA buffer is 10 bytes long (one
frame).
The recommended PIO DMA conditions and the char-
acteristics of the PIO timing are given in Table 2–2.
2.6.4. Audio Input Interface (SDI)
The A/D interface is a standard I
2
S interface (16/32 bit,
stereo). This input is used for G.729 recording mode
and must be slaved to the D/A output clock and word-
strobe signals.
The interface is configurable by software to work in dif-
ferent modes. It is possible to choose:
– inverted or noninverted word strobe (SOI),
– no delay or delay of data related to word strobe
– inverted or noninverted I
2
S-Clock (SOC).
For further details see Section 3.5.4.
2.6.5. Audio Output Interface (SDO)
The audio output interface of the MAS 3504D is a
standard I
2
S interface. As the G.729 standard is only
working on mono signals, the same signal is written to
both output channels (left and right).
The interface is configurable by software to work in dif-
ferent modes. It is possible to choose:
– 16 or 32 bit/sample modes,
– inverted or noninverted word strobe (
SOI
),
– no delay or delay of data related to word strobe
– inverted or noninverted I
2
S-clock (
SOC
).
For further details see Section 3.5.4.
Table 2–2: PIO DMA Timing
Symbol
PIO Pin
Min.
Max.
Unit
t
st
PR, EOD
0.010
2000
µ
s
t
r
PR, RTR
40
160
ns
t
pd
PR,
PI[19:12]
120
480
ns
t
set
PI[19:12]
160
no limit
ns
t
h
PI[19:12]
160
no limit
ns
t
rtrq
RTR
200
30000
ns
t
pr
PR
120
no limit
ns
t
rpr
PR, RTR
40
no limit
ns
t
eod
PR, EOD
40
160
ns
t
eodq
EOD
0
500
µ
s
background image
ADVANCE INFORMATION
MAS 3504D
Micronas
11
2.6.5.1. Example 1:16 Bits/Sample
(I
2
S Compatible Data Format)
A schematic timing diagram of the SDO interface in 16
bit/sample mode with delayed data by 1 clock cycle is
shown in Fig. 2–5.
Fig. 2–5: Schematic timing of the SDO interface in 16bit/sample mode
2.6.5.2. Example 2:32 Bit/Sample (Inverted SOI)
If the serial output generates 32 bits per audio sample,
only the first 20 bits will carry valid audio data. The 12
trailing bits are set to zero by default (see Fig. 2–6).
Fig. 2–6: Schematic timing of the SDO interface in 32 bit/sample mode
SOC
SOD
V
h
V
l
SOI
left 16-bit audio sample
right 16-bit audio sample
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
13 12 11 10
9 8
7
6
5
4
3
2
1
0
15 14
V
h
V
l
V
h
V
l
30 29 28 27 26 25 ... 7
6
5
4
3
2
1
0
31 30 29 28 27 26 25
7
6
5
4
3
2
1
0
left 32-bit audio sample
right 32-bit audio sample
SOC
SOD
SOI
V
h
V
l
V
h
V
l
V
h
V
l
...
...
31
...
background image
MAS 3504D
ADVANCE INFORMATION
12
Micronas
3. Control Interfaces
3.1. I
2
C Bus Interface
3.1.1. Device and Subaddresses
The MAS 3504D is controlled via the I
2
C bus slave
interface.
The IC is selected by transmitting the MAS 3504D
device addresses. (see Table 3–1).
Writing is done by sending the device write address,
(