ADC Interfacing Tutorial for LPC21xx - ARM7

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.

     

    DOWNLOAD ADC interface project

Comments & Responses

One Response so far.

  1. rany says:

    simply superb

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Prove you are human by reading this resistor:
0Ω+/- 5%

0
0
1
2
3
4
5
6
7
8
9

0
0
1
2
3
4
5
6
7
8
9

0
0
1
2
3
4
5
6
7
8
9

5
5
10
20

Match the sliders on the left to each color band on the resistor.

Click Here for a new resistor image.

If you'd like to learn more, read about resistor color codes here.