Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] A/D converter of LPC2129

2004-09-02 by Fuentes Rodriguez, M.E.

here's the code im using:

for setting it up, using a PCLK of 60Mhz

ADCR = 0x00210E01;  set up ADC AIN0, @PCLK/15 =4MHz, 10bit
ADCR ¦= 0x01000000;

to read the ADC:
int value;
if (ADDR & 0x80000000)	// wait for the conversion to finish
{	
	value = ADDR;	
	value = ((value>>6) & 0x03FF); // extract the data
}


and thats it... dont forguet to set up the pin as ADC.



-----Original Message-----
From: daniela_boyo [mailto:dob3@leicester.ac.uk]
Sent: 02 September 2004 12:24
To: lpc2000@yahoogroups.com
Subject: [lpc2000] A/D converter of LPC2129


Hi everyone,

I'm having some problems with using the A/D converter of the LPC2129 
ARM board. I'm interfacing the board with an LM35DZ temperature 
sensor which has an output voltage proportional to the required 
temperature (eg 0.68V is equal to 68 degrees C).

I have set up the A/D control as follows:

ADCR  = 0x00270601
ADCR |= 0x01000000

Is the above set up suitable? Also, assuming I have gotten a value 
from the A/D data (ADDR), how do I extract this value and get a 
suitable value for the temperature (i.e. if analogue input is 0.25V 
for instance)?

I would greatly appreciate it if someone can help me with this or if 
someone is willing to share some example code.

Thank you!
Daniela.






 
Yahoo! Groups Links

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.