
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
456 of 808
NXP Semiconductors
UM10360
Chapter 20: LPC17xx I2S interface
•
Data word length is determined by the wordwidth value in the configuration register.
There is a separate wordwidth value for the receive channel and the transmit channel.
–
0: word is considered to contain four 8-bit data words.
–
1: word is considered to contain two 16-bit data words.
–
3: word is considered to contain one 32-bit data word.
•
When the transmit FIFO contains insufficient data the transmit channel will repeat
transmitting the last data until new data is available. This can occur when the
microprocessor or the DMA at some time is unable to provide new data fast enough.
Because of this delay in new data there is a need to fill the gap, which is
accomplished by continuing to transmit the last sample. The data is not muted as this
would produce an noticeable and undesirable effect in the sound.
•
The transmit channel and the receive channel only handle 32-bit aligned words, data
chunks must be clipped or extended to a multiple of 32 bits.
When switching between data width or modes the I
2
S must be reset via the reset bit in the
control register in order to ensure correct synchronization. It is advisable to set the stop bit
also until sufficient data has been written in the transmit FIFO. Note that when stopped
data output is muted.
All data accesses to FIFOs are 32 bits.
shows the possible data
sequences.
A data sample in the FIFO consists of:
•
1
×
32 bits in 8-bit or 16-bit stereo modes.
•
1
×
32 bits in mono modes.
•
2
×
32 bits, first left data, second right data, in 32-bit stereo modes.
Data is read from the transmit FIFO after the falling edge of WS, it will be transferred to
the transmit clock domain after the rising edge of WS. On the next falling edge of WS the
left data will be loaded in the shift register and transmitted and on the following rising edge
of WS the right data is loaded and transmitted.
The receive channel will start receiving data after a change of WS. When word select
becomes low it expects this data to be left data, when WS is high received data is
expected to be right data. Reception will stop when the bit counter has reached the limit
set by wordwidth. On the next change of WS the received data will be stored in the
appropriate hold register. When complete data is available it will be written into the receive
FIFO.
7.
I
2
S operating modes
The clocking and WS usage of the I
2
S interface is configurable. In addition to master and
slave modes, which are independently configurable for the transmitter and the receiver,
several different clock sources are possible, including variations that share the clock
and/or WS between the transmitter and receiver. This last option allows using I
2
S with
fewer pins, typically four.
Many configurations are possible that are not considered useful, the following tables and
figures give details of the configurations that are most likely to be useful.