EmbeddedRelated.com
Forums

ADC Issue

Started by Jerry January 29, 2012
My frustration level just went up another few notches. I just tried my LCPXpresso 1769 board and I'm seeing the exact same issue as with the NGX board.

The code is so simple, especially in polled mode, it's difficult to look at it any closer. I've verified all I can. Perhaps I can find some known-working code and try that.

An Engineer's Guide to the LPC2100 Series

Hello Jerry,

> My frustration level just went up another few notches. I just tried
> my LCPXpresso 1769 board and I'm seeing the exact same issue as with
> the NGX board.
>
> The code is so simple, especially in polled mode, it's difficult to
> look at it any closer. I've verified all I can. Perhaps I can find
> some known-working code and try that.

perhaps you can try to get a working hex / binary file
(e.g. reading A/D and displaying values / statistics on
serial port) from M. Manca (he was the one with running code ?) ?

So you can run exactly the same code as he and check
if problems occure also on your side.
Or you can send him your code and check if the same error
occurs also on the other side ?

Perhaps you / he can put the code in the file area of this group,
so even others can check / test their hardware.

Best regards and good luck !

Martin Maurer

Il 16/02/2012 09:30, capiman26061973 ha scritto:
>
>
> Hello Jerry,
>
> > My frustration level just went up another few notches. I just tried
> > my LCPXpresso 1769 board and I'm seeing the exact same issue as with
> > the NGX board.
> >
> > The code is so simple, especially in polled mode, it's difficult to
> > look at it any closer. I've verified all I can. Perhaps I can find
> > some known-working code and try that.
>
> perhaps you can try to get a working hex / binary file
> (e.g. reading A/D and displaying values / statistics on
> serial port) from M. Manca (he was the one with running code ?) ?
>
> So you can run exactly the same code as he and check
> if problems occure also on your side.
> Or you can send him your code and check if the same error
> occurs also on the other side ?
>
> Perhaps you / he can put the code in the file area of this group,
> so even others can check / test their hardware.
>
> Best regards and good luck !
>
> Martin Maurer
>
Hello Martin,
I was thinking to make a little application note about ADC testing. It
would work on most NXP ARM and Cortex microcontrollers.
I will use the boards I have so Keil, Olimex/IAR, Hitex, LpcXpresso and
mbed. Could be interesting if someother may participate
porting/adapting/testing the code on different hardware.
A beta code could be ready not before next week. I will post a message
and save the beta code on the file area.
>



If you're seeing large glitches on the supply the problems might not even be
related to the A/D.

Many people try simple code jus to test a function first overlooking what
the rest of the device is doing which is often OK, but it's always important
to ensure that all IO are in a well behaved state so it's worth checking the
state of all other pins on the device to ensure that there are no floating
inputs, or outputs in contention.

Any such problems will at least cause noise on the devices ground / power
which can seriously disturb the A/D, and at worst can cause damage in the
longer term.

Any unconnected pin needs to be programmed as an output, or as an input with
pull up or pull down.

You cannot leave unconnected input pins floating on a cmos device.

Regards

Phil.

From: l... [mailto:l...] On Behalf Of
Jerry
Sent: 16 February 2012 07:12
To: l...
Subject: [lpc2000] Re: ADC Issue

My frustration level just went up another few notches. I just tried my
LCPXpresso 1769 board and I'm seeing the exact same issue as with the NGX
board.

The code is so simple, especially in polled mode, it's difficult to look at
it any closer. I've verified all I can. Perhaps I can find some
known-working code and try that.



Jerry,

350mV of noise mean that only the top 3 bits of the ADC are significant,
the rest is unpredictable. If you have this level of noise (which is quite
abnormal), it can be that you have fine spikes that do not appear on a
scope, meaning that you can have more noise at some points.

Try to feed the board on its own with a battery and see what happens. Also,
I have an LPCXpresso board so I can try your code here if you wish, just
zip the project and send it to me.

Cheers
--
Olivier Gautherot
o...@gautherot.net
Cel:+56 98 730 9361
www.gautherot.net
http://www.linkedin.com/in/ogautherot
On Thu, Feb 16, 2012 at 12:47 AM, Jerry wrote:

> **
> --- In l..., "dandebeer" wrote:
> > I think you should remove L2 and L4 from the bottom of the board and
> replace them with solder bridges. With the inductors in place the micro
> does not have a solid ground and this will cause problems for the analog
> circuits. The inductors allow the ground pins of the analog and digital
> sections of the chip to differ due to switching current spikes. As a bare
> minimum, Vssa and Vref- MUST be tied together.
>
> Dan,
>
> I tried removing L2 and L4 replacing them with solder bridges. It makes no
> difference to the results.
>
> There is approx. 350 mV of noise on Vref- and Vssa, but no glitches larger
> than that.
>
>
>


Il 16/02/2012 04:47, Jerry ha scritto:
>
>
> --- In l... ,
> "dandebeer" wrote:
> > I think you should remove L2 and L4 from the bottom of the board and
> replace them with solder bridges. With the inductors in place the
> micro does not have a solid ground and this will cause problems for
> the analog circuits. The inductors allow the ground pins of the analog
> and digital sections of the chip to differ due to switching current
> spikes. As a bare minimum, Vssa and Vref- MUST be tied together.
>
> Dan,
>
> I tried removing L2 and L4 replacing them with solder bridges. It
> makes no difference to the results.
>
> There is approx. 350 mV of noise on Vref- and Vssa, but no glitches
> larger than that.
>
Just to understand: you have 350mV of noise as an AC component measured
between Vref and Vssa? Or you have 350mV of noise on the adc pin when it
is tied to Vssa?
>



--- In l..., "Phil Young" wrote:
> Any unconnected pin needs to be programmed as an output, or as an input with
> pull up or pull down.

I've stripped my code down to the bare bones at this point. The power-on default for all ports on the LPC1768/69 is GPIO input with pull-up. I've verified that this is indeed the case on my board. The only port not programmed this way is the one corresponding to the analog port I'm using, which is programmed for the ADC function with pull-up/down disabled.

Tonight I'll try powering the board from a battery and using a 1.5v battery as input to the ADC channel. Can't get much quieter than that.

--- In l..., "M. Manca" wrote:
> Just to understand: you have 350mV of noise as an AC component measured
> between Vref and Vssa? Or you have 350mV of noise on the adc pin when it
> is tied to Vssa?

350mV of AC noise between the ground leg of the voltage divider I'm using as the 1.65V input to the ADC and either Vref- or Vssa.

Il 16/02/2012 16:42, Jerry ha scritto:
>
>
> --- In l... ,
> "Phil Young" wrote:
> > Any unconnected pin needs to be programmed as an output, or as an
> input with
> > pull up or pull down.
>
> I've stripped my code down to the bare bones at this point. The
> power-on default for all ports on the LPC1768/69 is GPIO input with
> pull-up. I've verified that this is indeed the case on my board. The
> only port not programmed this way is the one corresponding to the
> analog port I'm using, which is programmed for the ADC function with
> pull-up/down disabled.
>
Jerry, you said that you are using 1 adc pin input (ADC0.0 if I remember
well) in any case you have to do these things to don't have problems:
1. if you are using one or more but not all adc pins: you have to
program all other pins as inputs with internal pull-up or pull-down (I
prefer pull down in this case).
2. if you are using all adc pins as adc pins you haven't to leave
floating these pins. A solution for simple test is a 10K resistor to
analog gnd (you would read data near 0 value), better would be a couple
of diodes/schottky to protect the input from V>Vref and V filter.
> Tonight I'll try powering the board from a battery and using a 1.5v
> battery as input to the ADC channel. Can't get much quieter than that.



What size caps have you tried between Vref and Vssa

--- In l..., "Jerry" wrote:
>
> --- In l..., "M. Manca" wrote:
> > Just to understand: you have 350mV of noise as an AC component measured
> > between Vref and Vssa? Or you have 350mV of noise on the adc pin when it
> > is tied to Vssa?
>
> 350mV of AC noise between the ground leg of the voltage divider I'm using as the 1.65V input to the ADC and either Vref- or Vssa.
>