LPC 17xx ADC: Done by
LPC 17xx ADC: Done by
LPC 17xx ADC: Done by
DONE BY
PRIYANGA KR
AP/ECE
ADC
❏ The ADC Peripheral is an important part of modern Microcontrollers
❏ All modern ADC implementations are IC based to reduce the complexity of matched
components.
Features
❏ The LPC1768 MCU consists of an 8-channel 12-bit Successive Approximation type
Analog to Digital Converter.
❏ 12-bit is the resolution of the ADC, which represents the number of discrete values an
ADC can produce for a given analog reference voltage.
❏ ADC in LPC1768 is having a resolution of 12-bits, it can produce 2^12 discrete values
for a range of analog voltages, which is usually between 0V and 3.3V.
VREFP, VREFN Positive and Negative Reference Voltages for both ADC and DAC (Isolated 3.3V and 0V)
ADCR A/D Control Register. Used to Start ADC, Select Operating Mode, Channel
Selection, Set Clock Division.
ADGDR A/D Global Data Register. Contains the Data of the most recent A/D Conversion
ADINTEN A/D Interrupt Enable Register. Used to enable interrupt when a channel completes
conversion.
ADDR0 – A/D Channel Data Register. These registers hold the result of the recent conversion in
ADDR7 that respective channel.
ADSTAT A/D Status Register. Holds the status of all ADC Channels.
ADTRM A/D Trim Register. Contains Trim values for ADC an DAC.
ADC Modes
❏ Two ways in which the ADC Module can work
❏ Software Controlled Mode
❏ Burst Mode (or Hardware Mode)
❏ In Software Controlled Mode, only one channel must be made active during a
conversion and at a time only one conversion is possible. To convert again, you have to
repeat the process.
❏ In Hardware Scan Mode or Burst Mode, the conversions will happen continuously on
any number of channels starting from LSB (AD0.0) then progressing towards MSB
(AD0.7).
ADC Register Configuration
ADCR
ADGDR
❏ LPC_SC->PCONP |= (1<<12);
❏ LPC_ADC->ADCR |= (1<<21);
❏ LPC_SC->PCONP |= (1<<12);
❏ LPC_ADC->ADCR |= (1<<16);
Contd...
❏ unsigned long value ADGDR = LPC_ADC->ADGDR;
https://www.exploreembedded.com/wiki/LPC1768:_ADC_Programming
http://www.ocfreaks.com/lpc1768-adc-programming-tutorial/
https://openlabpro.com/guide/adc-module-lpc1768/