
UM10850
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 2.4 — 13 September 2016
392 of 464
NXP Semiconductors
UM10850
Chapter 25: LPC5410x 12-bit ADC controller (ADC0)
25.8.2 Perform a sequence of conversions triggered by an external pin
The ADC can perform conversions on a sequence of selected channels. Each individual
conversion of the sequence (single-step) or the entire sequence can be triggered by
hardware. Hardware triggers are either a signal from an external pin or an internal signal.
See
.
To perform a single-step conversion on the first four channels of ADC0 triggered by rising
edges on pin PIO1_0, follow these steps:
1. Enable the analog function on pin ADC0_0 to ADC0_3 via IOCON. See
and
2. Configure PINT1 to respond to PIO1_0, see
for details.
3. Configure the system clock to be 80 MHz and select a CLKDIV value of 0 for a
sampling rate of 80 MHz using the ADC CTRL register.
4. Select the synchronous mode in the CTRL register.
5. Select ADC channels 0 to 3 to perform the conversion by setting the CHANNELS bits
to 0xF in the SEQA_CTRL register.
6. Select trigger PINT1 by writing 0x1 the TRIGGER bits in the SEQA_CTRL register.
7. To generate one interrupt at the end of the entire sequence, set the MODE bit to 1 in
the SEQA_CTRL register.
8. Select single-step mode by setting the SINGLESTEP bit in the SEQA_CTRL register
to 1.
9. Enable the Sequence A by setting the SEQA_ENA bit.
A conversion on ADC0 channel 0 will be triggered whenever the pin PIO1_0 goes
from LOW to HIGH. The conversion on the next channel (initially channel 1) is
triggered on the next 0 to 1 transition of PINT1. The ADC0 interrupt is generated when
the sequence has finished after four 0 to 1 transitions of PINT1.
10. Read the RESULT bits in the DAT0 to DAT3 registers for the conversion result.