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
373 of 464
NXP Semiconductors
UM10850
Chapter 25: LPC5410x 12-bit ADC controller (ADC0)
25.6.4 ADC Global Data Register A and B
The ADC Global Data Registers contain the result of the most recent ADC conversion
completed under each conversion sequence.
Results of ADC conversions can be read in one of two ways. One is to use these ADC
Global Data Registers to read data from the ADC at the end of each ADC conversion.
Another is to read the individual ADC Channel Data Registers, typically after the entire
sequence has completed. It is recommended to use one method consistently for a given
conversion sequence.
The global registers are useful in conjunction with DMA operation - particularly when the
channels selected for conversion are not sequential (hence the addresses of the
individual result registers will not be sequential, making it difficult for the DMA engine to
address them). For interrupt-driven code it will more likely be advantageous to wait for an
entire sequence to complete and then retrieve the results from the individual channel
registers.
Remark:
The method to be employed for each sequence should be reflected in the
MODE bit in the corresponding SEQn_CTRL register since this will impact interrupt and
overrun flag generation.
Table 419: ADC Sequence A Global Data Register (SEQA_GDAT, address offset 0x10) bit description
Bit
Symbol
Description
Reset
value
3:0
-
Reserved.
NA
15:4
RESULT
This field contains the 12-bit ADC conversion result from the most recent conversion performed
under conversion sequence associated with this register.
The result is a binary fraction representing the voltage on the currently-selected input channel as
it falls within the range of VREFP to VREFN. Zero in the field indicates that the voltage on the
input pin was less than, equal to, or close to that on VREFN, while 0xFFF indicates that the
voltage on the input was close to, equal to, or greater than that on VREFP.
DATAVALID = 1 indicates that this result has not yet been read.
NA
17:16 THCMP
RANGE
Indicates whether the result of the last conversion performed was above, below or within the
range established by the designated threshold comparison registers (
THRn_LOW and
THRn_HIGH).
19:18 THCMP
CROSS
Indicates whether the result of the last conversion performed represented a crossing of the
threshold level established by the designated LOW threshold comparison register (
THRn_LOW)
and, if so, in what direction the crossing occurred.
25:20 -
Reserved.
NA
29:26 CHN
These bits contain the channel from which the RESULT bits were converted (e.g. 0000 identifies
channel 0, 0001 channel 1, etc.).
NA
30
OVER
RUN
This bit is set if a new conversion result is loaded into the RESULT field before a previous result
has been read - i.e. while the DATAVALID bit is set. This bit is cleared, along with the DATAVALID
bit, whenever this register is read.
This bit will contribute to an overrun interrupt/DMA trigger if the MODE bit (in SEQAA_CTRL) for
the corresponding sequence is set to ‘0’ (and if the overrun interrupt is enabled).
0
31
DATA
VALID
This bit is set to ‘1’ at the end of each conversion when a new result is loaded into the RESULT
field. It is cleared whenever this register is read.
This bit will cause a conversion-complete interrupt for the corresponding sequence if the MODE
bit (in SEQA_CTRL) for that sequence is set to 0 (and if the interrupt is enabled).
0