Reference : Document UM10139 Chapter 19
Purpose:
To learn, How to enable & use the inbuilt ADC module of LPC21xx ??? Display the current digital value of analog signal on channel 3 of ADC0 onto an alphanumeric LCD.
Notes:
- LPC2148 has two inbuilt ADC modules, ADC0 & ADC1.
- Each ADC is of 10 bit resolution, using Successive approximation conversion technique.
- ADC0 has 6 channels and ADC1 has 8 channels. (14 analog Channels)
- Supports maximum clock at 4.5 MHz.
- Lots of registers are there associated to ADC, but i am going to tell you only important ones here, any time you can refer UM10139, chapter 19 for more details of ADC’s special function registers.
- The register we must know about is, ADC Control register (AD0CR or AD1CR) & ADGDR (ADC Global data register)

Go through all the bit description above, see how many opearating modes are there, How to configure the clock to ADC.
Look carefully to bits 6:15 and 31 of ADGDR register.
Code snippet from adc.c
Download fully commented source code below.