❚Uncompressed LPCM with 1-8 channels,
❚Precision of up to 24 bits and sample rates
of between 44.1 kHz and 192 kHz.
■
Dolby Digital
❚Decodes 5.1
❚Output up to 6 channels. downmix modes:
1, 2, 3 or 4 channels.
■ MPEG -1 2- channel audio decoder, layers I and
II.
■ MPEG-2 6-channel audio dec ode r, layer II.
❚24 bits decoding precision.
■ MP3 (MPEG layer III) decoder.
■ Accepts MPEG-2 PES stream format for:
MPEG-2, MPEG-1, Dolby Digital and linear
PCM.
■ Karaoke System.
■ Prologic decoder.
■ Downmix for Dolby Prologic compatible.
❚A separate (2-ch) PCM output available for
simultaneous playing and recording.
■ Bitstream input interface: serial, parallel or
SPDIF.
■ SPDIF and IEC-61937 input interface.
■ SPDIF and IEC-61937 output interface.
■ PLL for internal PCM clock generation.
frequencies supported: 44.1KHz family (22.05,
88.2, 176.4) and 48KHz family (24, 48, 96, 192).
■ PCM: transparent, downsampling 192 to 96 Khz
and 96 to 48kHz.
■ PTS handling control on-chip.
■ No external DRAM required
2
■ I
C or parallel control bus
■ Embedded
customizable software capability.
■ Configurable internal PLLs for system and
audio clocks, from an externally provided clock.
■ 80-PIN TQFP package
decoder:
(*)
decoder:
Dolby Digital Surround.
Development RAM
), with
for
STA310
PRELYMINARY DATA
TQFP80
ORDERING NUMBER: STA310
■ 2.5V (for core) and 3V (for I/O) power supply.
❚3V Capable I/O Pads .
■ True-SPDIF input receiver supporting AES/
EBU, IEC958, S/PDIF.
❚No external chip required.
❚Differential or single ended inputs can be
decoded.
APPLICATIONS
■ High-end audio equipment.
■ DVD consumer players.
■ Set top box.
■ HDTV .
■ Multimedia PC.
(*)
“Dolby “, “AC-3”
trademarks of
DESCRIPTION
The STA310 is a fully integrated Audio Decoder capable of decoding all the above listed formats.
Encoded input data can be entered either by a serial
(I2S or SPDIF) or a parallel interface. A second input
data stream (I2S) is available for micro input.
The control interface can be either
bit interface. No external DRAM is necessary for a total of 35ms surround delays.
and
“ProLogic”
are
Dolby Laboratories.
I2C
or a parallel 8-
June 2003
This is preliminary information on a new product now in development. Details are subject to change without notice.
1/90
STA310
2STA310 AUDIO DECODER PIN DESCRIPTION
Pin NumberNameTypeFunction
CONTROL INTER FACES
(1)
48IRQB
47SELI2C
2
C Control Interface
I
43SDAI2C
O
I/O
Interrupt Signal (level), active low
(2)
Selects the Control Interface (when high: serial interface; when
I
low: parallel interface)
(1)I 2
C Serial Data
46SCLKI2CI
53MAINI2CADR
I 2C Clock
(2)
Determines the slave address
I
Parallel Control Interface
78 - 79 - 80 - 1
2 - 3 - 6 - 7
12 - 13 - 14 - 15
16 - 18 - 19 - 20
D0 - D1 - D2 - D3
D4 - D5 - D6 - D7
A0 - A1 - A2 - A3
A4 - A5 - A6 - A7
I/OHost Data
IHost Address
21DCSBIChip Select, active low
22R/W
IRead/Write Selection: read access when high, write access
when low
(3)
35WAITB
O
Data Acknowledge, active low
DATA INPUT INTERFACE
2
First Serial Data Interface (I
S)
37 DSTRBIClock Input Data, active low
41SINISerial Input Data
40LRCLKINIWord Clock for the Input
42REQOHandshake for the Data Transfer, aconfigurable by the
SIN_SETUP register
2
Second Serial Data Interface (I
S)
62DSTRB2IClock Input Data, active low
60SIN2ISerial Input Data
61LRCLKIN2IWord Clock for the Input
63REQ2OHandshake for the Data Transfer, active low
DATA OUTPUT INTERFACES
69PCMCLKI/OOversampling Clock input for STA310 when generated externally
DAC Interface
67SCLKOBit Clock for the DAC
2/90
2STA310 AUDIO DECODER PIN DESCRIPTION (continued)
Pin NumberNameTypeFunction
68LRCLKOWord Clock for the DAC
72PCM_OUT0OData from a Prologic downmix (VCR_L/VCR_R)
73 PCM_OUT1O Data for the first DAC (Left/Right)
76PCM_OUT2OData for the second DAC (Centre/Sub)
77PCM_OUT3OData for the third DAC (LeftSur/RightSur)
IEC958 Interface (S/PDIF) - One Output Port., One Input Ports.
58I958OUTOS/PDIF Signal
25SPDPIFirst differential input of S/P DIF port
24SPDNISecond differential input of S/P DIF port
26SPDFIExternal Filter
28VDDAIAnalog VDD for S/P DIF Input port
29GNDAIAnalog GND for S/P DIF Input port
STA310
STATUS INFORMATION
PCM Related Information
54SFREQOThen high, indicates that the sampling freq. is either 44.1Khz or
57DEEMPHOIndicates if de-emphasis is performed.
Audio Video Synchronization
59PTSBOIndicates that a PTS has been detected, active low.
Other Signals
31CLK IMaster Clock Input Signal.
36RESET
52TESTB
49SMODEIReserved pin : to be connected to GND
RS232 Interface
8RS232RXI
9RS232TXO
22.05Khz.
When low, indicates that the sampling frequency is either 32 Khz,
48 Khz, 24 Khz or 16Khz.
(2)
Reset signal input, active low.
I
(2)
Reserved pin: to be connected to VDD
I
PLLs INTERFACES
64CLKOUTOSystem clock output with programmable division ratio
27PLLAFIExternal Filter For Audio PLL.
- Through a parallel interface (shared with the control interface)
- Through a serial interface (for all the I
- Through a S/P DIF (SPDIF or IEC-61937 standards).
- Trough a second, independent,I
2.1.2 Data outputs
- The PCM audio ooutput interface, which provide:
PCM data on 4 outputs:
• Left/Right,
• Centre/Subwoofer
• Left Surround/Right Surround.
2
S formats)
2
S (for application like i..e. Karaoke mixing).
S/P DIF
6/90
STA310
• Data From a Prologic downmix (encoder)
“Lrclk” “Sclk” “PcmClk”
- S/P DIF Output
2.1.3 Control I/F
I2C slave or parallel interface:
The device configuration and the command issuing is done via this i nterf ace. To f acilitate the contact with the
MCU, 2 interrupt lines (IRQB and INTLINE) are available.
3ARCHITECTURE OVERVIEW
3.1 Data flow
The STA310 is based on a programmable MMD SP+ core optim ized for audio decoding algorithms.
Dedicated hardware has been added to perform specif ic operati ons such as bit st ream depacking or IEC data
formatting.
The arrows in Figure 3 indicate the data flow within the chip.
The compressed bitstream is input via the data input interface.
Data are transferred on a byte basis to the FIFO. This FIFO allows burst input data at up to 33Mbit/s.
The input processor, which is composed of a packet parser and an audio parser, unpacks the bitstream (Packet
parser) and verifies the syntax of the incoming stream (audio parser).
The compressed audio frames with their associated information (PTS) are stored into the circular frame buffer.
While a second frame is stored in the circular frame buffer, the first frame is extracted by the audio core decoder
which decodes it to produce audio samples.
The PCM un it converts the sampl es to the P CM format. The PCM unit controls also the channe l delay buffer in
order to delay each channel independently.
In parallel, the IEC unit transmits non compressed data or compressed data according to the selected mode. In
the compressed mode, the data are extracted directly fr om the circular buff er and formatted according to the
IEC-61937 standard. In non compressed mode, the left and right PCM channels formatted by the PCM unit are
output by the IEC unit, according to the SPDIF standard
The IC can be controlled either by a host using an I²C interface, or by a general purpose host interface.
These interfaces provide the same functions and are described in the following sections. The selection is per-
formed by the means of the pin SELI2C: when high, this pin indicates that the I²C interface is used. When low,
the parallel interface is used.
3.3.1 Parallel control interface
When the pin SELI2C is low, the control of the chip is performed through the parallel interface. When accessing
the device through the parallel interface, the following signals are used:
- The address bus A[7..0]. It is used to select one of the 256 register locations.
- The data bus DAT A[7..0]. If a read cycle is requested, t he da ta lines D[7:0] wi ll be dri ve n by the IC.
For a write cycle, the STA310 will latch the data placed on the data lines when the WAIT
signal is
driven high.
- The signal R/W
. It defines the type of register access: either read (when high), or write (when low).
Some registers can be either written or read, some are read only, some are write only.
- The signal DCSB
Note: 1. The address bus A[7..0], and read/write signal R /W must be setup before the DCSB line is activated.
8/90
. A cycle is defined by the assertion of the signal DCSB.
STA310
- The signal WAIT. This signal is always driven low in response to the DCSB assertion.
The timing diagrams for the parallel control interface are given in
3.4 I2C control interface
When the pin SELI2C is high, the chip is controlled through the I²C interface. The I²C unit works at up to 400kHz
in slave mode with 7-bit addressing.
- The Pin MAINI2CADR selects the device ad dress. Whe n MAI NI2CADR is h igh the slave addres s is
0x5C, when low the device address is equal to the value on the address bus (A0...A6).
- The pin SDAI2C is the serial data line.
- The pin SCLKI2C is the serial clock.
The I²C Bus standard does not specify sub-addressing. There are thus potentially multi ple ways to implement
it. Any implementation that respects the standard is of c ourse legal but a particul ar implementat ion is us ed by
many companies. The following paragraphs describe this implementation.
3.4.1 Protocol description
For write accesses only, the first data which follows the slave address is always the sub-address.
This is the one and only way to declare the sub-address. It should be noticed that the sub-address is implement-
ed as a standard data on the I²C Bus protocol point of view. It is a sub-address because the slave knows that it
must load its address pointer with the first data sent by the master.
2
See in the Appendix X.x for I
C message format examples.
Electrical specifications
on page 5.
3.5 Decoding process
The decoding process in the STA310 is done in several stages:
- Parsing,
- Main decoding,
- Post decoding,
- Bass redirection,
- Volume and Balance control.
Each of the stages can be activated or bypassed according to the configuration registers.
Parsing
The bitstream parsing (performed by the input processor) is in charge of discarding all the non audio information
in order to transmit to the next stage (the circular frame buffer) only the audio elementary stream (AC3, MPEG1/
2, LPCM, PCM, DVD Audi o).
The parsing stage operates in two phases: the packet parser unpacks the stream, the audio parser checks the
syntax of the bitstream.
Main Decoding
The input of this stage is an elementary stream, the outputs are decoded samples. The number of output channels is defined by the downmix register (1 channel up to 6 channels). For details, please refer to the description
of the register.
The decoding formats currently supported are AC3, MPEG1 layers I and II, MPEG2 layer II, LPCM. It is necessary to select the appropriate stream format by configuring the registers STREAMSEL a nd DECO DESEL before
running the decoder.
9/90
STA310
Post Decoding
The post decoding includes specific PCM processing: DC filter, de-emphasis filter, downsampling filter. These
filters can be independently enabled or disabled through the register DWSMODE.
It provides also a Pro Logic decoder, which is described in detail in a next section.
Bass Redirection
This stage redirects the low frequency signals to the subwoofer.
The subwoofer is extracted from the other channels (L, R, C, Ls, Rs, LFe). There are six possible configurations
to extract the subwoofer channel, which can be selected thanks to the OCFG register.
Volume and Balance Control
The volume is a master volume (no independent control for each channel). It is controlled by the PCMSCALE
register, which enables to attenuate the signals by steps of 2dB.
Two balance controls are available: one for Left/Right channe ls, one for Left S urround/Right Surround channel s.
They are configurable by means of registers BAL_LR (Left-Right Balance) and BAL_SUR (Left Surround-Right
Surround Balance), which provide attenuation of signals by steps of 0.5dB.
4OPERATION
4.1 Reset
The STA310 can be reset either by a hardware reset or by a software reset:
- The hardware reset is sent when the pin RESET is activated low during at least 60ns. This is equivalent to a power-on reset.
This resets all the conf iguration registers , i.e. P LL registers (PL LSYS, PLLP CM ), Interrupt reg isters
(INTE, INT, ERROR), interface registers (SIN_SETUP, CAN_SETUP) and command registers
(SOFTRESET, RUN, PLAY, MUTE, SKIP_FRAME, REPEAT_FRAME).
- The software reset is sent when the register SOFTRESET is written to 1 (the register is automatically
reset once the software reset is perform ed). It resets onl y the interrupt related registers (INTE, INT,
ERROR) and the command registers (SOFTRESET, RUN, PLAY, MUTE, SKIP_FRAME,
REPEAT_FRAME). All other decoding configurations are not changed by softreset.
Some information concerning the post-processing are anywayt of date after a soft-reset
Note: 1. The chip must be soft reset bef ore changing any configuration register.
10/90
4.2 Clocks
There are two embedded PLLs in the STA310: the system PLL and the PCM PLL.
The following is the block diagram of the system and audio clocks used in the STA310
Figure 3. PLL Bl oc k D i agram
CLKOUT
CLK
RXN
RXP
PCMCLK
STA310
/ N
sys_clk
/ 2
sys_clockout
/ 2
DSP Core
plls_config
78
Figure 4. Blo ck D ia gra m of Function al P LL
R
PLL AudioPLL Sys
Periph 1
I
SPDIF
Periph 2
pcm_clk
W
PCM_OUT
Periph 3
pcmclk_en
SCLOC K
LRCLK
PCMOUT0 ,1,2,3
ClkIn
(27MHz)
DIV N+1
Frac
update_frac
pll_disable
DIV M+1
dN
Switching
Circuit
PFD
analog part
Charge
Pump
VCO
DIV (X+1)
Ip
Uvco
Oclk
Filter (external)
R
C3
C
11/90
STA310
4.2.1 System clock
The system clock sent to the DSP core and the peripherals can be derived from 4 sources and the selection is
performed through an Host Register; external clock, external clock divided by 2, internal system PLL and internal system PLL divided by 2.
The system PLL is used to create the system clock from the input clock. This PLL is software programmable
through the Host Registers mechanism. The system PLL is used to set the any frequency up to the maximum
allowed device speed. After hard reset the system clock is running at 47.25MHz. An RC network must be connected to the filter Pin PLLSF.
The system clock is output on the pin CLKOUT after a programmable divider ranging from 1 to 16.
4.2.2 DAC clocks
4.2.2.1 PCM clock
The PCM clock can be either input to the device or generated by the internal PLL or recovered by the embedded
SPDIF receiver. The selection is done via the Host Registers.
After a hardware reset, the internal PLL is disabled and the PCMCLK pad is an input. PCMCLK may be equal
to the PCM output bit rat e, or it may be an integer mult i ple of t hi s, allowi ng the us e of oversampling D-A converters.
The internal fractional PLL is able to generate PCMCLK at any “FsX Oversampling Factor” frequencies, where
Fs is any multiple or sub-multiple of the two 44.1kHz and 48kHz sampling frequencies. An RC network must be
connected to the filter pin PLLAF; refer to External circuitry on page 9 for recommended values.
If the PCMCLK is recovered from the embedded SPDIF receiver, the only supported overampling frquency is
128 Fs.
4.2.2.2 Bit clock SCLK
The PCM serial clock SCLK is the bit clock. It provides clocks for each time slot (16 cycles for each channel in
16-bit mode, 32 cycles for each channel in 18-, 20-, 24-bit modes). The frequency of SCLK is therefore fixed to
2 x Nb time slots x Fs, where Fs is the sample frequency.
The clock is derived from the clock PCMCLK. The register PCMDIVIDER must be configured according to the
selected output precision and the frequency of PCMCLK, so that the device can construct SCLK:
Fsclk = Fpcmclk / (2 x (PCMDIV IDER+1)) gives
Table 1.
PCM Divider ValueMode Description
5 PCMCLK = 384 Fs, DAC is 16-bit mode
3 PCMLK = 256 Fs, DAC is 16-bit mode
2 PCMLK = 384 Fs, DAC is 32-bit mode
1 PCMLK = 256 Fs, DAC is 32-bit mode
The value of PCMDIVIDER = 0 is reserved. If this number is loaded, the divider is bypassed and the frequency
of SCLK equals the frequency of PCMCLK. The PCMDIVIDER register must be setup before the output of SCLK
starts.
This can be done by first disabli ng PCM outputs, by de-asserting the MUTE and PLAY commands and then
writing into the PCMDIVIDER register. Once the regi s ter i s s etup, the MUTE and/ or PLAY commands can be
asserted. PCMDIVIDER can not be changed “on the fly”.
12/90
STA310
4.2.2.3 Word clock LRCLK
The frequency of LRCLK is given by:
- Flrclk = Fsclk/32; for 16 bit PCM output,
- Flrclk = Fsclk/64; for 18, 20 or 24 bits PCM output.
No special configuration is required. The polarity can be changed in the register PCMCONF, by setting up the
field INV as needed.
4.3 Decoding states
There are two different decoder states: Idle state and decode state (see <Blue HT>F igure 3). To change s tates,
register
Figure 5. Decoding States
Time
Idle
mode
Soft resetRun commandDecoder ready to play sample
Init
mode
Decode
mode
Idle Mode
This is the state entered after a hardware or software reset. In this state, the embedded DSP does not decode,
i.e. no data are processed. The chip is waiting for the RUN command, and during this state all configuration
registers must be initialized. In this state, even if the chip is not processing data, the DACs clocks can be output,
which enables to setup the external DACs. Once the PCMCLK, SCLK and LRCLK clocks are configured, it ispossible to output them by setting the MUTE register.I
Table 2. Idle mode. play and mute commands effects
Play Mute Clock (SCLK, LRCLK) StatePCM Output
X 0 Not running 0
X 1 Running 0
Note: 1. The PLAY command has no effect in this state as the decoder is n ot running. It can however be sent and it will be taken into account
as soon as t he decoder ent ers the decode state.
Decode Mode
This state is entered after the RUN command has been sent (i.e. RUN register = 1). In this mode, the data are
processed. The decoder can play sound, or mute the outputs, by using the PLAY and MUTE registers:
- To decode streams, the PLAY register must be set. When decoding, the sound will be sent to outputs
if the MUTE register is reset. The outputs are muted if the MUTE register is set.
- To stop decoding, the PLAY register should be reset. Resuming decoding is performed by writing
PLAY to 1 again
13/90
STA310
Table 3. Decode Mode. Play and Mute commands effects
Play Mute Clock State PCM Output Decoding
0 0 Not running 0 No
0 1 Running 0 No
1 0 Running Decoded SamplesYes
1 1 Running 0 Yes
Note: 1. It is not possible to change configuration registers in this state. It is necessary to soft reset the chip before. Only the following reg-
isters can be changed “on-the-fly”: PCM_SCALE, BAL_LR, BAL_SUR, OCFG, DOWNMIX registers.
4.4 Data input interface description.
Figure 6. Block Diagram of Data Flow
CLK
CLKOUT
PCMCLK
LRCLK
SCLK
PCMOUT0
PCMOUT3
PCMOUT2
SWITCH
R0
PCMOUT1
FRAME
BUFFER
D00AU1228
&
AUDIO
SYSTEM
CLOCKS
DSP
CORE
NBIT
DBIT/
R1
&
W
DMA
AUDIO
PARSER
PLLs
SPDIF_O
IEC958
FORMATTER
SPDIF
MODE
SWITCH
NULL
DATA
PCM Out Block
PCM
IEC 1937 (AC3/MPEG 2/DTS)
14/90
MAIN_I2C_ADRREQ
SEL_I2C
HOST
HOST INTERFACE
WAIT
SCL_I2C
SDA_I2C
256 BYTE
REGISTERS
HOST
CONTROL
RWB
DCSB
A0 to A7
D0 to D7
FIFO
PACKET
PARSER
8
8
S
2
I
3
3
LRCLKIN
SIN
DSTRB
SPDIF1_A
First Data Input Stream
STA120
SPDIF1_B
TEST
INTERFACE
S in
2
I
Second Data Input Stream
38
SIN2
DSTRB2RESET
LRCLKIN2
REQ2TEST SMODE
STA310
Two independent inputs are available on the STA310.
The main one allows to enter input data stream through through:
- A serial interface (referred to as Data Serial Interface),
- And a parallel interface (referred to as Data Parallel Interface).
The choice is performed by the register SIN_SETUP.
4.4.1 Data serial interface
When the serial mode is selected, the bitstreams can be entered into the STA310 through either:
- a four-signal data interface or ,
- trough a SPDIF input (no external circuit is required).
The four-signal data interface (see Figure 5) provides:
- An input data line SIN,
- An input clock DSTR
- A word clock input LRCLKIN
- And a hand-shake output signal REQ
-
Note: 1. Only 16-bit PCM streams ar e supported. For 20-bit or 24-bit PCM, the 4 or 8 lea st si gnifican t bits are ignored
.
The specifications of those signals can be configured by the means of the register CAN_SETUP.
Two modes exist in serial mode, one that uses the LRCLKIN pin and one that does not use the LRCLKIN pin.
,
.
4.4.1.1 Modes without the LRCLKIN pin
In this mode the signal LRCLKIN is not used by the STA310. The i nput data SIN is sampled on the rising edge
of DSTR
. When the STA310 input buf fer i s f ul l the REQ signal is asserted. The polarity of REQ signal is pro-
grammable through the register SIN_SETUP. The data must be sent most significant bits first.
When the decoder cannot accept further data the REQ
soon as possible to avoid data loss. After the REQ
is de-asserted and the DSTR clock must be stopped as
is de-asserted, the decoder is still able to accept data for a
limited number of clock cycles.
The maximum number of data that can be transmitted with respect to the change of REQ
ing formula: Nbits = 23 - 6 * F
/33MHz, where: F
DSTR
is the DST R clock frequency, (max is 33 MHz).
DSTR
is given by the follow-
4.4.1.2 Modes using the LRCLKIN pin
When receiving data from an A/D converter or from an S/PDIF receiver, the signal LRCLKIN is used.
The LRCLKIN signal is used to make the distinction between the l ef t and ri ght channels. Any edge of t he LR-
CLKIN signal indicates a word boundary.
The data transfer between the input interface and the FIFO is done on a byte basis. Af ter the edge (rising or
falling) of the LRCLKIN, a new byte is transferred to the first stage of the STA310 every 8 DSTR
clock cycles .
If the number of time slots is not a multiple of 8, the remaining data is lost. The polarity of LRCLKIN and DS TR
is programmable.
The LRCLKIN can be del ayed by one time slot, in order to support PC M delayed mode. All these configurations
are programmable through the CAN_SETUP register.
The register CAN_SETUP has 4 significant bits, and each bit has a specific meaning, see
CAN_SETUP
on page
41.
Only the first byte is transferred to the STA310 because the number of time slots is 12 (8 + 4). SIN and LRCLKIN
are sampled on the falling edge of DSTR In this case SIN_SETUP = 3 and CAN_SETUP = LeftFirstChannel +
FallingStrobe + AllSlot = 2 + 4 + 8 = 14
15/90
STA310
Table 4.
When SetWhen Clear Name
Bit 0 The input data is one slot delayed with
respect to LRCLKIN
Bit 1 First channel when LRCLKIN is setFirst channel when LRCLKIN is resetLeftFirstChannel
Bit 2 Data are sampled on falling edge of
DSTR
Bit 3All the bytes are extractedOnly the first 16 data bits are extractedAllSlot
Figure 7.
LRCLKIN
DSTR
The input data is not delayedDelayMode
Data are sampled on rising edge of
FallingStrobe
DSTR
SIN
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
Transferred dataDiscarded data
BIT 0
BIT 1
BIT 2
BIT 7
BIT 4
BIT 5
BIT 6
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 0
BIT 1
BIT 2
BIT 7
BIT 4
BIT 5
BIT 6
Example 2: Only the first 2 bytes are transferred to the STA310 because the number of slots is 20 (16 + 4). SIN
and LRCLKIN are sampled on the fa lling edge of DSTR. The data is in delayed mode.
The register configuration is SIN_SETUP=3 and CAN_SETUP = DelayMode + LeftFirstChannel + FallingStrobe
+ AllSlot = 1 + 2 + 4 + 8 = 15.
This mode is a specific mode where only the first 16 data bits are transferred. The remaining bits are discarded.
The register configuration is SIN_SETUP = 3 and CAN_SETUP = DelayMode + F allingStrobe = 1 + 4 = 5.
4.4.1.3 SPDIF Input
A true SPDIF Input
SPDIF
(PCM audio samples) or
IEC-61937
(compressed data) is selectable as a main serial
input.
4.4.1.4 Autodetected formats
The STA310 cut 2.0 is able the following audio format changes on the s/pdif input
Table 5. Audi o Format detect i on
BEFORE AFTER
AC3PCM
AC3MPEG
MPEGAC3
MPEGPCM
PCMAC3
PCMMPEG
16/90
STA310
0
00000000000
4.4.1.5 Second Input
A second independent input allows to input bitstreams in serial mode.
This second input can be used, to input audio stream from a microphone, while we decode a data stream trough
the main input.
4.4.2 Data parallel interface
Two ways are available to input data in parallel mode:
- Either through the parallel data bus, shared with the external controller,
- Or through the DATAIN register
4.4.2.1 Using the parallel data bus
In this mode the data must be presented on the 8-bit parallel host data bus D[7..0]. Note that this bus is shared
with the external controller. On the rising clock of DSTR
REQ
is used to signal when the input FIFO is full. When REQ is de-asserted the transfer must be s topped t o
avoid data loss.
After the REQ
is de-asserted, the decoder is still able to accept d ata for a limited nu mber of clock cycles.
The maximum number of data that can be transmitted with respect to the change of REQ
ing formula: Nbits = 23 - 6 * F
The signals DSTR
and DCSB are used to make the distinction between Stream Data (strobed by DSTR) and
Control Data (strobed by DCSB
/33MHz, where: F
DSTR
). To avoid conflicts, the DSTR signal and the DCSB signal must respect given
timing constraints.
the data byte is sampled by the STA310. The signal
is given by the follow-
is the DST R clock frequency, (max is 33 MHz).
DSTR
4.4.2.2 Using the DATAIN register
The data can be input by using the control parallel interface as if accessing any other register.
The signal DCSB
is therefore used. When using this register to input data stream, there is no need to byte-align
the data.
Figure 8.
LRCLKIN
DSTR
SIN
BIT 4
BIT 7
BIT 6
BIT 7
BIT 6
BIT 5
BIT 0
BIT 5
BIT 1
BIT 4
BIT 3
BIT 2
Transferred dataDiscarded data
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
BIT 7
BIT 6
BIT 5
BIT 4
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
BIT 7
BIT 6
BIT 5
BIT 4
BIT 7
17/90
STA310
Figure 9.
LRCLKIN
DSTR
SIN
BIT 4
BIT 7
BIT 6
BIT 7
BIT 6
BIT 5
BIT 0
BIT 5
BIT 1
BIT 4
BIT 3
BIT 2
Tran s fe rr e d da taDisca r de d dat a
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
BIT 7
BIT 6
BIT 5
BIT 4
BIT 7
4.5 Streams parsers
The parsing stage is operated by two parts: the packet parser and the audio parser.
The packet parser unpacks stream, sorts packets and transmit data to the audio parser. The audio parser ver-
ifies the stream syntax, extracts non-audio data and sends audio data to the frame buffer.
Packet parser
Before unpacking packets and transmitting data, the packet parser needs t o detect the pac ket st art by rec ognizing the packet synchronization word. It is possible to force the parser to search for two packet synchronization
words before starting to unpack and transmit.
This is done by setting the register PACKET_LOCK to 1. Otherwise, the packet parser will start handling the
stream once it has detected information matching the packet synchronization word.
The packet parser is also able to perform selective decoding: it can decode audio packets that are matching a
specified Id. This Id is specified in AUDIO_ID and AUDIO_ID_EXt registers, and the function is enabled by setting the AUDIO_ID_EN register.
Audio parser
The audio parser needs to detect the audio synchronization word corresponding to the type of stream that must
be decoded. It is possible to force the audio parser to detect more than one synchronization word before parsing.
This is done by setting the SYNC_LOCK register to a value between 1 and 3 - number of supplementary sync
words to detect before considering to be synchronized.
The status of synchronization of both parsers is provided in the regi ster SYNC_STATUS. Each time the synchronization status of one of the two parsers changes, the interrupt SYN is generated (if enabled) and the status
can be read in SYNC_STATUS.
4.6 Decodi ng modes
4.6.1 AC-3
The STA310 is Dolby Digital certified for class A products. The decoder must be programmed so to specify the
stream format as AC-3 encoded: register DECODESEL = 0.
In the sections below are provided the modes specific to the AC-3 decoding.
4.6.1.1 Compression modes
Four compression modes are provided in the STA310:
18/90
STA310
- Custom A (also named custom 0 in Dolby specifications),
- Custom D (also named custom 1 in Dolby specifications),
- Line mode,
- RF mode.
These modes refer to different implementation of the dialog normalization and dynamic range control features.
The mode is selected by programming the register COMP_MOD to the appropriate value.
Line Mode
In Line Mode (COMP_MOD = 2), the dialog normalization is always enabled. It is done by the decoder itself and
the dialog is reproduced at a constant level.
The dynamic range control variable encoded in the bitstream is used and can be scaled by the two scaling registers HDR (for high-level cut compression) and LDR (for low-level boost compression). In case of 2/0 downmix,
the high-level cut compression is not scalable.
RF Mode
In RF Mode (COMP_MOD=3), the dialog nor malizat ion is always performed by t he decoder. The dial og i s reproduced at a constant level.
The dynamic range control and heavy compression variables encoded in the bitstream are used, but the compression scaling is not allowed. This means that the HDR and LDR registers can not be used in this mode. A
+11dB gain shift is applied on the output channels.
Custom A Mode
In Custom A mode (COMP_MOD=0), the dialog normalization is not performed by the decoder and must be
done by another circuit externally.
The dynamic range control variable encoded in the bitstream is used and can be scaled by the two scaling registers HDR (for high-level cut compression) and LDR (for low-level boost compression).
Custom D Mode
In Custom D mode (COMP_MOD=1), the dialog normalization is performed by the decoder. The dynamic range
control variable encoded in the bitstream is used and can be scaled by the two scaling registers HDR (for highlevel cut compression) and LDR (for low-level boost compression).
4.6.1.2 Karaoke mode
The AC-3 decoder is karaoke aware and capable.
A karaoke bitstream can be composed of 5 channels: L for Left, R for Right, M for guide Melody, V1 for vocal
track 1 and V2 for Vocal track 2.
- When in karaoke aware mode, the channels L,R and M are reproduced, and the channels V1 and V2
are reproduced at a level fixed by the bitstream.
- When in karaoke capable mode , it is possible to choose to reproduce one, two or none of the t wo
incoming vocal tracks, V1 and V2.
The karaoke decoder is activated by the use of KARAMODE register, which specifies the downmix for the different modes. This register replaces DOWNMIX register. It is however possible to consider the incoming
karaoke channels as any other multichannel stream and output it with a downmix specified in DOWNMIX register. For details, refer to the Digital Audio Compression AC-3 ATSC standard, annex C.
19/90
STA310
4.6.1.3 Dual Mode
The Dual Mode corresponds to a mode where two completely independent mono program channels (e.g. bilingual) are encoded in the bitstream, referenced to as channel 1 and channel 2.
The possible ways to output channels on left/right outputs are:
- Output channel 1 on both L/R outputs,
- Output channel 2 on both L/R outputs,
- Mix channels 1 and 2 to monophonic and output on both L/R,
- Output channel 1 on Left output, and channel 2 on Right output.
This channels downmix is specified in the register DUALMODE.
4.6.2 MPEG
The STA310 is able to decode MPEG-1 layerI and layerII encoded data, as well as MPEG-2 layer I, layer II data
without extension (i.e. 2-channel streams).
The MPEG input format should be specified in the DECODE SEL regis ter:
- DECODESEL=1 for MPEG1. The MC bit in MC_OFF register should be set.
- DECODESEL=2 for MPEG2. The MC bit in MC_OFF register should be set.
4.6.3 MP3
The STA310 is able to decoder MPEG2 layer III (MP3) data.
The MP3 input format aboved be specified in the DECODESEL register:
- DECODESEL= 9 for MP3 .
4.6.3.1 Dual Mode
The Dual Mode corresponds to a mode where two completely independent mono program channels (e.g. bilingual) are encoded in the 2-channel incoming bitstream, referenced to as channel 1 and channel 2.
The audio decoder allows to:
- Output channel 1 on both L/R outputs,
- Output channel 2 on both L/R outputs,
- Mix channels 1 and 2 to monophonic and output on both L/R,
- Output channel 1 on Left output, and channel 2 on Right output.
The output configuration is chosen by special downmix for dual mode through register MPEG_DUAL.
20/90
2-Channel PCM/LPCM Data
Figure 12. PCM/LPCM Decoding flow
4.6.3.2 De c od in g flow
4.6.4 PCM/LPCM
The decoder supports PCM (2-channels) and LPCM V ideo (8-channels) and Audio (6-channels) streams. This
4.6.4.1 Downsampling filter
When decoding PCM/LPCM streams encoded at 96kHz, it is possible to use a filter that downsamples the
stream from 96kHz to 48kHz. The chip can not output streams at 96kHz. The register DWSMODE is used to
configure the use of this filter.
is selected by DECODESEL=3.
2-Channel MPEG1/2 Data
Figure 11. MPEG Decoding Flow
6-Channel AC-3 Data
Figure 10. AC-3 Decoding Flow
Data Input Interface
Fifo 256 Bytes
Packet Parser
Frame P arser
Frame Buffer
Downsampling Filter
96kHz -> 48kHz
R
Bass Redirection
Sub
R
Data Input Interface
Fifo 256 Bytes
Packet Parser
Frame Parser
Frame Buffer
MPEG1/2 Decoder
R
L
L
Downmix
Bass Redirection
Sub
L
L
R
R
L
Data Input Interface
Fifo 256 Bytes
Packet Parser
Frame Parser
Frame Buffer
AC-3 Decoder
LFe
Ls
Rs
Downmix
Ls
Rs
Bass Redirection
Ls
Rs
R
C
LFe
R
C
Sub
R
C
L
L
L
21/90
Volume, Balance
Zeros
PCM_OUT2
PCM_OUT1
Sub
Delay
Zeros
PCM_OUT0
L
R
Delay
Delay
Volume , Balanc e
Sub
Delay
Zeros
Zeros
L
R
Delay
Delay
Volume, Balance
Sub
Ls
Rs
Delay
Delay
Delay
Delay
R
C
L
Delay
Delay
STA310
PCM_OUT
PCM_OUT
PCM_OUT
PCM_OU T
PCM_OU T
PCM_OU T
STA310
4.6.5 MLP
MLP is a lossless coding system for us e on digital audio data originally represented as linear PCM. MLP is mandatory in DVD Audio. It allows transmission and storage of up to 6 channels. each up t o 24 bits preci sion and
with sample rates between 44.1 KHz and 192KHz.
- DECODESEL = 8
4.6.6 CDDA
- DECODESEL = 5
4.6.7 Beep Tone
- DECODESEL = 7
4.6.8 Pink noise generator
The pink noise generator can be used to position the speakers i n the listeni ng room so to benefit of the bes t
listening conditions.
The decoder must be programmed so to generate pink noise by writing 4 in the DECODESEL register. The
DOWNMIX register is used to select independently the channels on which the pink noise will be output.
When generating pink noise, the output configuration should be: OCFG=0 and PCM_SCALE=0.
Figure 13. Pink Noise Generator Flow
Pink Noise Generator
Pink
Noise
L
R
C
LFe
Ls
Downmix
Rs
No Bass Redirection:
L
R
C
LFe
ocfg = 0
Ls
Rs
PCM_OUT0
PCM_OUT1
PCM_OUT2
4.7 Post Processing
The following post processing alghorithms are available
4.7.1 Prologic
Pro Logic Compatible Downmix
The STA310 can decode an AC-3 multichannel bitstream and encode it to provide a 2-channel Pro Logic compatible output (Lt, Rt). These 2 channels are the result of a specific downmix referred to as Pro Logic compatible.
This downmix is selected by the register DOWNMIX. The 2 channels can be used as the input of a Pro Logic
decoder and player (e.g. home theatre).
Pro Logic Decoding
The STA310 can decode a 2-channel Pro Logic bitstream. The 2 channels could come from a CD player, an
AC-3 2-channel bitstream or an MPEG 1 bitstream. The 2-channel bitstream can be converted into a 4-channel
output (L, R, C, S). The surround (S) is simultaneously sent on Ls and Rs channels. A Pro Logic downmix en-
22/90
STA310
ables to configure which channels to output on PCM data. This is done through the register PL_DWN.
An auto-balance feature is available and acti vated t hrough PL_AB regist er. The del ay on s urround channel is
configurable thanks to the LSDLY register (while resetting the RSDLY register).
The bass redirection is performed after the Pro Logic decode. The same bass redirection confi guration than
those available in non-Pro Logic modes can be used except that the surround channels will not be added to the
bass redirection. In the c ase of AC-3 or MPEG the STA310 is t herefore c apabl e of first decoding the AC-3 or
MPEG stream then performing the Pro Logic decode.
4.7.2 Others
- Karaoke system
- Bass Management + Volume Control
-Deemphasis
- DC Remove
4.8 How to choose a decoder
To set up the device you have to select two registers.
The first one is DECODESEL for Audio data type,
The second one is STREAMSEL for Transport data type,
The STREAMSE L can be set-up as follows:
0= PES
1= PES DVD Video
2= Packet MPEG1
3= Elementary stream or IEC.60958
4= reserved
5= IEC.61937
6= PES DVD Audio
So the possible configurations on listed in the following table:
Table 6. Possible configurations:
STREAMSELDECODESELMODE
00MPEG2 PES carrying Dolby Digital (ATSC)
01MPEG2 PES carrying MPEG1 frames
02MPEG2 PES carrying MPEG2 frames
10MPEG2 PES carrying Dolby Digital frames for DVD Video
12MPEG2 PES carrying MPEG2 frames for DVD Video
13MPEG2 PES carrying Linear PCM frames for DVD Video
11MPEG1 packet carrying MPEG1 frames
30Dolby Digital frame elementary streams
31MPEG1 frame elementary streams
32MPEG2 frame elementary streams
33Stereo PCM (16bits samples)
34Pink Noise Generator
23/90
STA310
STREAMSELDECODESELMODE
35CDDA frames
37Beep Tone Generator
39MP3 frame elementary streams
50IEC61937 Input with Dolby Digital frames
51IEC61937 Input with MPEG1 frames
52IEC61937 Input with MPEG2 frames
63MPEG2 PES carrying Linear PCM for DVD Audio
68MPEG2 PES carrying MPL for DVD Audio
When playing “Dolby Digital Prologic encoded”, if PL_DOWNMIX is correctly set, Prologic decoder’ is
automatically applied even if the register “PDEC” different to 1.
4.10What Can Be Processed at the Same Time
t
Same Time 1
Decoder
STA310
MPEG1
MP3
AC3
MPEG2
LPCM Video
PCM
MLP
LPCM Audio
Pink Noise
Beep Tone
Same Time 2
Post
Pcrocessing
Prologic
Commands
Mute
Skip frame
Pause
Pause block
Post
Pcrocessing
Karaoke
Channel Delay
Post
Pcrocessing
Bass
Management
Volume Control
Post
Pcrocessing
Karaoke
Channel Delay
S/Pdif Output
PCM (Left,Righ
PCM (VCRs)
Encoded
Mute
Off
Post
Pcrocessing
Karaoke
Channel Delay
5PCM OUTPUT CONFIGURATIONS
5.1 Output configurations
The figure below shows the different configurations supported at PCM output stage. They are selected by the
OCFG register contents.
- In configuration 1, 3 and 4, the main channels are attenuated by 18.5dB, and the LFE by 8.5dB before
summing .
After digital/analog conversion, the subwoofer preamplifier has to compensate for the different gains
of the main channels and subwoofer.
- In configuration 2, the main channels are attenuated by 16dB and the LFE by 6dB before processing.
- In configuration 0, outputs are only scaled and rounded (see next section).
The same configurations will be used in case of a decoded Pro Logic program with the exception that the surround channels will not be added to the bass redirection (the surround channels of a Pro Logic program are
band limited and bass is considered as leakage).
25/90
STA310
Figure 14. PCM Output Configurations
LL
CC
RR
LSLS
RSRS
Not used with Prologic
LL
CC
RR
LSLS
RSRS
-18.5dB
LFELFE
Configuration 0
Not used with Prologic
-16dB
LL
-16dB
CC
-16dB
RR
-16dB
LSLS
-16dB
RSRS
-6dB-4dB
LFE
LFESUB
LL
CC
RR
LSLS
RSRS
LFE
-8,5dB
Configuration 1
Not used with Prologic
-18.5dB
-8,5dB
Configurations 3 and 4Configurat ion 2
Not used in
configuration 4
SUB
5.2 PCM scaling
PCM scaling is needed for every decoding mode (AC3, Pro Logic, MPEG, PCM). It is applied at the end of the
filtering steps before PCM output, allowing maximum effective word width for most of the signal processing before.
Master volume (PCM_SCALE register) and balances (BAL_LR and BAL_SUR registers) are implemented for
PCM scali n g.
5.3 Output quantization
For optimal results for 16/18/20-bit DACs, a quantization with rounding is applied together with the PCM scaling.
The sample value is multiplied by a rounding factor and rounded to 24 bits. The result is then left shifted (4/6/8)
for PCM output.
The output precision is selectable from the 16bits/word to 24 bits/word by configuring the field PREC in the reg-
ister PCMCONF.
5.4 Interface and output formats
The decoded audio data are output in serial PCM format.
The interface consists of the following signals
PCM_OUT0, 1, 2 PCM data, output,
SCLK Bit clock (or serial clock), output,
LRCLK Word clock (or Left/Right channel select clock), output,
PCMCLK PCM clock, input or output (see <CrossRef><BlueHT>Clocks <BlueHT>on page 11 for details).
26/90
STA310
5.4.1 Output precision and format selection
Output precision is selectable from 16 bits/word to 24 bits/word by setting the output precision select, in the PCMCONF (16-, 18-, 20- and 24-bit mode) register.
In 16-bit mode, data may be out put either with the most signifi cant bit first or least si gnificant bi t fi rst. T his is
configured by the contents of the field ORD in the PCMCONF register.
When PCMCONF.PRE C is more than 16 bits, 32 bits are output for each channel. In this configuration, the field
FOR of register PCMCONF is used to select Sony or I²S- compatible format. The field DIF of PCMCONF is used
to position the 18, 20 or 24 bits either at the beginning or at the end of each 32-bit frame.