Yahoo Groups archive

Lpc2000

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

Message

ADC slow sampling rate problem

2006-05-13 by heedaf

I'm using the following code for the ADC with the LPC2148 and 
Rowley's CrossWorks:

//configuration//
ADCR = (1 << 0)| //SEL = 1, dummy channel #1
 ((15000000/4500000)-1)<<8 | //set clk to 4.5M
 (0 << 16) | //BURST = 0, SW controlled
 (0 << 17) | //CLKS  = 0, 11 clocks = 10-bit
 (1 << 21) | //PDN   = 1, ADC is active
 (1 << 24) | //START = 1, start a conversion now
 (0 << 27);  //EDGE  = 0, 

//Start ADC//
ADCR=(ADCR & 0xFFFFFF00)|(1 << 1) & (~(1 << 24)); //Sets to channel 1
ADCR=(ADCR & 0xFFFFFF00)|((1 << 24)); //Starts the conversion
while((ADDR & 0x80000000) == 0) //get result - adjust to 10-bit 
integer
   ;	
return (ADDR>>6) & 0x3FF;

   
The LPC2148 manual lists 2.44 microseconds for a conversion time (at 
11 clocks) but I'm getting about 44microseconds instead.  I'm only 
writing to an array so I can calculate the a full wave in order to 
calculate the sample rate.  Any ideas what might be causing it to 
sample so slow?
Thanks,
Dewayne

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.