Yahoo Groups archive

Lpc2000

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

Thread

LPC2129 ADC

LPC2129 ADC

2004-11-22 by firegenie1980

Hi,

Im using the onboard ADC for a project I am working on. However I 
seem to be getting some strange values and it isnt acting as I 
expect it to.

Two things mainly:

One, when I take a voltage input of a constant voltage (0.5 * 3.3V) 
I get fluctuating values from the ADC which I output to 
hyperterminal. This is very strange as they should be all the same 
value.

Two, when I take the value from ADDR I place it into an int. However 
I am saving these values into an 8-bit value array so I have to 
shift right twice (due to the ADC being 10-bit). Or so I thought. 
The values I get from this array seem to be about right, but the 
resolution is in steps of 8 or 16 not the expected 1. This is no 
good for my application. I have also tried dividing by 4, but this 
produces even stranger results! 

Any help would be appriciated.

Thanks,

FG

Re: [lpc2000] LPC2129 ADC

2004-11-22 by Robert Adsett

At 09:28 PM 11/22/04 +0000, you wrote:


>Hi,
>
>Im using the onboard ADC for a project I am working on. However I
>seem to be getting some strange values and it isnt acting as I
>expect it to.
>
>Two things mainly:
>
>One, when I take a voltage input of a constant voltage (0.5 * 3.3V)
>I get fluctuating values from the ADC which I output to
>hyperterminal. This is very strange as they should be all the same
>value.

How much are they fluctuating?  I'd expect some fluctuation.  Also what 
does your signal look line on an oscilloscope (AC coupled at about 5mV/div)?


>Two, when I take the value from ADDR I place it into an int. However
>I am saving these values into an 8-bit value array so I have to
>shift right twice (due to the ADC being 10-bit). Or so I thought.
>The values I get from this array seem to be about right, but the
>resolution is in steps of 8 or 16 not the expected 1. This is no
>good for my application. I have also tried dividing by 4, but this
>produces even stranger results!

Have you compared before and after values?  If the division is not tracking 
the input values it's probably just a simple arithmetic error.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Re: [lpc2000] LPC2129 ADC

2004-11-22 by Robert Adsett

At 04:43 PM 11/22/04 -0500, you wrote:
> >Two, when I take the value from ADDR I place it into an int. However
> >I am saving these values into an 8-bit value array so I have to
> >shift right twice (due to the ADC being 10-bit). Or so I thought.
> >The values I get from this array seem to be about right, but the
> >resolution is in steps of 8 or 16 not the expected 1. This is no
> >good for my application. I have also tried dividing by 4, but this
> >produces even stranger results!
>
>Have you compared before and after values?  If the division is not tracking
>the input values it's probably just a simple arithmetic error.

Also note that the A/D result register contains more than the result. The 
top 16 bits are various status fields and the low 6 bits are zero (allowing 
compatible expansion to 16 bits of resolution).


" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Re: LPC2129 ADC

2004-11-23 by firegenie1980

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> 
wrote:
> At 04:43 PM 11/22/04 -0500, you wrote:
> > >Two, when I take the value from ADDR I place it into an int. 
However
> > >I am saving these values into an 8-bit value array so I have to
> > >shift right twice (due to the ADC being 10-bit). Or so I 
thought.
> > >The values I get from this array seem to be about right, but the
> > >resolution is in steps of 8 or 16 not the expected 1. This is no
> > >good for my application. I have also tried dividing by 4, but 
this
> > >produces even stranger results!
> >
> >Have you compared before and after values?  If the division is 
not tracking
> >the input values it's probably just a simple arithmetic error.
> 
> Also note that the A/D result register contains more than the 
result. The 
> top 16 bits are various status fields and the low 6 bits are zero 
(allowing 
> compatible expansion to 16 bits of resolution).
> 
> 
> " 'Freedom' has no meaning of itself.  There are always 
restrictions,
> be they legal, genetic, or physical.  If you don't believe me, try 
to
> chew a radio signal. "
> 
>                          Kelvin Throop, III

Thanks for that. I actually noticed that as I was reading through 
the user manual for inspiration, I then found an example with a 6 
times right shift and an arithmetical and worked on to the output of 
the ADC. I always thought that was to extract the information for 
that particular users' program!

Stll adding that in and a few other slight modifications and my 
project is working fine.

Thanks,

FG

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.