Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

lpc 2148 adc code for arm

Status
Not open for further replies.

ravi506

Newbie level 1
Joined
Oct 22, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
can any ine help me ....................
 

HI can any one tell me how to program for ADC using Arm lpc2148.......or where can i refer for that .....
 

hey u can refer this code



- - - Updated - - -

http://embdev.net/topic/130731
 

//////////// This code working for LPC2148 ADC Chennal 0 . 2///////

Code:
#include<lpc214x.h>

	unsigned char temp;
	void adc_init(void);
	void adc_convert(void);



	int main(void)
	{
	    PINSEL0=0x00000300;
		PINSEL1 = 0x15000000;

		adc_init();

		while(1)
		{
							
			 adc_convert();

			if (AD0DR3==0x0136)
			{

			temp=1;
			}

		 }

	}
	
		

	void adc_init()
		{

		 AD0CR=0x00200E00;

		}


			
	void adc_convert()
				
		{
		   AD0CR = (AD0CR&0xFFFFFF00)|0x04;	
		AD0CR|=(1 << 24);					  
	 	  				  
		while((AD0DR3&0x80000000)==0);
				  	
		}


I hope this code is helping you.t
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top