
V PeRiPheRaL MoDuLes 3 (inteRFaCe): i2s inteRFaCe (i2s)
s1C33L17 teChniCaL ManuaL
ePson
V-4-19
V
I2S
V.4.7 i2s interrupt
The I2S module can generate the following two types of interrupts:
I2S FIFO empty interrupt (CH.0)
I2S FIFO full interrupt (CH.1)
i2s FiFo empty interrupt (Ch.0)
The I2S CH.0 has an embedded FIFO (24 bits
× 2 channels (L & R) × 4) for storing four stereo data to be out-
put. The I2S module can generate interrupts to request the application program to write output data into the
FIFO when it reads the data written into the FIFO to output. The I2S CH.0 provides three interrupt modes with
different interrupt timings: half empty interrupt mode, whole empty interrupt mode, and one empty interrupt
mode. Use I2SINTMD0[1:0] (D[3:2]/pI2S_INT_MOD register) to select an interrupt mode. Furthermore, set
I2SINTEN0 (D0/pI2S_INT_MOD register) to 1 to enable the I2S FIFO empty interrupt.
i2sintMD0[1:0]: I2S CH.0 Interrupt Mode Select Bits in the I2S Interrupt Mode Select (pI2S_INT_MOD)
Register (D[3:2]/0x00301C18)
i2sinten0: I2S CH.0 Interrupt Enable Bit in the I2S Interrupt Mode Select (pI2S_INT_MOD) Register
(D0/0x00301C18)
Table V.4.7.1 Selecting I2S CH.0 Interrupt Mode
i2sintMD0[1:0]
interrupt Mode
0x3
Reserved
0x2
One empty interrupt mode
0x1
Whole empty interrupt mode
0x0
Half empty interrupt mode
(Default: 0x0)
Whole empty interrupt mode
While audio data is being output in this mode, the I2S CH.0 generates an interrupt after all data (four stereo
data) has been read out from the FIFO to transmit. In other words, the FIFO is empty when an interrupt oc-
curs. Therefore, the application program needs to fill the FIFO with four stereo data (24 or 16 bits
× 2 chan-
nels (L & R)
× 4) at once after an interrupt occurs.
half empty interrupt mode (default)
In this mode, the I2S CH.0 generates an interrupt after two stereo data has been read out from the FIFO to
transmit. In this case, the FIFO may be empty or it may still contain one or two data remained (the FIFO
status can be checked using the status bits). The application program needs to fill the FIFO with two stereo
data (24 or 16 bits
× 2 channels (L & R) × 2) at once after an interrupt occurs.
one empty interrupt mode
In this mode, the I2S CH.0 generates an interrupt after one stereo data has been read out from the FIFO to
transmit. In this case, the FIFO may be empty or it may still contain one to three data remained (the FIFO
status can be checked using the status bits). The application program needs to fill the FIFO with one stereo
data (24 or 16 bits
× 2 channels (L & R) × 1) at once after an interrupt occurs.
note: Fill the FIFO with four stereo data (24 or 16 bits × 2 channels (L & R) × 4) at the beginning of
transfer via I2S CH.0 (at the time of start by setting I2SSTART0 to 1) regardless of the interrupt
mode (I2SINTMD0[1:0]).
When filling the FIFO before enabling the interrupt
Write four stereo data to the FIFO, then enable the interrupt. When a FIFO empty interrupt oc-
curs, the interrupt handler routine must write one, two or four stereo data to the FIFO according
to the interrupt mode you set.
When filling the FIFO after enabling the interrupt
The FIFO can also be filled in the interrupt handler routine after enabling the interrupt. Note,
however, that you must fill the FIFO with four stereo data at the first time the interrupt handler
routine is executed. For the second and subsequent interrupts, write one, two or four stereo
data to the FIFO according to the interrupt mode you set.