Yahoo Groups archive

Lpc2000

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

Message

ADC Problem

2006-05-11 by heedaf

I've got the following code to start the ADC.  If I put in a 
breakpoint somewhere after the code and run to the breakpoint it will 
enter an endless loop.  If I step manually past the while statement 
and than run to the breakpoint it will work fine.  If I put in a delay 
before the while statement it also works but this seriously slows down 
the ADC.  I guess this has something to do with initialization but I'm 
not sure.  Does anyone have any ideas?
Thanks,
Dewayne

	ADCR = (ADCR & 0xFFFFFF00) | (1 << 1) | (1 << 24);

        //wait til done
     
	while((ADDR & 0x80000000) == 0)
	  ;

	//get result
	return (ADDR>>6) & 0x3FF;

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.