21 I
2
S
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
21-7
4. Set I2SOUTEN/I2S_CTL register.
Write 1 to I2SOUTEN to enable I
2
S output. When I2SOUTEN is set to 1, all the output pins enter standby sta-
tus.
Write 0 to I2SOUTEN to disable I
2
S output. When I2SOUTEN is set to 0, the I2S_MCLK pin still keeps stand-
by status, the I2S_WS pin is fixed at 0. The I2S_SDO pin is left unchanged. The I2S_SCLK pin is fixed at 0 (when
BCLKPOL/I2S_CTL register = 0) or 1 (when BCLKPOL = 1).
I2SOUTEN can be altered even if data is being output. This enables the I
2
S module to pause or resume shifting
data (data output).
5. Write 1 to I2SSTART/I2S_START register to start output.
When I2SSTART is set to 1, the I
2
S module issues an interrupt or DMA request. However, the I
2
S module idles
until the FIFO becomes full (16 bits
×
2 channels (L & R)
×
4) according to the interrupt mode or DMA mode (as
described in Step 6 below and Section 21.6), then loads data (L & R) in the FIFO to the shift register and starts
serial output in sync with the I2S_WS signal.
The data in the shift register is shifted at the I2S_SCLK clock edge and is output from the L channel first. When
an output of one data (L & R) has finished, the next data is read out from the FIFO and the same operation re-
peats.
When the number of data according to the interrupt conditions has been read out from the FIFO, an interrupt or
DMA request is generated.
When half empty interrupts are enabled, the I
2
S module generates an interrupt after two stereo data has been
read out from the FIFO. In this case, write the next two stereo data (16 bits
×
2 channels (L & R)
×
2) to the
FIFO in the interrupt handler.
When whole empty interrupts are enabled, the I
2
S module generates an interrupt after all data (four stereo data)
has been read out from the FIFO. In this case, write the next four stereo data (16 bits
×
2 channels (L & R)
×
4)
to the FIFO in the interrupt handler.
When one empty interrupts are enabled, the I
2
S module generates an interrupt after one stereo data has been
read out from the FIFO. In this case, write the next one stereo data (16 bits
×
2 channels (L & R)
×
1) to the
FIFO in the interrupt handler. This one empty interrupt cause can also be used to invoke a DMA transfer.
6. Write audio data to the FIFO.
There are two ways to write data.
6.1) Using interrupts
The I
2
S module includes three different types of interrupts.
• I
2
S FIFO half empty interrupt
When the half empty interrupt is enabled, the I
2
S module generates an interrupt after two stereo data has
been read out from the FIFO. However, the I
2
S module continues shifting out the remaining buffer data un-
til the FIFO becomes absolutely empty.
We suggest filling the FIFO with two groups of stereo data (16 bits
×
2 channels (L & R)
×
2) at once in the
half empty interrupt handler.
Note: If the handler fills the FIFO with more than two groups of data, it may overwrite the remaining
data in the FIFO. If the handler fills the FIFO with one group of data, a half empty interrupt will be
issued again after one remaining data is sent to the shift register. Therefore, the FIFO should be
filled with two groups of data in the half empty interrupt handler.
• I
2
S FIFO whole empty interrupt
When the whole empty interrupt is enabled, the I
2
S module generates an interrupt after all data (four stereo
data) has been read out from the FIFO. In this case, the FIFO becomes absolutely empty. If the I
2
S module
sends the current data completely and the FIFO is still empty, it stops shifting out FIFO data until the FIFO
becomes full again.
Be sure to write four stereo data (16 bits
×
2 channels (L & R)
×
4) to the FIFO at once in the whole empty
interrupt handler, otherwise the I
2
S module continues idle status.