
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
391 of 464
NXP Semiconductors
UM10850
Chapter 25: LPC5410x 12-bit ADC controller (ADC0)
25.8 Examples
25.8.1 Perform a single ADC conversion triggered by software
Remark:
When ADC conversions are triggered by software only and hardware triggers
are not used in the conversion sequence, follow these steps to avoid spurious
conversions:
1. Before changing the trigger set-up, disable the conversion sequence by setting the
SEQ_ENA bit to 0 in the SEQA_CTRL register.
2. Set the trigger source to an unused setting using the TRIGGER bits in the
SEQA_CTRL register.
3. Set the TRIGPOL bit to 1 in the in the SEQA_CTRL register.
Once the sequence is enabled again, the ADC converts a sample whenever the START
bit is written to.
The ADC converts an analog input signal VIN on the ADC0_[11:0] pins. The VREFP and
VREFN pins provide a positive and negative reference voltage input. The result of the
conversion is (4095 x VIN)/(VREFP - VREFN). The result of an input voltage below
VREFN is 0, and the result of an input voltage above VREFP is 4095 (0xFFF).
To perform a single ADC conversion for ADC0 channel 1 using the analog signal on pin
ADC0_1, follow these steps:
1. Enable the analog function on pin ADC0_1 via IOCON See
and
2. Configure the system clock to be 50 MHz and select a CLKDIV value of 0 for a
sampling rate of 50 MHz using the ADC CTRL register.
3. Select the synchronous mode in the CTRL register.
4. Select ADC channel 1 to perform the conversion by setting the CHANNELS bits to
0x2 in the SEQA_CTL register.
5. Set the TRIGPOL bit to 1 and the SEQA_ENA bit to 1 in the SEQA_CTRL register.
6. Set the START bit to 1 in the SEQA_CTRL register.
7. Read the RESULT bits in the DAT1 register for the conversion result.