UM11029
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2017. All rights reserved.
User manual
Rev. 1.0 — 16 June 2017
440 of 515
NXP Semiconductors
UM11029
Chapter 26: LPC84x 12-bit Analog-to-Digital Converter (ADC)
26.3.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 ADC triggered by a rising
edge on PINT0 or PINT1 pin, follow these steps:
1. Enable the analog functions ADC_0 to ADC_3 through the switch matrix. See
2. Configure the system clock to be 25 MHz and select a CLKDIV value of 0 for a
sampling rate of 1 Msamples/s using the ADC CTRL register.
3. Select ADC channels 0 to 3 to perform the conversion by setting the CHANNELS bits
to 0xF in the SEQA_CTL register.
4. Assign the input port PIO0_15 to be pin interrupt 0 by writing 0xF to PINTSEL[0] in
SYSCON.
5. Configure the pin interrupt block for level-sensitive and active-high on pin interrupt 0,
and enable it.
–
LPC_PIN_INT->ISEL |= 0x1; // level-sensitive
–
LPC_PIN_INT->IENF |= 0x1; // active high
–
LPC_PIN_INT->SIENR = 0x1; // enabled
6. Select PININT0_IRQ by writing 0x1 to 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 ADC channel 0 will be triggered whenever the pin PIO0_15 goes
from LOW to HIGH. The conversion on the next channel (channel 1) is triggered on
the next rising edge of PIO0_15. The ADC_SEQA_IRQ interrupt is generated when
the sequence has finished after four rising edges on PIO0_15.
10. Read the RESULT bits in the DAT0 to DAT3 registers for the conversion result.
26.3.3 ADC hardware trigger inputs
An analog-to-digital conversion can be initiated by a hardware trigger. You can select the
trigger independently for each of the two conversion sequences in the ADC SEQA_CTRL
or SEQB_CTRL registers by programming the hardware trigger input # into the TRIGGER
bits.
Related registers:
•
•