In this tutorial we will how how to read the ADC values on Explore M3 using Explore Embedded Libraries.

Lpc1768Adc.gif

Prerequisites

Please check this tutorial for detailed explanation on Lpc1768 ADC module.
If you are doing it for the first time, then check the below links to setup the project for generating the .bin file.

  1. Keil4 Setup
  2. Keil5 Setup
  3. ARM GCC Setup
  4. Eclipse & ARM GCC Setup



ADC module

Explore M3 comes with 5-ADC pins with 12-bit resolution.
Below table shows the Explore M3 ADC pin mapping.

Adc Channel LPC1768 Pin Pin Functions
A0 P0.23 0-GPIO, 1-AD0[0], 2-I2SRX_CLK, 3-CAP3[0]
A1 P0.24 0-GPIO, 1-AD0[1], 2-I2SRX_WS, 3-CAP3[1]
A2 P0.25 0-GPIO, 1-AD0[2], 2-I2SRX_SDA, 3-TXD3
A3 P0.26 0-GPIO, 1-AD0[3], 2-AOUT, 3-RXD3
A4 P1.31 0-GPIO, 1-SCK1, 2- , 3-AD0[5]


Code

The below code shows uart communication on all the four UART channels with different baud rate.

  • Note:Refer the uart.h file for interface details.


Demo

UartAdc.jpg