UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
273 of 362
NXP Semiconductors
UM10208
Chapter 21: LPC2800 DADC
7.
Programming the Dual ADC and SAI4
7.1 Setting up the dual ADC and SAI4
System initialization (reset) code should include the following steps if the Dual ADC and
SAI4 are used in the application:
1. Write the Stream I/O Configuration register with the prescribed/fixed bits. If the DAI is
used for I
2
S input, be sure that the DAI_OE bit is set properly for the DAI mode (see
).
2. Program the CGU to provide 128 times the Nyquist sampling frequency for the Dual
ADC and decimator, and route this to its DADC_CLK and DADC_DCLK outputs. For
example, if audio with sampled at 44.1 kHz is (or will be) present on AINL and AINR,
DADC_CLK and DADC_DCLK should be 5644.8 kHz.
3. If the PGAs are to be active initially, write the DAINCTRL register to set their starting
gain.
4. Write the fixed/specified values to the DADCCTRL register, plus the Dither bits if this
feature is desired.
5. Write the Decimator Control register with the desired initial values, including a 1 in the
ENTIMER bit. ENTIMER disables the Decimator from sending values to SAI4 until its
outputs are valid.
(below) shows the delay as a function of whether the
two DC blocking filters are enabled.
6. Write the SAI4 Interrupt Request register in the interrupt controller (INT_REQ19 -
0x8030 044C) to enable SAI4 interrupts at the desired priority level (see
7. Write the SAI4 Mask register with zero(es) in the desired interrupt condition(s). For
fully interrupt-driven applications, write a 0 in one of the LNMTMK, LHALFMK, or
LFULMK bits. For dedicated DMA, write a 0 to LOVER to allow interrupt for overrun
(which indicates an error in DMA operation or programming). For dynamically-
assigned DMA in Slave mode, write a 0 to LNMTMK.
Since L and R values are always loaded from the decimator into SAI4 together, there is no
reason to enable both L and R interrupts. Of course the corresponding R condition(s) can
be enabled instead of the L condition(s).
7.2 Reading Dual ADC data
Data can be read from the Dual ADC and SAI4 in one of three modes:
1. Fully interrupt-driven. All dual ADC data is handled via interrupts.
2. Dedicated DMA. All dual ADC input data is stored in memory by one or two dedicated
GPDMA channel(s).
Table 311. Startup Timer delays
ENTIMER ENIDCBF ENODCBF Delay (in Nyquist sampling periods 1/fs)
0
X
X
0
1
0
0
44
1
1
0
17066
1
X
1
67473