TM1100 Preliminary Data Book
Philips Semiconductors
8-4
PRELIMINARY INFORMATION
File: ain.fm5, modified 7/24/99
sequent bits are assigned, in order, to decreasing bit po-
sitions in the LEFT data word, up to and including
LEFT[SSPOS]. Bits LEFT[SSPOS–1:0] are cleared.
Hence, in MSB-first mode, an arbitrary number of bits are
captured. They are left-adjusted in the 16-bit parallel out-
put of the converter.
In LSB-first mode, the serial to parallel converter assigns
the value of the bit at LEFTPOS to LEFT[SSPOS]. Sub-
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.
how the Audio In unit MMIO registers are set to collect 16
bits samples using the Philips SAA7366 I2S 18-bit A/D
converter. The setup assumes the SAA7366 acts as the
serial master.
For the sake of example, if it were desired to use only the
12 MSBs of the A/D converter in
Figure 8-3, use the set-
tings of
Table 8-5 with SSPOS set to four. This results in
LEFT[15:4] being set with data bits 0..11, and LEFT[3:0]
being set equal to zero. RIGHT[15:4] is set with data bits
32..43 and RIGHT[3:0] is set to zero.
8.7
MEMORY DATA FORMATS
The Audio In unit autonomously writes samples to mem-
ory in mono and stereo 8 and 16 bits per sample formats,
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
for details on byte ordering conventions.
The Audio In unit hardware implements a double buffer-
ing scheme to ensure that no samples are lost, even if
the DSPCPU is highly loaded and slow to respond to in-
terrupts. The DSPCPU software assigns buffers by writ-
ing a base address and size to the MMIO control fields
hardware/software synchronization.
In eight-bit capture modes, the eight MSBs of the serial
parallel converter output data are written to memory. In
16-bit capture modes, all bits of the parallel data are writ-
ten to memory. If SIGN_CONVERT is set to one, the
MSB of the data is inverted, which is equivalent to trans-
lating from two’s complement to offset binary represen-
tation. This allows the use of an external two’s comple-
ment 16-bit A/D converter to generate eight-bit unsigned
samples, which is often used in PC audio.
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)
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
Table 8-6. Audio In MMIO DMA Control Fields
Field Name
Description
LITTLE_ENDIAN
0
capture in big endian memory format
(RESET default)
1
capture little endian
BASE1
Base Address of buffer1. This must be a
64-byte aligned address in local SDRAM.
RESET default 0.
BASE2
Base Address of buffer2. This must be a
64-byte aligned address in local SDRAM.
RESET default 0.
SIZE
Number of samples to be placed in
buffer before switching to other buffer.
In stereo modes, a pair of 8- or 16-bit
data counts as 1 sample. In mono
modes, a single value counts as a sam-
ple.
RESET default 0.