SlideShare a Scribd company logo
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
1 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
Name: Omkar Rane
Roll No: TETB118 Batch:1 Block:1
ENTC
Problem No.1: Program the LPC21XX On-chip ADC to implement a simple Data
Acquisition System
OBJECTIVES
• Features of On-chip 10-bit ADC (4 / 8 channels) and type of ADC used
• Programming the On-chip 10-bit ADC of the development board
EQUIPMENTS
• LPC2148 Micro–A748 Development Board
• Keil µvision IDE enabled PC
• Sensors
THEORY
Analog to Digital Converter
The A/D converter present on some LPC2000 variants is a 10-bit
successive approximation converter, with a conversion time of 2.44
µSec. The A/D converter has either 4 or 8 multiplexed inputs
depending on the variant. The programming interface for the A/D
converter is shown below
Figure 1: ADC is available with 4 or 8 channels of 10-bit
resolution
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
2 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
Features of ADC
• 2 internal ADC's - ADC0 (6 Channel), ADC1 (8 Channel)
• Type: 10-bit, Successive Approximation type,
• Supports burst mode (repeated conversion at 3-bit to 10-bit resolution)
• Supports simultaneous conversion on both ADC's
• Conversion time: 2.44 micro-seconds
• Start of Conversion by software control / on timer match /transition on a pin
• Range: 0 V – VREF (+3.3 V)
• Max. clock frequency is 4.5 MHz, (by programming ADC Control (ADxCON Register)
ADC Control Registers:
1. SEL: The bits from (0 to 7) are used to select the channel for ADC conversion. One bit is
allotted for each channel. For example setting the Bit-0 will make the ADC to sample AD0.1 for
conversion. And setting the bit -1 will make AD0.1; similarly setting bit-7 will do the conversion
for AD0.7. Important step is we have PINSEL according to the port we are using for example
PINSEL0 for PORT0 in PLC2148.
2. CLCKDIV: The bits from (8 to 15) are for Clock Divisor. Here the APB clock (ARM
Peripheral Bus clock) is divided by this value plus one to produce the clock required for the A/D
converter, which should be less than or equal to 4.5 MHz as we are using successive
approximation method in LPC2148.
3. BURST: The bit 16 is used for BURST conversion mode.
Setting 1: The ADC will do the conversion for all the channels that are selected in SEL bits.
Setting 0: Will disable the BURST conversion mode.
4. CLCKS: The bits from (17 to 19) three bits are used for selecting resolution and the number
of clocks for A/D conversion in burst mode as it is continuous A/D conversion mode.
5. PDN: The bit 21 is for selecting Power down Mode of ADC in LPC2148.
1. A/D is in PDN mode.
2. A/D is in operational mode
6. START: The bits from (24 to 26) are for START. When the BURST conversion mode is OFF
by setting 0, these START bits are useful for when to start the A/D conversion. The START is
used for edge controlled conversion also. That is when there is an input in CAP or MAT pin of
LPC2148 the A/D starts to convert.
7. EDGE: The 27th
bit is for EDGE is used only when the START bit contains 010-111. It starts
conversion when there is CAP or MAT input you can see above table for that.
Setting: 0 - On Falling Edge
1- On Rising Edge
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
3 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
Configure ADC (AD0CR / AD1CR)
Observations:
Voltage Theoretical Values Practical
Values
ADC Hex
Values
1.0 V 1/1024=9.7656 mV 1021 V 013D
1.5 V 1.5/1024=1.4648 mV 1591 V 01EE
2.0 V 2/1024=1.9531 mV 2072 V 0283
2.5 V 2.5/1024=2.4414 mV 2587 V 0329
3.0 V 3/1024=2.587 mV 3106 V 03C4
3.1 V 3.1/1024=3.027 mV 3229 V 03EA
INTERFACING DETAILS / CONNECTIONS
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
4 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
ALGORITHM / FLOWCHART
Steps for configuring the on-chip ADC
1. Configuring the ADC Power and ADC Port Pin
2. Configure ADC (AD0CR / AD1CR)
3. Reading the status of ADC
4. Reading the conversion results and displaying the Hex value on LCD display
PROGRAM CODE
adc_new.c file:
#include "lpc214x.h"
#include"stdio.h"
#include"UART.h"
#define ADC0 1<<24
#define ADC1 1<<26
#define ADC_ON 1<<21
#define ADC_Start 1<<24
#define ADC_Channel 0x03
#define ADC_Divider 0x03<<8
#define ADC_Burst 1<<16
#define ADC_CLKS 0x00<<17
void Display(int);
void adcdelay(unsigned int time)
{
unsigned int i,j;
for(i=0;i<time;i++)
{
for(j=0;j<10000;j++);
}
}
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
5 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
void ADCInit(void)
{
int i;
i=PINSEL1;
i=(i& 0xF0FFFFFF);
PINSEL1=(i | (ADC0 | ADC1));
AD0CR=(ADC_Channel | ADC_Divider|ADC_Burst|ADC_CLKS);
i=AD0CR;
AD0CR=(i|ADC_ON);
}
unsigned int get_adc_voltage(unsigned int volt)
{
unsigned int volt_mv;
volt_mv=((volt*3300)/1024);
return volt_mv;
}
int main(void)
{
unsigned int ad0_data,ad1_data,voltage;
unsigned char * String="ADC Value(hex)";
UartInit(9600);
ADCInit();
//ADCInit();
printf("rn %s",String);
while(1)
{
if(AD0STAT & 0x03)
{
ad1_data=(AD0DR1 & 0x0000FFC0)>>6;
adcdelay(500);
voltage=get_adc_voltage(ad1_data);
printf("rnADC Voltage (mV)=%4d",voltage);
Display(ad1_data);
}
return 0;
}
}
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
6 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
void Display(int v)
{
unsigned char Character[17]={"0123456789ABCDEF"};
unsigned char res[5]={"n"};
int i=0;
unsigned int DivValue=0x1000,BaseValue=16;
while(DivValue)
{
res[i]=Character[v/DivValue];
i++;
v%=DivValue;
DivValue/=BaseValue;
}
printf("rn ADC value in Hex = %s",res);
UART_PutChar('n');
}
Header File UART.h :
void UartInit(unsigned int);
int UART_PutChar(unsigned char);
UART.c file:
#include "lpc214x.h"
#include "stdio.h"
void UartInit(unsigned int baudrate) //setting the baud rate for
115200 baud
{
int i,FDiv;
i = PINSEL0; // read the value of the pins function
i = i & 0xFFFFFFF0; // modify the value
PINSEL0 = (i | 0x05); // set the functionality of the TxD and Rxd Pin
:01
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
7 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
//set the baud rate
U0LCR = 0x83; // Line control
register :DLAB=1 ; 8 bits ; 1 stop bit ; no parity
FDiv = (15000000 / 16 ) / baudrate ; //
U0DLM = FDiv /256; //0x00;
U0DLL = FDiv %256; //0x97;
U0LCR = 0x03; // Line control
register :DLAB=0 ; 8 bits ; 1 stop bit ; no parity
U0TER = 0x80;
}
int UART_GetChar(void)
{
while(!(U0LSR & 0x1));
return(U0RBR);
}
int UART_PutChar(unsigned char Ch)
{
if (Ch == 'n') {
while (!(U0LSR & 0x20));
U0THR = 0x0D; /* output CR */
}
while(!(U0LSR & 0x20));
return( U0THR = Ch);
}
int fputc(int ch, FILE *f) {
return (UART_PutChar(ch));
}
struct __FILE { int handle; /* Add whatever you need here */ };
FILE __stdout;
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
8 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
PROGRAM OUTPUT / RESULTS
Host Machine and Target Board
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
9 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
10 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
UART Readings On Host PC:
1.0 Volt
1.5 Volt
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
11 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
2.0 Volt
2.5 Volt
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
12 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
3.0 Volt
3.1 Volt
‘
PRACTICAL NO. 5 Programming LPC214X On-chip ADC
13 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
REFERENCES
1. Andrew Sloss, Dominic Symes, Chris Wright, “ARM System Developer’s
Guide – Designing and Optimizing System Software, ELSEVIER.
2. LPC 214x User manual (UM10139): www.nxp.com
3. ARM architecture reference manual: www.arm.com
4. Trevor Martin, “An Engineer’s Introduction to the LPC2100 series”, Hitex
(UK)
CONCLUSION
In this experiment we studied about various registers in ADC on chip peripheral
of LPC 2148 . We programmed them suitably to obtain respective results via
UART . AD0.1 was given voltage between 0-3.1 V and voltage readings
observed via UART on terminal screen. Theoretical and practical values almost
same.

More Related Content

What's hot

ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
revanasidha janbgi
 
BCD ADDER
BCD ADDER BCD ADDER
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
Sudhanshu Janwadkar
 
Single Slope ADC.pptx
Single Slope ADC.pptxSingle Slope ADC.pptx
Single Slope ADC.pptx
hepzijustin
 
Pulse modulation
Pulse modulationPulse modulation
Pulse modulation
mpsrekha83
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
Dr. AISHWARYA N
 
Lecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard TransformLecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard Transform
VARUN KUMAR
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
Dr. Sanjay M. Gulhane
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
Nahian Ahmed
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOL
Shashank Rustagi
 
Radix-2 DIT FFT
Radix-2 DIT FFT Radix-2 DIT FFT
Radix-2 DIT FFT
Sarang Joshi
 
DAC , Digital to analog Converter
DAC , Digital to analog ConverterDAC , Digital to analog Converter
DAC , Digital to analog Converter
Hossam Zein
 
Butterworth filter
Butterworth filterButterworth filter
Butterworth filter
MOHAMMAD AKRAM
 
Delta modulation
Delta modulationDelta modulation
Delta modulation
mpsrekha83
 
RTC Interfacing and Programming
RTC Interfacing and ProgrammingRTC Interfacing and Programming
RTC Interfacing and Programming
Devashish Raval
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
Shazid Reaj
 
Successive approximation adc
Successive approximation adcSuccessive approximation adc
Successive approximation adc
Maria Roshan
 
Windowing techniques of fir filter design
Windowing techniques of fir filter designWindowing techniques of fir filter design
Windowing techniques of fir filter design
Rohan Nagpal
 

What's hot (20)

ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
 
BCD ADDER
BCD ADDER BCD ADDER
BCD ADDER
 
Subband Coding
Subband CodingSubband Coding
Subband Coding
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
Single Slope ADC.pptx
Single Slope ADC.pptxSingle Slope ADC.pptx
Single Slope ADC.pptx
 
Pulse modulation
Pulse modulationPulse modulation
Pulse modulation
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Lecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard TransformLecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard Transform
 
8086 microprocessor lab manual
8086 microprocessor lab manual8086 microprocessor lab manual
8086 microprocessor lab manual
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOL
 
Radix-2 DIT FFT
Radix-2 DIT FFT Radix-2 DIT FFT
Radix-2 DIT FFT
 
DAC , Digital to analog Converter
DAC , Digital to analog ConverterDAC , Digital to analog Converter
DAC , Digital to analog Converter
 
Butterworth filter
Butterworth filterButterworth filter
Butterworth filter
 
Delta modulation
Delta modulationDelta modulation
Delta modulation
 
RTC Interfacing and Programming
RTC Interfacing and ProgrammingRTC Interfacing and Programming
RTC Interfacing and Programming
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
 
Successive approximation adc
Successive approximation adcSuccessive approximation adc
Successive approximation adc
 
Windowing techniques of fir filter design
Windowing techniques of fir filter designWindowing techniques of fir filter design
Windowing techniques of fir filter design
 

Similar to Analog To Digital Conversion (ADC) Programming in LPC2148

04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)
antonio michua
 
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
AVR_Course_Day6 external hardware  interrupts and analogue to digital converterAVR_Course_Day6 external hardware  interrupts and analogue to digital converter
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
Mohamed Ali
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
Ariel Tonatiuh Espindola
 
STM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosSTM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicos
ps6005tec
 
Lecture 12 (adc) rv01
Lecture 12  (adc) rv01Lecture 12  (adc) rv01
Lecture 12 (adc) rv01
cairo university
 
EEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdfEEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdf
VishalPatil57559
 
analog to digital converter and dac final
analog to digital converter and dac finalanalog to digital converter and dac final
analog to digital converter and dac final
DrVikasMahor
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
Amitabh Shukla
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
nanocdac
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msj
mangala jolad
 
Atmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheetAtmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheet
AlexTronciu
 
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxVhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
asolis5
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
satyamsinha37
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
Chirag Lakhani
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converterCorrado Santoro
 
A 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADCA 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADC
QuEST Global (erstwhile NeST Software)
 

Similar to Analog To Digital Conversion (ADC) Programming in LPC2148 (20)

04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)
 
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
AVR_Course_Day6 external hardware  interrupts and analogue to digital converterAVR_Course_Day6 external hardware  interrupts and analogue to digital converter
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
STM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosSTM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicos
 
Módulo adc 18f4550
Módulo adc   18f4550Módulo adc   18f4550
Módulo adc 18f4550
 
Lecture 12 (adc) rv01
Lecture 12  (adc) rv01Lecture 12  (adc) rv01
Lecture 12 (adc) rv01
 
Anup2
Anup2Anup2
Anup2
 
EEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdfEEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdf
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
analog to digital converter and dac final
analog to digital converter and dac finalanalog to digital converter and dac final
analog to digital converter and dac final
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
 
8255
82558255
8255
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msj
 
Atmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheetAtmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheet
 
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxVhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 
A 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADCA 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADC
 

More from Omkar Rane

Enabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on serverEnabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on server
Omkar Rane
 
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-SimulinkAnti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
Omkar Rane
 
Autosar fundamental
Autosar fundamentalAutosar fundamental
Autosar fundamental
Omkar Rane
 
Stress Management
Stress ManagementStress Management
Stress Management
Omkar Rane
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
Omkar Rane
 
Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)
Omkar Rane
 
Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship
Omkar Rane
 
Machine Learning Model for M.S admissions
Machine Learning Model for M.S admissionsMachine Learning Model for M.S admissions
Machine Learning Model for M.S admissions
Omkar Rane
 
Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768
Omkar Rane
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
Omkar Rane
 
PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768
Omkar Rane
 
UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)
Omkar Rane
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
Omkar Rane
 
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
Omkar Rane
 
Vlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad ScannerVlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad Scanner
Omkar Rane
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner
Omkar Rane
 
LPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock featuresLPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock features
Omkar Rane
 
Nexys4ddr rm FPGA board Datasheet
Nexys4ddr rm  FPGA board DatasheetNexys4ddr rm  FPGA board Datasheet
Nexys4ddr rm FPGA board Datasheet
Omkar Rane
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)
Omkar Rane
 
transmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-windtransmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-wind
Omkar Rane
 

More from Omkar Rane (20)

Enabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on serverEnabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on server
 
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-SimulinkAnti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
 
Autosar fundamental
Autosar fundamentalAutosar fundamental
Autosar fundamental
 
Stress Management
Stress ManagementStress Management
Stress Management
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)
 
Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship
 
Machine Learning Model for M.S admissions
Machine Learning Model for M.S admissionsMachine Learning Model for M.S admissions
Machine Learning Model for M.S admissions
 
Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
 
PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768
 
UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
 
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
 
Vlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad ScannerVlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad Scanner
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner
 
LPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock featuresLPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock features
 
Nexys4ddr rm FPGA board Datasheet
Nexys4ddr rm  FPGA board DatasheetNexys4ddr rm  FPGA board Datasheet
Nexys4ddr rm FPGA board Datasheet
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)
 
transmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-windtransmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-wind
 

Recently uploaded

road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 

Recently uploaded (20)

road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 

Analog To Digital Conversion (ADC) Programming in LPC2148

  • 1. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 1 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR Name: Omkar Rane Roll No: TETB118 Batch:1 Block:1 ENTC Problem No.1: Program the LPC21XX On-chip ADC to implement a simple Data Acquisition System OBJECTIVES • Features of On-chip 10-bit ADC (4 / 8 channels) and type of ADC used • Programming the On-chip 10-bit ADC of the development board EQUIPMENTS • LPC2148 Micro–A748 Development Board • Keil µvision IDE enabled PC • Sensors THEORY Analog to Digital Converter The A/D converter present on some LPC2000 variants is a 10-bit successive approximation converter, with a conversion time of 2.44 µSec. The A/D converter has either 4 or 8 multiplexed inputs depending on the variant. The programming interface for the A/D converter is shown below Figure 1: ADC is available with 4 or 8 channels of 10-bit resolution
  • 2. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 2 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR Features of ADC • 2 internal ADC's - ADC0 (6 Channel), ADC1 (8 Channel) • Type: 10-bit, Successive Approximation type, • Supports burst mode (repeated conversion at 3-bit to 10-bit resolution) • Supports simultaneous conversion on both ADC's • Conversion time: 2.44 micro-seconds • Start of Conversion by software control / on timer match /transition on a pin • Range: 0 V – VREF (+3.3 V) • Max. clock frequency is 4.5 MHz, (by programming ADC Control (ADxCON Register) ADC Control Registers: 1. SEL: The bits from (0 to 7) are used to select the channel for ADC conversion. One bit is allotted for each channel. For example setting the Bit-0 will make the ADC to sample AD0.1 for conversion. And setting the bit -1 will make AD0.1; similarly setting bit-7 will do the conversion for AD0.7. Important step is we have PINSEL according to the port we are using for example PINSEL0 for PORT0 in PLC2148. 2. CLCKDIV: The bits from (8 to 15) are for Clock Divisor. Here the APB clock (ARM Peripheral Bus clock) is divided by this value plus one to produce the clock required for the A/D converter, which should be less than or equal to 4.5 MHz as we are using successive approximation method in LPC2148. 3. BURST: The bit 16 is used for BURST conversion mode. Setting 1: The ADC will do the conversion for all the channels that are selected in SEL bits. Setting 0: Will disable the BURST conversion mode. 4. CLCKS: The bits from (17 to 19) three bits are used for selecting resolution and the number of clocks for A/D conversion in burst mode as it is continuous A/D conversion mode. 5. PDN: The bit 21 is for selecting Power down Mode of ADC in LPC2148. 1. A/D is in PDN mode. 2. A/D is in operational mode 6. START: The bits from (24 to 26) are for START. When the BURST conversion mode is OFF by setting 0, these START bits are useful for when to start the A/D conversion. The START is used for edge controlled conversion also. That is when there is an input in CAP or MAT pin of LPC2148 the A/D starts to convert. 7. EDGE: The 27th bit is for EDGE is used only when the START bit contains 010-111. It starts conversion when there is CAP or MAT input you can see above table for that. Setting: 0 - On Falling Edge 1- On Rising Edge
  • 3. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 3 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR Configure ADC (AD0CR / AD1CR) Observations: Voltage Theoretical Values Practical Values ADC Hex Values 1.0 V 1/1024=9.7656 mV 1021 V 013D 1.5 V 1.5/1024=1.4648 mV 1591 V 01EE 2.0 V 2/1024=1.9531 mV 2072 V 0283 2.5 V 2.5/1024=2.4414 mV 2587 V 0329 3.0 V 3/1024=2.587 mV 3106 V 03C4 3.1 V 3.1/1024=3.027 mV 3229 V 03EA INTERFACING DETAILS / CONNECTIONS
  • 4. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 4 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR ALGORITHM / FLOWCHART Steps for configuring the on-chip ADC 1. Configuring the ADC Power and ADC Port Pin 2. Configure ADC (AD0CR / AD1CR) 3. Reading the status of ADC 4. Reading the conversion results and displaying the Hex value on LCD display PROGRAM CODE adc_new.c file: #include "lpc214x.h" #include"stdio.h" #include"UART.h" #define ADC0 1<<24 #define ADC1 1<<26 #define ADC_ON 1<<21 #define ADC_Start 1<<24 #define ADC_Channel 0x03 #define ADC_Divider 0x03<<8 #define ADC_Burst 1<<16 #define ADC_CLKS 0x00<<17 void Display(int); void adcdelay(unsigned int time) { unsigned int i,j; for(i=0;i<time;i++) { for(j=0;j<10000;j++); } }
  • 5. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 5 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR void ADCInit(void) { int i; i=PINSEL1; i=(i& 0xF0FFFFFF); PINSEL1=(i | (ADC0 | ADC1)); AD0CR=(ADC_Channel | ADC_Divider|ADC_Burst|ADC_CLKS); i=AD0CR; AD0CR=(i|ADC_ON); } unsigned int get_adc_voltage(unsigned int volt) { unsigned int volt_mv; volt_mv=((volt*3300)/1024); return volt_mv; } int main(void) { unsigned int ad0_data,ad1_data,voltage; unsigned char * String="ADC Value(hex)"; UartInit(9600); ADCInit(); //ADCInit(); printf("rn %s",String); while(1) { if(AD0STAT & 0x03) { ad1_data=(AD0DR1 & 0x0000FFC0)>>6; adcdelay(500); voltage=get_adc_voltage(ad1_data); printf("rnADC Voltage (mV)=%4d",voltage); Display(ad1_data); } return 0; } }
  • 6. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 6 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR void Display(int v) { unsigned char Character[17]={"0123456789ABCDEF"}; unsigned char res[5]={"n"}; int i=0; unsigned int DivValue=0x1000,BaseValue=16; while(DivValue) { res[i]=Character[v/DivValue]; i++; v%=DivValue; DivValue/=BaseValue; } printf("rn ADC value in Hex = %s",res); UART_PutChar('n'); } Header File UART.h : void UartInit(unsigned int); int UART_PutChar(unsigned char); UART.c file: #include "lpc214x.h" #include "stdio.h" void UartInit(unsigned int baudrate) //setting the baud rate for 115200 baud { int i,FDiv; i = PINSEL0; // read the value of the pins function i = i & 0xFFFFFFF0; // modify the value PINSEL0 = (i | 0x05); // set the functionality of the TxD and Rxd Pin :01
  • 7. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 7 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR //set the baud rate U0LCR = 0x83; // Line control register :DLAB=1 ; 8 bits ; 1 stop bit ; no parity FDiv = (15000000 / 16 ) / baudrate ; // U0DLM = FDiv /256; //0x00; U0DLL = FDiv %256; //0x97; U0LCR = 0x03; // Line control register :DLAB=0 ; 8 bits ; 1 stop bit ; no parity U0TER = 0x80; } int UART_GetChar(void) { while(!(U0LSR & 0x1)); return(U0RBR); } int UART_PutChar(unsigned char Ch) { if (Ch == 'n') { while (!(U0LSR & 0x20)); U0THR = 0x0D; /* output CR */ } while(!(U0LSR & 0x20)); return( U0THR = Ch); } int fputc(int ch, FILE *f) { return (UART_PutChar(ch)); } struct __FILE { int handle; /* Add whatever you need here */ }; FILE __stdout;
  • 8. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 8 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR PROGRAM OUTPUT / RESULTS Host Machine and Target Board
  • 9. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 9 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR
  • 10. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 10 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR UART Readings On Host PC: 1.0 Volt 1.5 Volt
  • 11. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 11 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR 2.0 Volt 2.5 Volt
  • 12. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 12 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR 3.0 Volt 3.1 Volt ‘
  • 13. PRACTICAL NO. 5 Programming LPC214X On-chip ADC 13 TY BTECH (SCHOOL OF ELECTRICAL ENGINEERING) EMBEDDED PROCESSOR REFERENCES 1. Andrew Sloss, Dominic Symes, Chris Wright, “ARM System Developer’s Guide – Designing and Optimizing System Software, ELSEVIER. 2. LPC 214x User manual (UM10139): www.nxp.com 3. ARM architecture reference manual: www.arm.com 4. Trevor Martin, “An Engineer’s Introduction to the LPC2100 series”, Hitex (UK) CONCLUSION In this experiment we studied about various registers in ADC on chip peripheral of LPC 2148 . We programmed them suitably to obtain respective results via UART . AD0.1 was given voltage between 0-3.1 V and voltage readings observed via UART on terminal screen. Theoretical and practical values almost same.