21 I
2
S
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
21-11
I
21.6
2
S Interrupt and DMA
This section describes the I
2
S interrupts and invoking DMA.
For more information on interrupt processing and DMA transfer, see the “Interrupt Controller (ITC)” chapter and
the “DMA Controller (DMAC)” chapter, respectively.
Interrupts
21.6.1
The I
2
S module includes a function for generating the following three different types of interrupts.
• I
2
S FIFO whole empty interrupt
• I
2
S FIFO half empty interrupt
• I
2
S FIFO one empty interrupt
The I
2
S module outputs one interrupt signal shared by the three above interrupt causes to the interrupt controller
(ITC). Select an interrupt mode and set the interrupt enable bit to 1 using the I2S_INT register to generate the cor-
responding interrupt.
I
2
S FIFO whole empty interrupt
To use this interrupt, set WEIE/I2S_INT register to 1. If WEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
When all data (four stereo data) has been read from the FIFO to output, the I
2
S module sets WEIF/I2S_INT
register to 1, indicating that the FIFO is empty. If whole empty interrupts are enabled (WEIE = 1), an interrupt
request is sent simultaneously to the ITC. An interrupt occurs if other interrupt conditions are met. If WEIF is
1, the application program should fill the FIFO with four stereo data (16 bits
×
2 channels (L & R)
×
4). When
writing each group of audio data using a 16-bit memory access instruction, first fill L-channel data, then fill
R-channel data. When a 32-bit memory access instruction is used, fill L-channel data (16-bit low order) and R-
channel data (16-bit high order) to the FIFO simultaneously.
I
2
S FIFO half empty interrupt
To use this interrupt, set HEIE/I2S_INT register to 1. If HEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
When a free space for two stereo data becomes available in the FIFO, the I
2
S module sets HEIF/I2S_INT regis-
ter to 1. If half empty interrupts are enabled (HEIE = 1), an interrupt request is sent simultaneously to the ITC.
An interrupt occurs if other interrupt conditions are met. If HEIF is 1, the application program should fill the
FIFO with two stereo data (16 bits
×
2 channels (L & R)
×
2). When writing each group of audio data using
a 16-bit memory access instruction, first fill L-channel data, then fill R-channel data. When a 32-bit memory
access instruction is used, fill L-channel data (16-bit low order) and R-channel data (16-bit high order) to the
FIFO simultaneously.
I
2
S FIFO one empty interrupt
To use this interrupt, set OEIE/I2S_INT register to 1. If OEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
When a free space for one stereo data becomes available in the FIFO, the I
2
S module sets OEIF/I2S_INT regis-
ter to 1. If one empty interrupts are enabled (OEIE = 1), an interrupt request is sent simultaneously to the ITC.
An interrupt occurs if other interrupt conditions are met. If OEIF is 1, the application program should fill the
FIFO with one stereo data (16 bits
×
2 channels (L & R)
×
1). When writing audio data using a 16-bit memory
access instruction, first fill L-channel data, then fill R-channel data. When a 32-bit memory access instruction is
used, fill L-channel data (16-bit low order) and R-channel data (16-bit high order) to the FIFO simultaneously.
For more information on interrupt processing, see the “Interrupt Controller (ITC)” chapter.
Note: At the beginning of I
2
S transfer (by setting I2SSTART to 1), the FIFO is absolutely empty. So the
I
2
S module continues the initial status until the FIFO becomes full with four stereo data (16 bits
×
2 channels (L & R)
×
4).
The interrupt handler should write one, two or four stereo data to the FIFO according to the inter-
rupt mode selected.