Yahoo Groups archive

Lpc2000

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

Message

LPC2138 ADC0 is not working (Working in simulator but not in board)

2005-08-19 by Mohan K

Hi All,

I am trying to use ADC0 in our board. I am using ADC0.0 for analog
input. The following is my code

	unsigned char databyte=0;

	AD0CR=0x00240A01;	//8 bits/9 clocks
	AD0CR=0x01240A01;	//start the conversion
		
	while(((AD0DR & 0x80000000)>>31)!=1);
	
	AD0CR=0x00240A01;	//stop the conversion
	
	databyte=(AD0DR & 0x0000FF00)>>8;
	
This code is working in simulator, but not working in our board. Am I
missing anything?

Please advice.

Thanks & Regards,
Mohan

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.