V PERIPHERAL MODULES 3 (INTERFACE): I2S INTERFACE (I2S)
S1C33E07 TECHNICAL MANUAL
EPSON
V-5-9
V
I2S
V.5.5 Data Output Control
The following shows PCM data output procedure:
1. Set up the I2S and HSDMA conditions as described in the previous section.
2. When HSDMA Ch.0 and Ch.1 cannot be used for I2S, set up the interrupt conditions using the ITC registers
(explained later). When using the I2S interrupt, the cause-of-interrupt flag in the ITC must be cleared before en-
abling the interrupt.
3. Write 1 to the I2SEN (D7/0x301C00) to turn the I2S circuit on.
The I2S circuit starts frequency division of the source clock.
I2SEN: I2S Module Enable Bit in the I2S Control Register (D7/0x301C00)
4. Set the output channel mode using CHMD[1:0] (D[5:4]/0x301C00).
CHMD[1:0]: I2S Output Channel Mode Select Bits in the I2S Control Register (D[5:4]/0x301C00)
Table V.5.5.1 Selecting Output Channel Mode
CHMD0
1
0
1
0
Output channel mode
Mute
Mono (L)
Mono (R)
Stereo
L channel
0
Data output
0
Data output
R channel
0
Data output
CHMD1
1
0
(Default: 0b00 = Stereo)
The output channel mode can be switched even if data is being output. In this case, the mode changes after the
current word output has finished.
5. Write the first PCM word to the FIFO.
When writing a 32-bit data for L and R channels together, perform word write to 0x301C20.
When writing data for each channel individually, write a 16-bit L channel data to 0x301C20 and a 16-bit R
channel data to 0x301C22 using a half-word access instruction.
Note that the newest data of the FIFO are overwritten if two or more words are written to the FIFO before 1 is
written to I2SSTART (D0/0x301C0C).
0x301C20
D31
D0
(L channel data)
(R channel data)
32-bit write
0x301C22
0x301C20
D15
D0
(L channel data)
(R channel data)
16-bit write
Figure V.5.5.1 Writing to FIFO
6. Write 1 to I2SOUTEN (D6/0x301C00) to enable I2S output.
I2SOUTEN: I2S Output Enable Bit in the I2S Control Register (D6/0x301C00)
When I2SOUTEN (D6/0x301C00) = 0, the I2S_MCLK, I2S_WS, and I2S_SDO pins are fixed at 0. The
I2S_SCK pin is fixed at 0 (when BCLKPOL (D2/0x301C00) = 0) or 1 (when BCLKPOL (D2/0x301C00) = 1).
When I2SOUTEN (D6/0x301C00) is set to 1, all output pins enter standby status.
BCLKPOL: I2S Output Bit Clock Polarity Select Bit in the I2S Control register (D2/0x301C00)
7. Write 1 to I2SSTART (D0/0x301C0C) to start output.
I2SSTART: I2S Start/Stop Control Bit in the I2S Start Register (D0/0x301C0C)
The I2S circuit loads one word of data in the FIFO to the shift register and it starts serial output in sync with
the I2S_WS signal. The data in the shift register is shifted at the I2S_SCK clock edge and is output from the L
channel first. When an output of one word has finished, the next data is read out from the FIFO and the same
operation repeats.
When the I2S module has finished outputting the last data in the FIFO, I2SFIFOEF (D0/0x301C14) is set to 1.
I2SFIFOEF: I2S FIFO Empty Flag in the I2S FIFO Status Register (D0/0x301C14)