Yahoo Groups archive

Lpc2000

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

Message

ADC Burst/Scan not functioning in LPC2114. Need example.

2005-06-11 by weverest3

I am trying to get ADC channel-scanning to operate.  The function is 
only available in burst mode.  The following code looks good, but 
only the lowest-order channel is captured.  Any ideas?

---------------------------------------------------
void Adc_Init(void)
{
  ADCR_bit.SEL    = 0x3;    // Sample CH0 & CH1
  ADCR_bit.CLKDIV = (4-1);  // Divide PCLK by 4
  ADCR_bit.BURST  = 1;      // Repetetive sampling
  ADCR_bit.CLKS   = 0;      // Select 11 clocks
  ADCR_bit.PDN    = 1;      // ADC is operational
  ADCR_bit.TEST   = 0;
  ADCR_bit.EDGE   = 0;
  ADCR_bit.START  = 1;      // Start conversion
}
---------------------------------------------------

For the test, CH0=3V and CH1=0V.  The ADDR register always reports 
3V.  More complicated buffering tests with modulated signals also 
yielded the same result.  Both inputs work when in single-channel 
mode.

I also tried writing the configuration register directly, without 
the bit structure. No joy.
ADCR = 0x00210303;  //0000 0000 0010 0001 0000 0011 0000 0011
ADCR = 0x01210303;  // Start

There is a Philips errata that states scanning does not work between 
CH1 and CH2.  As a test, other channels and SEL values were tried 
with the same result; only the lowest channel number is selected.

Has anone gotten the scanning function to work?  Is there an 
undocumented sequence for programming?

Thanks.

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.