Hi
Below is my working code for LPC2148 try this:
//Initialization ADC
AD0CR = 0x00200F02; //AD1 ; PCLK`Mhz; CLKDIV so ADC clk= 4Mhz; PDN=Turn
power ON ADC
AD0CR |=(1<<24); // start conversion
while(!(AD0STAT & 2)); //wait while conversion is in progress
ADC_val = AD0DR1; // Pic the ADC value
ADC_val &= 0x0000FFC0; // Extract the result
ADC_val = ADC_val>>6;
Thanks
-----Original Message-----
From: pra bu
To: l...
Sent: Mon, Feb 15, 2010 8:20 pm
Subject: Re: [lpc2000] Diffbetween Read ADCValue through AD0DR1 and AD0GDR
Here is my code,
PCONP |= ( 1 << 12);
/* Pin 0.24 */
PINMODE1 |=0x00020000;
PINSEL1 |=0x00010000;
ADCR = 0x00000000;
ADCR = (1 << 21);
ADCR |= 0x00000002;
ADCR |= 0x00000200; ( Pclk = 12MHz)
ADCR |= (1 << 24);
do
{
ADCReg = ADDR1;
}while(!( ADCReg & 0x80000000 ));
ADCR = 0x00000000;
ADCValue = (( ADCReg & 0x0000FFC0 ) >> 6);
ADCR = 0x00000000;
Thanks,
From: "m...@email.com"
To: l...
Sent: Mon, 15 February, 2010 2:26:34 PM
Subject: Re: [lpc2000] Diffbetween Read ADCValue through AD0DR1 and AD0GDR
Hello
AD0GDR contains the most resent ADC conversion among all the channel(
result bit: 15:6), also you will get the channel no of result captured bit
26:24. By using AD0DR1 contains the most resent conversion on channel 1.
Presently I am working on LPC2148.
If you share your ADC initialization and read code than I think I am
able to solve your problem.
Thanks,
-----Original Message-----
From: prabuisin@yahoo. co.in
To: lpc2000@yahoogroups .com
Sent: Sat, Feb 13, 2010 8:48 pm
Subject: [lpc2000] Diffbetween Read ADCValue through AD0DR1 and AD0GDR
Hi all,
I am using ADC channel1(P0. 24) in LPC2364.What is the different between
ADC value read through AD0DR0 and AD0GDR.
If i read ADC value through AD0GDR,i am getting correct value.But
If i read ADC value through AD0DR1,i am always getting the constant value 960.I
dont know what is mistake here?
Please give me some ideas what may be wrong here???
I am using only channel 1.In future,if i use more than one ADC means,
I will use AD0DRx.So i want to know what is wrong here???
Thanks,
Hello
AD0GDR contains the most resent ADC conversion among all the channel(
result bit: 15:6), also you will get the channel no of result captured bit
26:24. By using AD0DR1 contains the most resent conversion on channel 1.
Presently I am working on LPC2148.
If you share your ADC initialization and read code than I think I am
able to solve your problem.
Thanks,
-----Original Message-----
From: prabuisin@yahoo. co.in
To: lpc2000@yahoogroups .com
Sent: Sat, Feb 13, 2010 8:48 pm
Subject: [lpc2000] Diffbetween Read ADCValue through AD0DR1 and AD0GDR
Hi all,
I am using ADC channel1(P0. 24) in LPC2364.What is the different between
ADC value read through AD0DR0 and AD0GDR.
If i read ADC value through AD0GDR,i am getting correct value.But
If i read ADC value through AD0DR1,i am always getting the constant value 960.I
dont know what is mistake here?
Please give me some ideas what may be wrong here???
I am using only channel 1.In future,if i use more than one ADC means,
I will use AD0DRx.So i want to know what is wrong here???
Thanks,
Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!.