
TM1300 Data Book
Philips Semiconductors
8-4
PRODUCT SPECIFICATION
sequent bits are assigned, in order, to increasing bit po-
sitions in the LEFT data word, up to and including
LEFT[15]. Bits LEFT[SSPOS–1:0] are cleared. Hence, in
LSB-first mode, an arbitrary number of bits are captured.
They are returned left-adjusted in the 16-bit parallel out-
put of the converter.
Refer to Figure 8-3 and Table 8-5 to see an example of
how the AI unit MMIO registers are set to collect 16-bit
samples using the Philips SAA7366 I2S 18-bit A/D con-
verter. This setup assumes the SAA7366 acts as the se-
rial master.
For example, if it were desirable to use only the 12 MSBs
of the A/D converter in Figure 8-3, use the settings of
Table 8-5 with SSPOS set to ‘4’. This results in
LEFT[15:4] being set with data bits 0..11, and LEFT[3:0]
being set to ’0’. RIGHT[15:4] is set with data bits 32..43
and RIGHT[3:0] is set to ’0’.
8.6
MEMORY DATA FORMATS
The AI unit autonomously writes samples to memory in
mono and stereo 8- and 16-bits per sample formats, as
shown in Figure 8-4. Successive samples are always
stored at increasing memory address locations. The set-
ting of the LITTLE_ENDIAN bit in the AI_CTL register de-
termines how increasing memory addresses map to byte
positions within words. Refer to Appendix C, “Endian-ness,”
for details on byte ordering conventions.
The AI hardware implements a double buffering scheme
to ensure that no samples are lost, even if the DSPCPU
is highly loaded and slow to respond to interrupts. The
DSPCPU software assigns buffers by writing a base ad-
dress and size to the MMIO control fields described in
Table 8-6. Refer to Section 8.7 for details on hardware/
software synchronization.
In 8-bit capture modes, the eight MSBs of the serial par-
allel converter output data are written to memory. In 16-
bit capture modes, all bits of the parallel data are written
to memory. If SIGN_CONVERT is set to ’1’, the MSB of
the data is inverted, which is equivalent to translating
from two’s complement to offset binary representation.
This allows the use of an external two’s complement 16-
bit A/D converter to generate 8-bit unsigned samples,
which is often used in PC audio.
Table 8-5. Example setup for SAA7366
Field
Value
Explanation
SER_MASTER
0
SAA7366 is serial master
FREQUENCY
161628209
256fs 44.1 kHz
SCKDIV
3
AI_SCK set to AI_OSCLK/4
(not needed since
SER_MASTER=0)
WSDIV
63
Serial frame length of 64 bits
(not needed since
SER_MASTER=0)
POLARITY
0
Frame starts with neg. AI_WS
FRAMEMODE
00
Take a sample each ser. frame
VALIDPOS
n/a
Don’t care
LEFTPOS
0
Bit position 0 is MSB of left
channel and will go to
LEFT[15]
RIGHTPOS
32
Bit position 32 is MSB of right
channel and will go to
RIGHT[15]
DATAMODE
0
MSB rst
SSPOS
0
Stop with LEFT/RIGHT[0]
CLOCK_EDGE
0
Sample WS and SD on posi-
tive SCK edges for I2S
Figure 8-3. Serial frame of the SAA7366 18 bit I2S A/D converter (format 2 SWS).
1
63
62
52
51
50
34
33
32
31
19
18
AI_SCK
AI_WS
AI_SD
leftn(18)
3
2
1
0
rightn(18)
0
leftn+1(18)
Figure 8-4. AI memory DMA formats.
adr
leftn
adr+1
leftn+1
adr+2
leftn+2
adr+3
leftn+3
adr+4
leftn+4
adr+5
leftn+5
adr+6
leftn+6
adr+7
leftn+7
8-bit
mono
adr
leftn
adr+1
rightn
adr+2
leftn+1
adr+3
rightn+1
adr+4
leftn+2
adr+5
rightn+2
adr+6
leftn+3
adr+7
rightn+3
8-bit
stereo
16-bit
mono
leftn
adr
leftn+1
adr+2
leftn+2
adr+4
leftn+3
adr+6
16-bit
stereo
leftn
adr
rightn
adr+2
leftn+1
adr+4
rightn+1
adr+6