12APPENDIX A
13APPLICATION INFORMATION
14PACKAGE OUTLINE
15SOLDERING
15.1Introduction
15.2Reflow soldering
15.3Wave soldering
15.4Repairing soldered joints
16DEFINITIONS
17LIFE SUPPORT APPLICATIONS
1997 Aug 122
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
1FEATURES
• Supports real time error detection and correction in
hardware. Error correction to n = 27, error detect to
n = 30 and raw data transfer to n = 32.
• DVD-ROM supported in combination with the SAA7335
• Direct generic interface to external Small Computer
Systems Interface (SCSI) controller devices
• Operates with up to 16 Mbytes DRAM
– Hyper-page DRAM up to 33 Mbytes words/s burst
– Fast-page DRAM at up to 17.5 Mbytes words/s burst
2
• Has fixed n = 1 or n = 2 rate (44.1 or 88.2 kHz) I
multimedia output for simple audio/video output;
features for CAV/quasi-CLV support
– Supports Philips multimedia audio CODEC
– Provides ‘SHOARMA’ Red Book audio buffer
• IEC 958 (SPDIF, AES/EBU and DOBM) output with
Q-W subcode and programmable category code, output
at n = 1 rate
• Device registers are memory mapped for faster direct
access to the chip
• Provides direct access from sub-CPU to buffer RAM to
support scratchpad accesses. This eliminates the need
for extra RAM chips in the system
• Automatic sequencing of ATAPI packet command
protocol, including command termination
• Automated data transfers to and from the host using
PIO, DMA and ultra DMA.
2GENERAL DESCRIPTION
The SAA7381 is a block decoder/encoder and buffer
manager for high-speed CD-ROM/CD-R functions, that
integrates real time error correction and detection and
bidirectional ATAPI transfer functions into a single chip.
2.1Memory mapped control registers
The SAA7381 device has a large number of memory
mapped registers. These are arranged so that high-level
languages see the registers as external byte or 16-bit
integer quantities. The block addressing of the SAA7381
facilitates the use of pairs of 16-bit quantities to represent
addresses.
S-bus
The reading and writing of 16-bit registers within the device
can be performed by two separate 8-bit reads, where the
second byte data is latched at the same time as the first
byte is read.
2.2Error correction features
The SAA7381 has an on-chip 36 kbits memory that is used
as a buffer memory for error and erasure correction
processing. This buffer memory reduces the number of
external RAM accesses that are needed for error
correction and thus allows for an increased rate of data
throughput.
The error corrector is switchable between two-pass,
single-pass [both with Error Detection/Correction
(EDC/ECC)] and EDC only modes to further improve
throughput. The presence of the full error corrector
removes the need for firmware based control of the error
corrector’s operation.
2.3Host interface features
The SAA7381 has an ATAPI host interface that may be
directly connected to the ATAPI bus thereby reducing the
need for external support devices. It supports PIO Mode 4
transfer and Mode 0 ultra DMA. This interface can also be
configured as a generic DMA interface for use with
external host interface devices (e.g. SCSI controller).
The DMA interface has the following features:
• ATAPI command packets are automatically loaded into
the command FIFO
• Data transfer to the host is automatically sequenced to
reduce inter-block latencies and improve host CPU
utilisation
• Host data transfer rate is independent of error corrector
operation and the data input path
• The host interface features automatic determination of
block length for Mode 2, Form 1 and Form 2 sectors.
The block length transferred is programmable.
• The host interface can transfer up to 3 sub-blocks per
sector, with each sub-block being transferred dependent
on the Form bit. Automatic reload of sub-block pointers
and unconditional transfer are supported.
1997 Aug 123
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
2.4Buffer memory organisation
Memory is mapped as a 16-bit block number and 12-bit
offset into that block. The block oriented memory structure
permits the use of 16-bit pointers in software thereby
minimising the overhead of accessing memory.
The address can be found from the following equation:
address = block number × 2560 + offset.
The microcontroller sees the SAA7381 as a memory
mapped peripheral, with control and status registers
appearing in the upper address space.
The lowest 52 kbytes (48 kbytes + 4 kbytes) of the
8051 microcontroller external address space is mapped as
a window into the memory on a user-specified 1 kbyte
boundary within the buffer RAM. This can be used as a
scratchpad memory.
The next 4 kbytes is separately mapped as a window into
the memory on a user-specified 1 kbyte boundary within
the RAM.
The next 7.5 kbytes of the external data space consists of
three independently addressed memory segments for
accessing block data, subcode information and block
headers.
The registers of the SAA7381 are mapped into the top
256 bytes of external data space.
• Subcodes are written into memory together with their
associated sector data.This eases the provision of
specialist features, for example CD + G or Karaoke CD
applications.
• All channels of subcode are de-interleaved
• The Q channel is also Cyclic Redundancy Checked
(CRC) for increased reliability
• When operating in 3-wire subcode mode, it is possible
to control or read the P bit in the P-W subcode stream.
2.6Multimedia output audio control features
2
The I
S-bus input may be processed before feeding to the
multimedia audio output in several simple ways:
• As audio is transferred via the buffer memory, it is not
necessary to have the CD-DSP I2S-bus input at exactly
the audio n = 1 or video n = 2 rate. Any faster speed will
work because the buffer RAM is used as a FIFO.
• Both channels may be independently controlled. The left
channel output may be sourced from zero (digital
silence), left or right input; this also applies for the right
channel output. This permits basic audio switching and
channel swapping.
• IEC 958 (SPDIF, AES/EBU and DOBM) output with
Q-W subcode and programmable category code, can be
output from the same CD-DSP I2S-bus data source.
2.5Subcode handling features
The writing of data into the buffer RAM is aligned to the
absolute time sync marker with the following features:
3QUICK REFERENCE DATA
SYMBOLPARAMETERMIN.TYP.MAX.UNIT
V
DDD(core)
V
DDD(pad)
I
DDD
f
xtal
digital core supply voltage3.03.33.6V
digital peripheral supply voltageV
DDD(core)
5.0 or 3.35.0V
supply currenttbf60tbfmA
crystal frequency88.4672, 11.289,
clock/IEC 958 clock or divided system clock for
CD-DSP
SCK250I/OL/CmultimediaI
WS251I/OL/CI
SDO252OMI
2
S-bus bit clock input/output
2
S-bus word select strobe input/output
2
S-bus data output to DAC/video decoder
GND53−−−ground
CROUT54Ocrystal padcrystal oscillator crystal oscillator output
CRIN55Icrystal padcrystal oscillator/clock input
V
I
DDA
ref
56−−−analog supply voltage
57analogcurrent inputclock generator VCO reference current
POR58ISchmitt triggersystempower-on reset (active LOW)
TEST159ICtestmode control input test pins
TEST260IC
RESET61ISchmitt triggerhostATAPI bus reset input from host (active LOW)
DD762I/OAL/Thostdata bus input/output
DD863I/OAL/T
DD664I/OAL/T
V
DDD(pad1)
65−−−digital peripheral supply voltage 1
DGND666−−−digital ground 6
DD967I/OAL/Thostdata bus pin order of ATAPI interface matches
DD568I/OAL/T
DD1069I/OAL/T
the pinning of the 40-way IDE connector (slew
rate limiting by control of drive capability into
capacitive load of ATA bus)
DD470I/OAL/T
1997 Aug 127
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
SYMBOLPINTYPE
DRIVE/
THRESHOLD
GROUPINGDESCRIPTION
n.c.71 to 74−−−not connected
DD1 175I/OAL/Thostdata bus; pin order of ATAPI interface matches
DD376I/OAL/T
DD1277I/OAL/T
the pinning of the 40-way IDE connector (slew
rate limiting by control of drive capability into
capacitive load of ATA bus)
subcode frame sync for transmitting 3-wire subcode
RCK3-wire subcode clockoutput bit clock for receiving 3-wire subcode; input bit clock for
transmitting 3-wire subcode
SUBIQ and R-W subcode inputconfigurable for 3-wire or Philips V4 subcode mode; can use either
RCK or WSI1 as clock references with appropriate dividers
2
Table 2 I
SYMBOLDESCRIPTIONCOMMENT
MCK256f
SCK2I
WS2I
SDO2I
IECOIEC 958 outputthe IEC 958 output combines multimedia data and Q-W subcode
S-bus multimedia audio output (5 pins)
or 384fs clock for
s
multimedia master
clock/IEC 958 clock or
divided system clock for
Clock reference input pin when interface is in a master mode; a
programmable divider is provided. This pin is also configurable as a
programmable clock output intended as a clock reference for a
CD-DSP. Should be pulled up if not in use.
CD-DSP
2
S-bus bit clockThis is used for master and slave I2S-bus application as both modes
are needed. For instance, the Philips multimedia CODEC is an I2S-bus
slave, hence this must be a master interface. When driving some
DACs, this interface can be a slave.
2
S-bus left/right strobeword select strobe either master or slave
2
S-bus data to DAC/video
I2S-bus multimedia data
decoder
2
Table 3 I
S-bus connections to CD engine (6 pins)
SYMBOLDESCRIPTIONCOMMENT
SCKI1I
2
S-bus bit clockthis is a separate clock to the multimedia bit clock as this rate is
derived from the disc linear velocity
2
WSI1I
SDI1I
C2P0CD C2 error corrector flag
CFLGCD error corrector flags and
S-bus left/right strobe
2
S-bus data from CD-DSP
from ERCO
absolute time sync
these flags are used to indicate errors from second layer correction to
the ERCO
The absolute time sync is used in the CD input process for playing
‘Red Book’ discs; the error corrector status is also read in from this
signal, to provide an indication of C1 and C2 performance for CD-RW
applications.
1997 Aug 1212
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
Table 4 ATAPI target mode interface
ATAPI
NAME
RESETATAPI reset signal: the SAA7381 will not recognize a signal assertion shorter than 20 ns as a valid
reset signal.
DD0 to DD7ATAPI D0 to D7.
DD8 to DD15 ATAPI D8 to D15: these data bits are only used in accesses to the 16-bit data port.
DMARQDMA request: this signal, used for DMA data transfers between host and device, is asserted by the
SAA7381 when it is ready to transfer data to or from the host. The direction of data transfer is
controlled by
DMACKDMA acknowledge: this signal is used by the host in response to DMARQ to initiate DMA transfers.
This signal may be temporarily negated by the host to suspend the DMA transfer in process.
IOCS16ATAPI I/O port is a 16-bit open-drain output: during PIO transfer Modes 0, 1 or 2, IOCS16 indicates to
the host system that the 16-bit data port has been addressed and that the device is prepared to send
or receive a 16-bit data word.
IORDYATAPI I/O ready open-drain output: this signal is negated to extend the host transfer cycle of any host
register access (read or write) when the SAA7381 is not ready to respond to a data transfer request.
This signal is only enabled during DIOR/DIOW cycles to the SAA7381. When IORDY is not active, it is
in the high-impedance (undriven) state.
DA0 to DA2Address bus (device address).
DIOWATAPI write strobe: the rising edge of DIOW latches data from the signals, DD0 to DD7 or
DD0 to DD15 into a register or the data port of the SAA7381. The SAA7381 will not act on the data
until it is latched.
DIORATAPI read strobe: the falling edge ofDIOR enables data from a register or data port ofthe SAA7381
onto the signals, DD0 to DD7 or DD0 to DD15. The rising edge of DIOR latches data at the host and
the host will not act on the data until it is latched.
CS0ATAPI chip select 0 input: this is the chip select signal from the host used to select the ATA command
block registers. This signal is also known as CS1FX.
CS1ATAPI chip select 1 input: this is the chip select signal from the host used to select the ATA control
block registers. This signal is also known as CS3FX.
INTRQATAPI interrupt output: this signal is used to interrupt the host system. INTRQ is asserted only when
the device has a pending interrupt, the device is selected, and the host has cleared the ‘nien’ bit in the
device control register. If the ‘nien’ bit is equal to 1, or the device is not selected, this output is in a
high-impedance state, regardless of the presence or absence of a pending interrupt.
PDIAGATAPI passed diagnostics: this signal shall be asserted by device 1 to indicate to device 0 that it has
completed diagnostics.
DASPATAPI DASP (device active, device 1 present): this is a time-multiplexed signal which indicates that a
device is active, or that device 1 is present. This signal is an open-drain output.
DIOR and DIOW.
ATAPI MEANING
1997 Aug 1213
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
Table 5 Generic host controller interface
ATAPI
NAME
RESETRESETcontroller reset output
DD0 to DD7D0 to D7controller DMA path/controller data and control bus (optional)
DD8 to DD15 D8 to D15controller upper DMA path (optional)
DMARQ
DMACKDMARQDMA request from controller
DA1
DA2
CS0SCSICScontroller chip select output for sub-CPU read/write cycles
Table 6 Miscellaneous pins
SYMBOLDESCRIPTIONCOMMENT
CRINcrystal oscillator/clock input−
CROUTcrystal oscillator output−
I
ref
PORpower-on reset pin−
TEST1 and TEST2mode control test pins−
Table 7 Sub-CPU interface pins
GENERIC
INTERFACE
NAME
DMACKDMA acknowledge to controller
DBWRDMA bus write to controller
DBRDDMA bus read from controller
VCO reference currentclock PLL multiplier
GENERIC HOST CONTROLLER INTERFACE MEANING
SYMBOLDESCRIPTIONCOMMENT
SRSTsub-CPU resetactive HIGH reset if XDD7 is pulled LOW during power-on reset;
active LOW reset if XDD7 is pulled HIGH during power-on reset
INTsub-CPU interrupt request
output from host interface
INT2sub-CPU interrupt output
from the SAA7381 drive
block and UART
SCCLKsub-CPU clock out−
RDsub-CPU read enablesub-CPU read enable strobe; if grounded permanently, the WR
WR/R/Wsub-CPU write enable/
read/write control
ALEdemultiplex enable input for
lower address lines
PSENprogram store enablethis pin should be tied high using a 10 kΩ resistor
SCD0 to SCD7/
SCA0 to SCA7
SCA8 to SCA15sub-CPU address high bits−
sub-CPU data bus
multiplexed/low address bus
open-drain sub-processor interrupt from host interface
open-drain sub-processor interrupt from drive and UART
signal will act as read/write control input
write enable; alternative usage is read/write if RD is held LOW at all
times; WR has priority over RD at all times
while HIGH, the lower address bits are latched from
SCD0 to SCD7; should be used with a Schmitt trigger input to
avoid false latching due to ground bounce on the
8051 microcontroller
−
1997 Aug 1214
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
Table 8 RAM interface pins
SYMBOLDESCRIPTIONCOMMENT
XDA0 to XDA11RAM address bits, multiplexed for DRAMup to 16 Mbytes DRAM only supported
XRASDRAM row address strobe
XCASDRAM column address strobe
XWRRAM write enable
XDD0 to XDD7RAM data bus
Table 9 Basic engine interface
SYMBOLDESCRIPTIONCOMMENT
SYSSYNCbasic engine synchronization inputgenerate interrupts on rising and/or falling edges
COMSYNCbasic engine synchronization inputgenerate interrupts on rising and/or falling edges
COMINreceive data−
COMOUTtransmit data−
COMCLKserial data clock for synchronous mode−
COMACKcommand acknowledge/transmit flow
control
must be HIGH for synchronous mode to transmit next
data byte
7FUNCTIONAL DESCRIPTION
The SAA7381 device consists of a number of main
functional units; a CD engine interface, a multimedia block,
a microcontroller interface, an error detection and
correction block, a host interface and a memory manager.
There are also several smaller blocks including a clock
control block and a UART for communication with the CD
engine. Each block is independently controlled by a
dedicated register set. These registers are memory
mapped to the sub-CPU to allow for faster access.
The external RAM can also be accessed directly from the
microcontroller to support scratchpad accesses and thus
eliminate the need for further memory devices in the
system.
7.1Memory field description
The CD input function of the SAA7381 buffer manager
receives the main data stream in I
CD-DSP, performs sync detection and partitions the data
into blocks.
2
S-bus format from the
It then writes the blocks to the buffer memory and onboard
ERCO RAM. Any detected errors are then corrected and
over written into the buffer memory.
Memory is segmented and addressable by segment
pointers. The segment pointers consist of a block number,
offset pointer and byte number within the block. The data
within each segment is organised in the same manner
(see Table 10).
The arrangement of data within each segment in memory
differs from other Philips devices, because of the different
error correction processing possibilities within the
SAA7381.
Addresses 0 to 2355 are written to memory by the drive
processor when enabled.
1997 Aug 1215
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
Table 10 The memory map of a block in the buffer RAM for standard density mode (see Table 11)
ADDRESS (OFFSET)TYPE OF DATA
0 to 3header field
4 to 2339block data field
2340 to 2351sync field
2352copy of STAT0
2353copy of STAT1
2354copy of STAT2
2355number of C2 flags in sector (compressed format)
2356 to 245196-byte de-interleaved R-W data field
2452 to 246312-byte Q-subcode field
2464 to 2465copy of STAT4 field; only valid if ERCO did run on this block
2466 to 2559user work space
Table 11 Description of Table 10
DATADESCRIPTION
Header fieldThe 4-byte header data consists of a 3-byte block address of absolute time (minutes,
seconds and frame, bytes 0 to 3). The fourth byte is for the mode of data:
Mode 0 = zero mode
Mode 1 = data storage with EDC and ECC
Mode 2 = data storage
Block data fieldin the CD-ROM mode the block data consists of 2048 bytes of user data and 288 bytes of
auxiliary data
User data:
Mode 0= all 2048 bytes in user data are zero
Mode 1= all 2048 bytes are available to the user
Mode 2= all 2048 bytes are available to the user
Auxiliary data:
Mode 0= all 288 bytes in Aux data are zero
Mode 1= the Aux field is in accordance with the EDC and ECC specification
Mode 2= all 288 bytes are available to the user
Sync fieldThe 12-byte sync field is the next segment in memory. All bytes in the sync field are FFH,
except the first and last bytes which are $00.
1997 Aug 1216
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
DATADESCRIPTION
Number of C2 flags in
sector (compressed
format)
96-byte de-interleaved
R-W data field
12-byte Q-subcode fieldAs above: these will not be separated out if the copy2 interleaving option is set to raw.
2 copies of STAT4 fieldAddress 2465 and 2466 are copies of the STAT4 register written by the ERCO when
While storage of C2 flag positions is not possible as a consequence of the architecture of
the SAA7381, a count of the number of flags seen per block is made in a single-byte
counter. This counter packs the possibly 12-bit count into a single byte in the following
way, at the expense of resolution in the count values for large counts.
C2count_val = count (5 down to 0) × [4 ^ count (7 down to 6)], the resolution of the count
is therefore:
C2count_val 0 to 63: counter resolution = 1
C2count_val 64 to 255: counter resolution = 4
C2count_val 256 to 1023: counter resolution = 16
C2count_val 1024 to 4095: counter resolution = 64
Written to memory by the automatic Q-channel copy process (copy2 channel). If the copy
process is not enabled, these fields are not written (see Section 7.3.5). These bytes may
either be R-W de-interleaved or presented as raw Q-W subcode bytes. If the copy2
interleaving mode is set to raw, interleaved copying is still required as the subcode
temporary holding buffer has Q bytes interspersed with the raw R-W.
enabled. This allows the user to determine if the ST AT4 register has been written to by the
ERCO. If seg2465 = seg2466 then STAT4 definitely has not been written by the ERCO.
If seg2465 ≠ seg2466 then STAT4 probably has not been written by the ERCO.
Via direct access to buffer memory, the sub-CPU will be able to look at all of the blocks so
far corrected, to check their status, in a background task.
ERCO failures do not have to be dealt with immediately, as the status of every block
loaded in to RAM is stored with that block, and it is not overwritten until the RAM block is
filled with new data from CD input.
The error corrector will be controlled additionally to permit the use of single pass P-Q or
only EDC operation to allow for greater than n = 14 operation of the ERCO.
The ERCO status will be copied into the RAM along with the data. This is possible
because the RAM now has spare capacity to store the information, as part of the change
from linear to segment/offset addressing.
It is possible to program transfers into RAM of more than one block without processor
intervention. It is also possible to continually loop on the same buffer area of RAM, by not
altering the reload register values when the reload interrupt occurs.
7.1.1DVD-ROM MEMORY FIELD INFORMATION
The buffer arrangement for DVD usage is basically the same (data followed by flags) but the size of the block data differs,
and the ERCO flags are at a different offset, and as the ERCO is not in use, the flags relating to ERCO performance will
not be valid.
1997 Aug 1217
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
7.2CD input control registers
The CD input process is intended to be as automated as possible. Data is read in from the front end, descrambled if in
CD-ROM mode and then written to RAM. The registers that control the address of where the data is written to are in the
memory processor block.
The input data is synchronized, decoded and written to the buffer RAM. The input data format is software programmable.
The synchronization is performed by using a sync detector and a sync interpolator. The sync detector can detect
CD-ROM syncs and syncs from the CFLG pin, for use with Red Book, audio and for DVD. When no sync is found, it is
optionally interpolated.
After decoding, each full sector of data (2352 bytes) comprising sync, header and sub-header is written to the buffer
RAM. The R-W and Q subcode is added by a software-initiated automatic block copy process.
7.2.1R
Table 12 IFCONFIG (write only; address FF10H) (see Table 13)
Table 13 Description of the IFCONFIG register bits
4subsel0both copies of sub-header contribute to STAT1/sh0err to sh3err
3 and 2modulo 1 and
modulo 0
1config swap0the received data from the CD-DSP or drive FIFO is not swapped
0config wclk0the internal ‘irclk’ is not inverted
00oversample, bit clock division ratio = 2
01oversample, bit clock division ratio = 4
10oversample, bit clock division ratio = 8
11bit clock division ratio = 1 (no division)
1first copy only of sub-header contributes to STAT1/sh0err to sh3err
00modulo count 2352
01
10modulo count 2064
11modulo count 2064, but do not count bytes with flag = 1
1the received data from the CD-DSP or drive FIFO is swapped
1the internal ‘irclk’ is inverted
2
S-bus mode
1997 Aug 1218
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
Table 14 CD input control registers (see Table 15)
There are two sets of address registers, one giving the current (DRIVECURSEG) number of the segment being filled and
a segment/block counter. The other set contains the values (DRIVENEXTSEG) to use on completion of the current group
of blocks being filled or emptied (in CD-R). The DRIVEPREVSEG register is loaded with the value of the DRIVECURSEG
register at the end of each CD-ROM block.
The reloading of the registers will trigger an interrupt, if enabled, of the sub-CPU, which will then have to reload the ‘next’
registers. before the transfer requested in the ‘current’ registers are exhausted.
Memory is split into segments, each segment is 2560 bytes. The drive data is written one block at a time at the segment
number pointed to by the DRIVECURSEG register. For the next block the ‘DRIVECURSEG’ is updated as follows.
Table 15 Description of the ‘incen’ and ‘wren’ bits (see Table 14)
BITNAMEVALUEMEANING
(2)
(1)
0hold value of DRIVECURSEG
1increment DRIVECURSEG at the end of each CD-ROM block received
0enable writes of data transferred
1disable write of data transferred
7incen
6wren
Notes
1. If ‘incen’ is logic 1, the ‘DRIVECURSEG’ pointer will increment every sector sync. The ‘DRIVECURCOUNT’ will
decrement every sector sync independent of ‘incen’. If ‘incen’ is logic 0 then the pointer will remain fixed pointing at
the same segment of RAM. If the reading of data from CD is enabled by the ‘wrreq’ bit in the CTRL0 register, and
the ‘wren’ bit is logic 0 the segment will be repeatedly filled by the data coming in from the CD-ROM.
2. If ‘wren’ is logic 1 and ‘incen’ is logic 1 then the DRIVECURSEG register will increment with each sync time and the
DRIVECURCOUNT register will decrement but data will not be written to external RAM. This allows the triggering of
the reading of data or the writing of data some time in the future.
Table 16 Control and status registers (see Tables 17, 18 and 19)
FF00HHEAD0minutes
FF01HHEAD1seconds
FF02HHEAD2frames
FF03HHEAD3mode
FF04HSUBHEAD0file number
FF05HSUBHEAD1channel number
FF06HSUBHEAD2submode
FF07HSUBHEAD3coding Information
FF08HSTAT0−ilsyncnosynlblk−sblkerablk−
1XXXpacket written CD-R, run in/run out, link, XXX is mode
1111mode = 7 or error in mode byte
Note
1. rmod3 = bit 7 #, bit 6 #, bit 5 #, bit 4 #, bit 3 # C2P0 (where # is logic OR). This is non-zero for packet written CD-R.
rmod2 = bit 2 # C2P0 (where C2P0 is C2 flag for mode byte).
rmod1 = bit 1 # C2P0 (where C2P0 is C2 flag for mode byte).
rmod0 = bit 0 # C2P0 (where C2P0 is C2 flag for mode byte).
(1)
MEANING
Table 27 Description of the STAT3 register bit
BITNAMEVALUEDESCRIPTION
7valst0registers associated with decoder interrupt valid
1registers invalid
Table 28 Description of the STAT4 register bits (this register contains the interrupt status on reading)
The auxiliary segment pointer points at a group of
segments which hold the data FIFOs used in the
SAA7381. These are the ‘large’ FIFOs rather than the
small resynchronizing FIFOs inside the SAA7381.
The subcode input/output and n = 1 I2S-bus interfaces use
these FIFOs (in addition, the shadow debug registers can
use some of this space).
The FIFOs are arranged to optimally occupy a contiguous
group of segments in the external RAM.
7.3Multimedia output interface
This block deals with subcode input and output in addition
to an audio output which is independent of the I
2
S-bus
input output path connected to the CD-R engine.
Q and R-W subcode features:
• Subcode sync is aligned with the start of the current
block in RAM
• Supports subcode resynchronization when subcode
sync is lost
• Supports Philips ‘V4’ and 3-wire formats
• Has selectable polarity on RCK
• Uses WSI1 pin as timing reference
• Supports regeneration of subcode from IEC 958 output
using WS2 as timing reference
• Can accept subcode input while I2S-bus from CD-DSP
is oversampled audio at n = 2 or n = 4 oversample
Audio output (multimedia) features:
• Has data output for simple audio or digital video for
n = 1 or n = 2 rate regardless of input CD-DSP data rate
• 4096-byte FIFO for audio samples, requires firmware
polling for refills using the block copy engine
• Permits CAV and quasi-CLV systems to maintain n = 1
audio output
• Basic channel swap, mono-L or mono-R modes,
includes muting and L + R summed mono
• IEC 958 output with subcode Q-W for use in CAV and
other modes where there is no n = 1 clock in the
CD-DSP subsystem
– IEC 958 interface has fully programmable category
code and copyright bits for flexibility
– Subcode on IEC 958 is only available in CD-ROM
mode, because the subcode output FIFO is shared.
2
• Master and slave I
S-bus modes are available
– IEC 958 is only available when the I2S-bus is in the
master mode.
• Can be configured to provide a clock for an external
CD-DSP function via the MCK pin
• Can operate in 64fs or 48fs I2S-bus modes
• IEC 958 can operate at n = 2 although not permitted by
standard.
7.3.1S
UBCODE INPUT BLOCK
7.3.1.1Q-W subcode handling
The subcode data is initially converted from
serial-to-parallel format and is then handled as Q-W bytes.
The de-interleaving is performed by a de-interleaving
block copy mode in the memory processor’s block copy
engine. Subcode blocks will always be aligned with a block
of CD-ROM data, although the subcode Minutes,
Seconds, Frames (MSF) absolute time may have an
uncertainty of ±5 frames in terms of the actual CD-ROM
block it is referring to. This offset is unknown but consistent
in any given application. The block copy engine will be
automatically triggered when the subcode synchronization
is found.
The error corrector will then compute the CRC syndrome
of the subcode and deposit it in the CRC bytes.
The sub-CPU will have to perform the actual correction if a
non-zero syndrome appears.
This syndrome, if calculated during encoding by the
ERCO, can be used as the CRC written to disc for the
subcode.
1997 Aug 1224
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
7.3.1.2Description of subcode interface
The subcode interface allows the reception and transmission of subcodes. The subcodes will be received/transmitted to
two on-chip 512-byte FIFOs, one for transmit and one for receive. No interrupts are associated with these FIFOs as the
block copy engine removes data or fills these as necessary.
There is, however, an interrupt which is asserted when a sync is found in an unexpected location.
7.3.2S
Table 30 Subcode mode transmit control register (SUBMODETX; address FF13H); see Table 31
Table 31 Description of the SUBMODETX register bits
Note
1. Philips V4 subcode transmit mode must be selected for correct insertion of subcode into the IEC 958 data stream.
Table 32 Subcode mode receive control register (SUBMODERX, address FF17H); see Table 33
UBCODE MODE TRANSMIT CONTROL REGISTER
BIT 7BIT 6BIT 5BIT 4BIT 3BIT 2BIT 1BIT 0
−−−pbit−txena−V4
BITNAMEVALUEDESCRIPTION
4pbit0P bit logic 1 in 3-wire mode (default)
1P bit logic 0 in 3-wire mode
2txena0subcode transmit interface is disabled
1subcode transmit interface is enabled
0V40Philips SRI 3-wire subcode
1Philips V4 mode; note 1
BIT 7BIT 6BIT 5BIT 4BIT 3BIT 2BIT 1BIT 0
−−−wsdiv1wsdiv0rxenarckinvrxrxsubqw
Table 33 Description of the SUBMODERX register bits
The subcode is buffered in the AUXSEGMENT register. Two offset pointers, SUBPOINTR-L and SUBPOINTR-H, and
SUBPOINTW-L and SUBPOINTW-H are associated with it. The R pointer is for the subcode output and the W pointer
for the subcode input.
Pointers are also provided to point at the offset into the AUXSEGMENT register where the start of a subcode frame will
be found, SUBBASEPOINTR-L and SUBBASEPOINTR-H and SUBBASEPOINTW-L and SUBBASEPOINTW-H. The
block copy engine is expected to use these to automatically move the subcode into the segment pointed at by
DRIVECURSEG register.
7.3.3G
ENERAL DESCRIPTION OF THE MULTIMEDIA OUTPUT INTERFACE
7.3.3.1Basic description of the multimedia output interface
The multimedia data output may be used either with an internal clock or an externally provided clock. The clock used
should be a correct multiple of 44100 Hz in order for the block to correctly output IEC 958.
The multimedia interface data FIFO is located in the block of segments associated with AUXSEGMENT master/slave
mode operation (see Fig.3).
handbook, full pagewidth
e.g. DAC
SAA7381
SCK
WS
SDO2
slave: master = 0
e.g. DAC
SCK
WS
SDO2
master: master = 1
Fig.3 Master/slave mode operation.
Table 36 Description of the MMCTRL register bits
BITNAMEVALUEDESCRIPTION
7mmdiv−see Table 37
6−
5−
4−
3spdx20I
1I
2wslen0I
1I
2
S-bus output is single speed
2
S-bus (and IEC 958) output is double speed; video applications
2
S-bus bit clock is 64 times the sample rate
2
S-bus bit clock is 48 times the sample rate
1 and 0mcksel00multimedia internal clock is CRIN pin
01multimedia internal clock is MCK pin
10multimedia internal clock is system clock
SAA7381
MGL179
1997 Aug 1227
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
Table 37 mmdiv/mcksel relationship to clocks needed for I2S-bus and IEC 958
1. For these combinations the duty factor of the output SCK2 clock is not necessarily 50%. These combinations are
therefore not recommended.
2. This is illegal but possible.
Table 38 Description of the MMAUD register control bits
BITNAMEVALUEDESCRIPTION
7daen
(1)
0CD-DA interface is off
1CD-DA Interface is on
2
6eiaj0I
S-bus serial mode
1EIAJ16 serial mode
5master0I
1I
3leftmode00I
01I
210I
2
S-bus is slave
2
S-bus is master
2
S-bus left channel output is left (default)
2
S-bus left channel output is right
2
S-bus left channel output is muted
11reserved
2
1rightmode00I
S-bus right channel output is right (default). This is the opposite default to
left channel.
01I
010I
2
S-bus right channel output is left
2
S-bus right channel output is muted
11reserved
Note
1. If enabled, data is written to the CDDA interface from a FIFO located in the CDDA register space. If either ‘daen’ = 1
or ‘iecen’ = 1 (ieccrtl), the interface will become active.
1997 Aug 1228
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
7.3.4IEC 958/EBU OUTPUT
Table 39 Description of the IECCTRL register control bits (notes 1 and 2)
BITNAMEVALUEDESCRIPTION
7iecen0IEC 958 interface is off
1IEC 958 Interface is on
6data0IEC 958 contains audio information
1IEC 958 contains data
5copyright0IEC 958 C bit in system channel is logic 0
1IEC 958 C bit in system channel is logic 1
4preem0audio pre-emphasis off/IEC 958 contains data
1audio pre-emphasis on (only appears in IEC 958 C channel;
de-emphasis bit is not implemented in the SAA7381)
3vbit0audio samples suitable for conversion
1mute audio, or signal is data and should not be digital-to-analog
converted at any time
2−−reserved
−reserved
1 to 0accu00level II clock accuracy
01level III clock accuracy (depends on mck/system clock)
10reserved
11reserved
Notes
1. In order for the IEC interface to operate correctly, it will require a clock at 128fs to be present.
2. The ‘vbit’ is copied into the V bit of the IEC 958 frame.
Table 40 IEC 958 system channel bit mapping (note 1)
1. The C bit is updated on an IEC frame-by-frame basis, the bit offset corresponds to the IEC frame offset. They are
repeated for both left and right channels. Bit 0 is present in the C bit of the first sample pair of the IEC superframe of
192 sample pairs.
BIT OFFSET
1997 Aug 1229
Philips SemiconductorsObjective specification
ATAPI CD-R block decoderSAA7381
Table 41 Description of the MCK_CON register bits (note 1)
BITNAMEVALUEDESCRIPTION
3mckxtal0MCK reference is system clock (default)
1MCK reference is the CRIN pin
2mckoe0MCK pin is 3-state, an input to the MM block (default)
1MCK pin is output
1 and 0div00MCK reference is divided by 2 (default)
01MCK reference is divided by 1.5
10MCK reference is divided by 1
11MCK reference is divided by 4
Note
1. The bits in this register control the use of the MCK pin as an output to clock a CD-DSP. The division ratios chosen
are suitable for the SAA7335 or CDR60 devices. If the MCK pin is not being used then it should be pulled HIGH for
correct selection of the internal multimedia clocks.
7.3.5MEMORY-TO-MEMORY BLOCK COPY FUNCTION
This function is provided for the user to move and copy
blocks of RAM. Two pointer sets are provided. The second
of these is for the semi-automatic subcode copying
function of the subcode in the block. It is independent of
the first copy register set, which is available for e.g. audio
copying needed in the PLAY AUDIO function with the
SAA7381, and for subcode copying when recording.
When started, the copy process will copy the
COPYCOUNT register bytes from the ‘FROM’ pointers to
the ‘TO’ pointers. A copying process may be stopped
during its operation by writing to the ‘copyend’ bit.
7.3.5.1Automatic copying of received
subcode-to-data block
When enabled, the newly received subcode will be
automatically transferred to the current host segment in
RAM.
The only register that is user programmable in the subcode
copying engine is the COPYFROM2OFFSET pointer.
The ‘COPYFROM2OFFSET’ pointer is set up by the
sub-CPU to point into the subcode input FIFO. It points at
the first byte of subcode to be copied into the current host
data block. Once triggered, this copy is automatically
set-up to correctly transfer the next block of subcode
correctly without host intervention.
Copying of the subcode in the opposite direction is
performed by the sub-CPU commanding an interleaved
copy of data using the user block copy registers. This does
not have to be as fast for subcode output to the user
channel of the IEC 958 output as this is only specified to
n = 1 rate.
1997 Aug 1230
Loading...
+ 78 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.