
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
323 of 487
NXP Semiconductors
UM10800
Chapter 21: 12-bit Analog-to-Digital Converter (ADC)
21.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 ADC0 triggered by a
rising edge on ADC_PINTRIG0 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. Select ADC_PINTRIG0 by writing 0x1 to the TRIGGER bits in the SEQA_CTRL
register.
5. Assign the ADC_PINTRIG0 function to pin PIO0_15 through the switch matrix register
.
6. To generate one interrupt at the end of the entire sequence, set the MODE bit to 1 in
the SEQA_CTRL register.
7. Select single-step mode by setting the SINGLESTEP bit in the SEQA_CTRL register
to 1.
8. Enable the Sequence A by setting the SEQA_ENA bit.
A conversion on ADC0 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.
9. Read the RESULT bits in the DAT0 to DAT3 registers for the conversion result.
21.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:
•
•