UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
258 of 362
NXP Semiconductors
UM10208
Chapter 19: LPC2800 DAI
6.3 Data transfer via DMA channel(s)
One GP DMA channel can service the DAI and SAI1 in the following cases:
•
16-bit values from both channels are to be stored in the same buffer. In this case write
the address of the LR32IN1 register to the DMA channel’s Source Address register,
program the channel to transfer words, and enable LOVER for interrupt in the SAI1
Mask register.
•
16-bit values from only one channel are to be stored. In this case, if the SAI’s DMA
request is based on the FIFO being half-full, write the address of the L32IN1 or
R32IN1 register to the DMA channel’s Source Address register, and program the
channel to transfer words. If the SAI’s DMA request is based on the FIFO being
not-empty, write the address of the L16IN1 or R16IN1 register to the DMA channel’s
Source Address register, program the channel to transfer halfwords, and enable
LOVER or ROVER for interrupt in the SAI1 Mask register.
•
Values wider than 16 bits for only one channel are to be stored. In this case, write the
address of the L24IN1 or R24IN1 register to the DMA channel’s Source Address
register, program the channel to transfer words, and enable LOVER or ROVER for
interrupt in the SAI1 Mask register.
Two GP DMA channels are needed if values from both channels are to be stored, and
either:
•
Values wider than 16 bits must be stored. In this case the values must be stored in
separate buffers for the L and R channels. Write the address of the L24IN1 register to
the Source Address register of one DMA channel, and the address of the R24IN1
register to the other channel’s Source Address register, and program both channels to
transfer words.
•
16-bit values must be stored in separate buffers. If the SAI’s DMA request is based on
the FIFO being half-full, write the address of the L32IN1 register to the Source
Address register of one DMA channel, and the address of the R32IN1 register to the
other channel’s Source Address register, and program both channels to transfer
words. If the SAI’s DMA request is based on the FIFO being not-empty, write the
address of the L16IN1 register to the Source Address register of one DMA channel,
and the address of the R16IN1 register to the other channel’s Source Address
register, and program both channels to transfer halfwords.
Whenever two DMA channels are used with the DAI and SAI1, enable both LOVER and
ROVER for interrupt in the SAI1 Mask register.
6.4 Dynamic DMA channel assignment
If GP DMA channels can be dedicated to the DAI and SAI1, they can be configured (as
described in the previous section) by system initialization code.
Otherwise, DMA channels can be selected and configured (as described in the previous
section) when the need for I
2
S input arises. In Slave mode this can be determined by an
SAI1 interrupt when the DAI detects activity on the BCKI and WSI pins. In Master mode,
the application must determine when I
2
S input is needed.
Before software searches the DMA channels for an inactive channel, it should disable all
interrupts that might lead to a similar search, then program the DMA channel, then
re-enable the interrupts it disabled.