DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
449 of 571
NXP Semiconductors
UM10316
Chapter 26: LPC29xx Analog-to-Digital Converter (ADC)
The main control of the ADC is via the ADC control register (ACON). This register allows
enabling or disabling the ADC, defining the scan mode – single-shot or continuous – and
the channel trigger mode, and it also contains the notification of whether a conversion is
running or finished. The channel configuration register (ACC) is used to define the
resolution of the individual channels and to enable them. Once the conversion scan is
finished the resulting conversion data can be read from the ACD registers.
The sampling rate of the ADC depends on the programmed resolution of the channels.
The relation between the two is as follows:
2.1 Clock distribution
The ADC clock is limited to 4.5 MHz maximum frequency and should always be lower
than or equal to the system clock frequency. The CGU provides a programmable
fractional system-clock divider dedicated to the ADC clock to fulfill this constraint or to
select the desired lower sampling frequency. The conversion rate is determined by the
ADC clock frequency divided by the number of resolution bits plus one. Accessing ADC
registers requires an enabled ADC clock which is controllable via the CGU.
2.2 Compare conversion results with predefined threshold
The ADC provides a feature that reduces the interrupt load of the system, in that an
interrupt is only generated when a certain voltage level is greater than or less than the
predefined threshold. Comparison of conversion results and the threshold is performed in
hardware and an interrupt is requested when the compare condition is true, otherwise the
next conversion is started without notification.
2.3 Trigger ADC conversion with MSCSS timer 0
Each ADC provides four different options to start a conversion. Each start input is
sensitive on either rising or falling edges of the applied trigger (start) signal. The four start
inputs are:
•
External input
•
Timer0 match output
•
PWM sync_out signal
•
Previous ADC
2.4 Interrupt handling
The ADC can be configured to generate an interrupt after a conversion scan. The interrupt
control in this case is via the registers Interrupt Enable (AIE), Interrupt Status (AIS) and
Interrupt Clear (AIC).
fS
fi ADC
(
)
resolution
1
+
------------------------------------
=