EmbeddedRelated.com
Forums

Clarifications on maximum input capacitance on input of ADC on LPC1768

Started by Jean-Sebastien Stoezel September 26, 2012
Hi:

Looking at the datasheet of the LPC1768, it seems table 18 lists 15pF Cia
as the maximum input capacitance that can be connected to an analog input.
This seems rather small and limiting.
Looking at the board designed specifically for AN10974, the schematic shows
capacitors of 10uF and 0.1uF connected to the analog inputs...

What is the actual maximum capacitance value that can be connected to the
input of an analog input, on an LPC1768?

Thanks,
Jean


An Engineer's Guide to the LPC2100 Series

If im not mistaken, the value in the datasheet represents the internal capacitance of the chip.
Because its an input you can probably put any value you want at the input.

--
Kevin

--- In l..., Jean-Sebastien Stoezel wrote:
>
> Hi:
>
> Looking at the datasheet of the LPC1768, it seems table 18 lists 15pF Cia
> as the maximum input capacitance that can be connected to an analog input.
> This seems rather small and limiting.
> Looking at the board designed specifically for AN10974, the schematic shows
> capacitors of 10uF and 0.1uF connected to the analog inputs...
>
> What is the actual maximum capacitance value that can be connected to the
> input of an analog input, on an LPC1768?
>
> Thanks,
> Jean
>
>

Hi:

Thanks for the reply. Based on table 27 it would appear the internal capacitance is different than Cia, which appears to be representing external capacitance of the sensor being probed.

Jean-Sebastien
On 2012-09-26, at 4:43 PM, "k_erkens" wrote:

> If im not mistaken, the value in the datasheet represents the internal capacitance of the chip.
> Because its an input you can probably put any value you want at the input.
>
> --
> Kevin
>
> --- In l..., Jean-Sebastien Stoezel wrote:
> >
> > Hi:
> >
> > Looking at the datasheet of the LPC1768, it seems table 18 lists 15pF Cia
> > as the maximum input capacitance that can be connected to an analog input.
> > This seems rather small and limiting.
> > Looking at the board designed specifically for AN10974, the schematic shows
> > capacitors of 10uF and 0.1uF connected to the analog inputs...
> >
> > What is the actual maximum capacitance value that can be connected to the
> > input of an analog input, on an LPC1768?
> >
> > Thanks,
> > Jean
> >
> >
> >
> >


Jean-Sastien,

there is no theoretical limit for the capacitor connected to the input and
I would even recommend to put one if the signal you want to measure has a
high impedance (from the top of my head, NXP recommends an impedance of 2K
max or something like that). We built a test board in the office which has
a temperature sensor on ADC0 and the first tests reported measurements that
were clearly out of range. I eventually figured out that a second reading
would give the right value.

We finally discovered that the temperature sensor had an output current of
10uA max and had to be "buffered" with a small cap (0.1uF was sufficient in
this case). It seems that the internal analog switch has an effect on the
input pin impedance.

Hope it helps
--
Olivier Gautherot
o...@gautherot.net
www.gautherot.net
http://www.linkedin.com/in/ogautherot
On Wed, Sep 26, 2012 at 6:43 PM, k_erkens wrote:

> **
> If im not mistaken, the value in the datasheet represents the internal
> capacitance of the chip.
> Because its an input you can probably put any value you want at the input.
>
> --
> Kevin
>
> --- In l..., Jean-Sebastien Stoezel
> wrote:
> >
> > Hi:
> >
> > Looking at the datasheet of the LPC1768, it seems table 18 lists 15pF Cia
> > as the maximum input capacitance that can be connected to an analog
> input.
> > This seems rather small and limiting.
> > Looking at the board designed specifically for AN10974, the schematic
> shows
> > capacitors of 10uF and 0.1uF connected to the analog inputs...
> >
> > What is the actual maximum capacitance value that can be connected to the
> > input of an analog input, on an LPC1768?
> >
> > Thanks,
> > Jean
> >
> >
> >
> >
>


The sampling capacitor internal to the ADC is connected to the input, prior to a conversion. The state of charge on this capacitor, is transferred to the input circuitry.

This can be a problem if the source impedance is high, because the conversion can start, before the source has a chance to charge the cap. This is also a problem when sampling multiple channels, because the resulting charge on the cap from one channel, is transferred to the source for the next channel.

To make matters worse, there is no way to increase the delay between channel switching and start of conversion (other then slowing the conversion rate).

For whatever reason, NXP has, as far as I can see, just about zero information on this subject.

The MSP430 internal ADCs are similar, and explained in detail in the Texas Instrument docs.

-Hershel
--- In l..., Olivier Gautherot wrote:
>
> Jean-Sastien,
>
> there is no theoretical limit for the capacitor connected to the input and
> I would even recommend to put one if the signal you want to measure has a
> high impedance (from the top of my head, NXP recommends an impedance of 2K
> max or something like that). We built a test board in the office which has
> a temperature sensor on ADC0 and the first tests reported measurements that
> were clearly out of range. I eventually figured out that a second reading
> would give the right value.
>
> We finally discovered that the temperature sensor had an output current of
> 10uA max and had to be "buffered" with a small cap (0.1uF was sufficient in
> this case). It seems that the internal analog switch has an effect on the
> input pin impedance.
>
> Hope it helps
> --
> Olivier Gautherot
> olivier@...
> www.gautherot.net
> http://www.linkedin.com/in/ogautherot
>
>
> On Wed, Sep 26, 2012 at 6:43 PM, k_erkens wrote:
>
> > **
> >
> >
> > If im not mistaken, the value in the datasheet represents the internal
> > capacitance of the chip.
> > Because its an input you can probably put any value you want at the input.
> >
> > --
> > Kevin
> >
> > --- In l..., Jean-Sebastien Stoezel
> > wrote:
> > >
> > > Hi:
> > >
> > > Looking at the datasheet of the LPC1768, it seems table 18 lists 15pF Cia
> > > as the maximum input capacitance that can be connected to an analog
> > input.
> > > This seems rather small and limiting.
> > > Looking at the board designed specifically for AN10974, the schematic
> > shows
> > > capacitors of 10uF and 0.1uF connected to the analog inputs...
> > >
> > > What is the actual maximum capacitance value that can be connected to the
> > > input of an analog input, on an LPC1768?
> > >
> > > Thanks,
> > > Jean
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
>

I have to say I am more and more confused by the way the ADC works on an
LPC1768, and actually how to properly use it.

I am aware there has been a lot of discussions about it and I know NXP has
tried to calm things down by releasing AN10974 but still: it seems the ADC
is highly susceptible to any type of capacitive load connected to it. The
schematics that come with AN10974 suggest you should be able to connect
10uF to an analog input. Tried this and the ADC becomes unstable. Tried
several capacitor values, as soon as you connect anything higher than 100pF
spikes start appearing the reading (full scale errors). This makes me
believe that the Cia value of 15pF in the datasheet in table 18 is actually
the maximum capacitor value that can be connected to an ADC input.

Mind you I have been testing this on an MBed, which doesn't necessarily
follow AN10974 layout guidelines. Nonetheless, the ADC conversions from an
MBed are very stable if no capacitor is connected to the ADC input.

Jean

On Tue, Oct 2, 2012 at 9:58 PM, misterhershel wrote:

> **
> The sampling capacitor internal to the ADC is connected to the input,
> prior to a conversion. The state of charge on this capacitor, is
> transferred to the input circuitry.
>
> This can be a problem if the source impedance is high, because the
> conversion can start, before the source has a chance to charge the cap.
> This is also a problem when sampling multiple channels, because the
> resulting charge on the cap from one channel, is transferred to the source
> for the next channel.
>
> To make matters worse, there is no way to increase the delay between
> channel switching and start of conversion (other then slowing the
> conversion rate).
>
> For whatever reason, NXP has, as far as I can see, just about zero
> information on this subject.
>
> The MSP430 internal ADCs are similar, and explained in detail in the Texas
> Instrument docs.
>
> -Hershel
> --- In l..., Olivier Gautherot wrote:
> >
> > Jean-Sastien,
> >
> > there is no theoretical limit for the capacitor connected to the input
> and
> > I would even recommend to put one if the signal you want to measure has a
> > high impedance (from the top of my head, NXP recommends an impedance of
> 2K
> > max or something like that). We built a test board in the office which
> has
> > a temperature sensor on ADC0 and the first tests reported measurements
> that
> > were clearly out of range. I eventually figured out that a second reading
> > would give the right value.
> >
> > We finally discovered that the temperature sensor had an output current
> of
> > 10uA max and had to be "buffered" with a small cap (0.1uF was sufficient
> in
> > this case). It seems that the internal analog switch has an effect on the
> > input pin impedance.
> >
> > Hope it helps
> > --
> > Olivier Gautherot
> > olivier@...
> > www.gautherot.net
> > http://www.linkedin.com/in/ogautherot
>
> >
> >
> > On Wed, Sep 26, 2012 at 6:43 PM, k_erkens wrote:
> >
> > > **
> > >
> > >
> > > If im not mistaken, the value in the datasheet represents the internal
> > > capacitance of the chip.
> > > Because its an input you can probably put any value you want at the
> input.
> > >
> > > --
> > > Kevin
> > >
> > > --- In l..., Jean-Sebastien Stoezel
> > > wrote:
> > > >
> > > > Hi:
> > > >
> > > > Looking at the datasheet of the LPC1768, it seems table 18 lists
> 15pF Cia
> > > > as the maximum input capacitance that can be connected to an analog
> > > input.
> > > > This seems rather small and limiting.
> > > > Looking at the board designed specifically for AN10974, the schematic
> > > shows
> > > > capacitors of 10uF and 0.1uF connected to the analog inputs...
> > > >
> > > > What is the actual maximum capacitance value that can be connected
> to the
> > > > input of an analog input, on an LPC1768?
> > > >
> > > > Thanks,
> > > > Jean
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
> >
>


Il 03/10/2012 18:17, Jean-Sebastien Stoezel ha scritto:
> I have to say I am more and more confused by the way the ADC works on an
> LPC1768, and actually how to properly use it.
>
> I am aware there has been a lot of discussions about it and I know NXP has
> tried to calm things down by releasing AN10974 but still: it seems the ADC
> is highly susceptible to any type of capacitive load connected to it. The
> schematics that come with AN10974 suggest you should be able to connect
> 10uF to an analog input.
No, this is not written, it is written that a 10uF electrolytic
capacitor (tantalum is better) should be used (better with a series
inductor) to form a low pass decoupling filter. This means that a low
pass LC filter should be connected very near the power supply input.
Then you should place a 100nF ceramic capacitor very near to the analog
positive power supply pin and connect the other pin to the analog power
supply ground pin.
> Tried this and the ADC becomes unstable. Tried
> several capacitor values, as soon as you connect anything higher than 100pF
> spikes start appearing the reading (full scale errors).
Normally this is a symptom of poor ADC power supply filtering and poor
knowledge of ADC modules integrated on microcontrollers.

Just to be clear: the error is to think that an 8 input ADC is a
monolithic block exposing an high impedance on every input.
This is not correct because the ADC block is made by a single input ADC
connected to a sample and hold (SH) circuit connected to an analog 8
channel demultiplexer. The ADC input that is not accessible outside the
microcontroller has an high impedance value but this is not true for the
demultiplexer that connects in turn the 8 analog inputs to the SH. So
considering that SH circutis works well ONLY if the leakage current of
its input capacitor (that is realized inside the microcontroller) is
very low, it is not a good idea to connect in parallel with it an
electrolytic capacitor that has the highest leakage current possible
(especially if it is an Aluminum type). The leakage current of a 10 uF
electrolytic capacitor should be in the order of several tenths of uA,
instead the leakage current of a 100 nF ceramic capacitor is in the
order of units of nA and for this reason when you connect a ceramic
capacitor you don't see this problem.
> This makes me
> believe that the Cia value of 15pF in the datasheet in table 18 is actually
> the maximum capacitor value that can be connected to an ADC input.
No, Cia is the capacitance exposed by an analog pin to the external
circuits; you have to think at it as if there is a 15pF capacitor
connected just before the analog input pins and the ADC ground pin and
take care of this designing your interface circuits. 15pF is the sum of
the SH input capacitor and the input capacitance (in parallel to the SH
capacitance because the series resistance of the demultiplexer channel
is near null) of a single analog input of the demultiplexer.
>
> Mind you I have been testing this on an MBed, which doesn't necessarily
> follow AN10974 layout guidelines. Nonetheless, the ADC conversions from an
> MBed are very stable if no capacitor is connected to the ADC input.
Technically speaking the problem is totally due to the electrolytic
capacitor, your interface circuit (that I don't know) and ADC power
supply filtering.

I personally verify the LPC17xx ADC operations on Keil MCB1700,
LpcXpresso-1769, mbed and LPC1788-SK (also some user reported the same
problem on 1788 parts) to give a more objective results then NXP field
engineers. The ADC is perfectly operational and connecting filters on
the inputs its performance is also better. Until now I found problems
due to poor design of the interface circuit and ADC analog inputs
programming errors so the ADC performance is heavily influenced by
engineers skill and expertise to design analog circuits.

In my opinion placing a 10uF electrolytic Aluminum capacitor directly in
parallel to an analog input pit is a poor design practice.

The correct way to design an ADC interface circuit is to design an
amplifier circuit (with a gain > 1 if needed) to interface and
decoupling the input sensor to the ADC input possibly using an
operational amplifier considering that it has a very low impedance
output circuit. The amplifier circuit should also integrate an anti
alias filtering capabilities and should be tailored specifically for the
ADC conversion rate (lower then 1/2 of the conversion rate).
>
> Jean
> On Tue, Oct 2, 2012 at 9:58 PM, misterhershel wrote:
>
>> **
>> The sampling capacitor internal to the ADC is connected to the input,
>> prior to a conversion. The state of charge on this capacitor, is
>> transferred to the input circuitry.
>>
>> This can be a problem if the source impedance is high, because the
>> conversion can start, before the source has a chance to charge the cap.
>> This is also a problem when sampling multiple channels, because the
>> resulting charge on the cap from one channel, is transferred to the source
>> for the next channel.
>>
>> To make matters worse, there is no way to increase the delay between
>> channel switching and start of conversion (other then slowing the
>> conversion rate).
>>
>> For whatever reason, NXP has, as far as I can see, just about zero
>> information on this subject.
>>
>> The MSP430 internal ADCs are similar, and explained in detail in the Texas
>> Instrument docs.
>>
>> -Hershel
>> --- In l..., Olivier Gautherot wrote:
>>> Jean-Sastien,
>>>
>>> there is no theoretical limit for the capacitor connected to the input
>> and
>>> I would even recommend to put one if the signal you want to measure has a
>>> high impedance (from the top of my head, NXP recommends an impedance of
>> 2K
>>> max or something like that). We built a test board in the office which
>> has
>>> a temperature sensor on ADC0 and the first tests reported measurements
>> that
>>> were clearly out of range. I eventually figured out that a second reading
>>> would give the right value.
>>>
>>> We finally discovered that the temperature sensor had an output current
>> of
>>> 10uA max and had to be "buffered" with a small cap (0.1uF was sufficient
>> in
>>> this case). It seems that the internal analog switch has an effect on the
>>> input pin impedance.
>>>
>>> Hope it helps
>>> --
>>> Olivier Gautherot
>>> olivier@...
>>> www.gautherot.net
>>> http://www.linkedin.com/in/ogautherot
>>>
>>> On Wed, Sep 26, 2012 at 6:43 PM, k_erkens wrote:
>>>
>>>> **
>>>>
>>>>
>>>> If im not mistaken, the value in the datasheet represents the internal
>>>> capacitance of the chip.
>>>> Because its an input you can probably put any value you want at the
>> input.
>>>> --
>>>> Kevin
>>>>
>>>> --- In l..., Jean-Sebastien Stoezel
>>>> wrote:
>>>>> Hi:
>>>>>
>>>>> Looking at the datasheet of the LPC1768, it seems table 18 lists
>> 15pF Cia
>>>>> as the maximum input capacitance that can be connected to an analog
>>>> input.
>>>>> This seems rather small and limiting.
>>>>> Looking at the board designed specifically for AN10974, the schematic
>>>> shows
>>>>> capacitors of 10uF and 0.1uF connected to the analog inputs...
>>>>>
>>>>> What is the actual maximum capacitance value that can be connected
>> to the
>>>>> input of an analog input, on an LPC1768?
>>>>>
>>>>> Thanks,
>>>>> Jean
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
Re 10uF capacitor: look up the schematic that comes with AN10974. This is
how it was designed by NXP to provide measurements on the ADC.
Understood about using active filters. Not practical though when you want
to have a gain <1 and do not necessarily want to run dual rail power
supplies.
On Wed, Oct 3, 2012 at 12:30 PM, M. Manca wrote:

> Il 03/10/2012 18:17, Jean-Sebastien Stoezel ha scritto:
> > I have to say I am more and more confused by the way the ADC works on an
> > LPC1768, and actually how to properly use it.
> >
> > I am aware there has been a lot of discussions about it and I know NXP
> has
> > tried to calm things down by releasing AN10974 but still: it seems the
> ADC
> > is highly susceptible to any type of capacitive load connected to it. The
> > schematics that come with AN10974 suggest you should be able to connect
> > 10uF to an analog input.
> No, this is not written, it is written that a 10uF electrolytic
> capacitor (tantalum is better) should be used (better with a series
> inductor) to form a low pass decoupling filter. This means that a low
> pass LC filter should be connected very near the power supply input.
> Then you should place a 100nF ceramic capacitor very near to the analog
> positive power supply pin and connect the other pin to the analog power
> supply ground pin.

> Tried this and the ADC becomes unstable. Tried
> > several capacitor values, as soon as you connect anything higher than
> 100pF
> > spikes start appearing the reading (full scale errors).
> Normally this is a symptom of poor ADC power supply filtering and poor
> knowledge of ADC modules integrated on microcontrollers.
>
> Just to be clear: the error is to think that an 8 input ADC is a
> monolithic block exposing an high impedance on every input.
> This is not correct because the ADC block is made by a single input ADC
> connected to a sample and hold (SH) circuit connected to an analog 8
> channel demultiplexer. The ADC input that is not accessible outside the
> microcontroller has an high impedance value but this is not true for the
> demultiplexer that connects in turn the 8 analog inputs to the SH. So
> considering that SH circutis works well ONLY if the leakage current of
> its input capacitor (that is realized inside the microcontroller) is
> very low, it is not a good idea to connect in parallel with it an
> electrolytic capacitor that has the highest leakage current possible
> (especially if it is an Aluminum type). The leakage current of a 10 uF
> electrolytic capacitor should be in the order of several tenths of uA,
> instead the leakage current of a 100 nF ceramic capacitor is in the
> order of units of nA and for this reason when you connect a ceramic
> capacitor you don't see this problem.
> > This makes me
> > believe that the Cia value of 15pF in the datasheet in table 18 is
> actually
> > the maximum capacitor value that can be connected to an ADC input.
> No, Cia is the capacitance exposed by an analog pin to the external
> circuits; you have to think at it as if there is a 15pF capacitor
> connected just before the analog input pins and the ADC ground pin and
> take care of this designing your interface circuits. 15pF is the sum of
> the SH input capacitor and the input capacitance (in parallel to the SH
> capacitance because the series resistance of the demultiplexer channel
> is near null) of a single analog input of the demultiplexer.
> >
> > Mind you I have been testing this on an MBed, which doesn't necessarily
> > follow AN10974 layout guidelines. Nonetheless, the ADC conversions from
> an
> > MBed are very stable if no capacitor is connected to the ADC input.
> Technically speaking the problem is totally due to the electrolytic
> capacitor, your interface circuit (that I don't know) and ADC power
> supply filtering.
>
> I personally verify the LPC17xx ADC operations on Keil MCB1700,
> LpcXpresso-1769, mbed and LPC1788-SK (also some user reported the same
> problem on 1788 parts) to give a more objective results then NXP field
> engineers. The ADC is perfectly operational and connecting filters on
> the inputs its performance is also better. Until now I found problems
> due to poor design of the interface circuit and ADC analog inputs
> programming errors so the ADC performance is heavily influenced by
> engineers skill and expertise to design analog circuits.
>
> In my opinion placing a 10uF electrolytic Aluminum capacitor directly in
> parallel to an analog input pit is a poor design practice.
>
> The correct way to design an ADC interface circuit is to design an
> amplifier circuit (with a gain > 1 if needed) to interface and
> decoupling the input sensor to the ADC input possibly using an
> operational amplifier considering that it has a very low impedance
> output circuit. The amplifier circuit should also integrate an anti
> alias filtering capabilities and should be tailored specifically for the
> ADC conversion rate (lower then 1/2 of the conversion rate).
> >
> > Jean
> >
> >
> >
> >
> > On Tue, Oct 2, 2012 at 9:58 PM, misterhershel
> wrote:
> >
> >> **
> >>
> >>
> >> The sampling capacitor internal to the ADC is connected to the input,
> >> prior to a conversion. The state of charge on this capacitor, is
> >> transferred to the input circuitry.
> >>
> >> This can be a problem if the source impedance is high, because the
> >> conversion can start, before the source has a chance to charge the cap.
> >> This is also a problem when sampling multiple channels, because the
> >> resulting charge on the cap from one channel, is transferred to the
> source
> >> for the next channel.
> >>
> >> To make matters worse, there is no way to increase the delay between
> >> channel switching and start of conversion (other then slowing the
> >> conversion rate).
> >>
> >> For whatever reason, NXP has, as far as I can see, just about zero
> >> information on this subject.
> >>
> >> The MSP430 internal ADCs are similar, and explained in detail in the
> Texas
> >> Instrument docs.
> >>
> >> -Hershel
> >>
> >>
> >> --- In l..., Olivier Gautherot wrote:
> >>> Jean-Sastien,
> >>>
> >>> there is no theoretical limit for the capacitor connected to the input
> >> and
> >>> I would even recommend to put one if the signal you want to measure
> has a
> >>> high impedance (from the top of my head, NXP recommends an impedance of
> >> 2K
> >>> max or something like that). We built a test board in the office which
> >> has
> >>> a temperature sensor on ADC0 and the first tests reported measurements
> >> that
> >>> were clearly out of range. I eventually figured out that a second
> reading
> >>> would give the right value.
> >>>
> >>> We finally discovered that the temperature sensor had an output current
> >> of
> >>> 10uA max and had to be "buffered" with a small cap (0.1uF was
> sufficient
> >> in
> >>> this case). It seems that the internal analog switch has an effect on
> the
> >>> input pin impedance.
> >>>
> >>> Hope it helps
> >>> --
> >>> Olivier Gautherot
> >>> olivier@...
> >>> www.gautherot.net
> >>> http://www.linkedin.com/in/ogautherot
> >>>
> >>> On Wed, Sep 26, 2012 at 6:43 PM, k_erkens wrote:
> >>>
> >>>> **
> >>>>
> >>>>
> >>>> If im not mistaken, the value in the datasheet represents the internal
> >>>> capacitance of the chip.
> >>>> Because its an input you can probably put any value you want at the
> >> input.
> >>>> --
> >>>> Kevin
> >>>>
> >>>> --- In l..., Jean-Sebastien Stoezel
> >>>> wrote:
> >>>>> Hi:
> >>>>>
> >>>>> Looking at the datasheet of the LPC1768, it seems table 18 lists
> >> 15pF Cia
> >>>>> as the maximum input capacitance that can be connected to an analog
> >>>> input.
> >>>>> This seems rather small and limiting.
> >>>>> Looking at the board designed specifically for AN10974, the schematic
> >>>> shows
> >>>>> capacitors of 10uF and 0.1uF connected to the analog inputs...
> >>>>>
> >>>>> What is the actual maximum capacitance value that can be connected
> >> to the
> >>>>> input of an analog input, on an LPC1768?
> >>>>>
> >>>>> Thanks,
> >>>>> Jean
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
> >
> >
> >
> >
Il 03/10/2012 20:14, Jean-Sebastien Stoezel ha scritto:
>
>
> Re 10uF capacitor: look up the schematic that comes with AN10974.
>
I know perfectly that application note, there is no schematic but just a
sketch and it shows clearly that 10uF capacitor is a decoupling
capacitor on the positive power supply and that there is a 100nF
capacitor very near pin 8 of an 8 pin dip i.c. that usually is the
VCC/VDD pin.
So you are wrong.
>
> This is
> how it was designed by NXP to provide measurements on the ADC.
> Understood about using active filters. Not practical though when you want
> to have a gain <1 and do not necessarily want to run dual rail power
> supplies.
>
I don't see any problem both for gain and for power supply, you should
need a rail to rail operational amplifier, it is a common solution.

Please before to say that the ADC is not correctly designed check better
your design and your knowledge, you should improve your analogic design
capabilities. You should consider to use a good simulation tool as
should be LTSpice IV from Linear Technologies (that is free) and start
to design some active filter (there are some simple configurations with
a 0.707 gain) and band limited amplifiers.
> On Wed, Oct 3, 2012 at 12:30 PM, M. Manca
> > >wrote:
>
> > Il 03/10/2012 18:17, Jean-Sebastien Stoezel ha scritto:
> > > I have to say I am more and more confused by the way the ADC works
> on an
> > > LPC1768, and actually how to properly use it.
> > >
> > > I am aware there has been a lot of discussions about it and I know NXP
> > has
> > > tried to calm things down by releasing AN10974 but still: it seems the
> > ADC
> > > is highly susceptible to any type of capacitive load connected to
> it. The
> > > schematics that come with AN10974 suggest you should be able to
> connect
> > > 10uF to an analog input.
> > No, this is not written, it is written that a 10uF electrolytic
> > capacitor (tantalum is better) should be used (better with a series
> > inductor) to form a low pass decoupling filter. This means that a low
> > pass LC filter should be connected very near the power supply input.
> > Then you should place a 100nF ceramic capacitor very near to the analog
> > positive power supply pin and connect the other pin to the analog power
> > supply ground pin.
>
> > Tried this and the ADC becomes unstable. Tried
> > > several capacitor values, as soon as you connect anything higher than
> > 100pF
> > > spikes start appearing the reading (full scale errors).
> > Normally this is a symptom of poor ADC power supply filtering and poor
> > knowledge of ADC modules integrated on microcontrollers.
> >
> > Just to be clear: the error is to think that an 8 input ADC is a
> > monolithic block exposing an high impedance on every input.
> > This is not correct because the ADC block is made by a single input ADC
> > connected to a sample and hold (SH) circuit connected to an analog 8
> > channel demultiplexer. The ADC input that is not accessible outside the
> > microcontroller has an high impedance value but this is not true for the
> > demultiplexer that connects in turn the 8 analog inputs to the SH. So
> > considering that SH circutis works well ONLY if the leakage current of
> > its input capacitor (that is realized inside the microcontroller) is
> > very low, it is not a good idea to connect in parallel with it an
> > electrolytic capacitor that has the highest leakage current possible
> > (especially if it is an Aluminum type). The leakage current of a 10 uF
> > electrolytic capacitor should be in the order of several tenths of uA,
> > instead the leakage current of a 100 nF ceramic capacitor is in the
> > order of units of nA and for this reason when you connect a ceramic
> > capacitor you don't see this problem.
> > > This makes me
> > > believe that the Cia value of 15pF in the datasheet in table 18 is
> > actually
> > > the maximum capacitor value that can be connected to an ADC input.
> > No, Cia is the capacitance exposed by an analog pin to the external
> > circuits; you have to think at it as if there is a 15pF capacitor
> > connected just before the analog input pins and the ADC ground pin and
> > take care of this designing your interface circuits. 15pF is the sum of
> > the SH input capacitor and the input capacitance (in parallel to the SH
> > capacitance because the series resistance of the demultiplexer channel
> > is near null) of a single analog input of the demultiplexer.
> > >
> > > Mind you I have been testing this on an MBed, which doesn't
> necessarily
> > > follow AN10974 layout guidelines. Nonetheless, the ADC conversions
> from
> > an
> > > MBed are very stable if no capacitor is connected to the ADC input.
> > Technically speaking the problem is totally due to the electrolytic
> > capacitor, your interface circuit (that I don't know) and ADC power
> > supply filtering.
> >
> > I personally verify the LPC17xx ADC operations on Keil MCB1700,
> > LpcXpresso-1769, mbed and LPC1788-SK (also some user reported the same
> > problem on 1788 parts) to give a more objective results then NXP field
> > engineers. The ADC is perfectly operational and connecting filters on
> > the inputs its performance is also better. Until now I found problems
> > due to poor design of the interface circuit and ADC analog inputs
> > programming errors so the ADC performance is heavily influenced by
> > engineers skill and expertise to design analog circuits.
> >
> > In my opinion placing a 10uF electrolytic Aluminum capacitor directly in
> > parallel to an analog input pit is a poor design practice.
> >
> > The correct way to design an ADC interface circuit is to design an
> > amplifier circuit (with a gain > 1 if needed) to interface and
> > decoupling the input sensor to the ADC input possibly using an
> > operational amplifier considering that it has a very low impedance
> > output circuit. The amplifier circuit should also integrate an anti
> > alias filtering capabilities and should be tailored specifically for the
> > ADC conversion rate (lower then 1/2 of the conversion rate).
> > >
> > > Jean
> > >
> > >
> > >
> > >
> > > On Tue, Oct 2, 2012 at 9:58 PM, misterhershel
> >
> > wrote:
> > >
> > >> **
> > >>
> > >>
> > >> The sampling capacitor internal to the ADC is connected to the input,
> > >> prior to a conversion. The state of charge on this capacitor, is
> > >> transferred to the input circuitry.
> > >>
> > >> This can be a problem if the source impedance is high, because the
> > >> conversion can start, before the source has a chance to charge
> the cap.
> > >> This is also a problem when sampling multiple channels, because the
> > >> resulting charge on the cap from one channel, is transferred to the
> > source
> > >> for the next channel.
> > >>
> > >> To make matters worse, there is no way to increase the delay between
> > >> channel switching and start of conversion (other then slowing the
> > >> conversion rate).
> > >>
> > >> For whatever reason, NXP has, as far as I can see, just about zero
> > >> information on this subject.
> > >>
> > >> The MSP430 internal ADCs are similar, and explained in detail in the
> > Texas
> > >> Instrument docs.
> > >>
> > >> -Hershel
> > >>
> > >>
> > >> --- In l...
> , Olivier Gautherot wrote:
> > >>> Jean-Sastien,
> > >>>
> > >>> there is no theoretical limit for the capacitor connected to the
> input
> > >> and
> > >>> I would even recommend to put one if the signal you want to measure
> > has a
> > >>> high impedance (from the top of my head, NXP recommends an
> impedance of
> > >> 2K
> > >>> max or something like that). We built a test board in the office
> which
> > >> has
> > >>> a temperature sensor on ADC0 and the first tests reported
> measurements
> > >> that
> > >>> were clearly out of range. I eventually figured out that a second
> > reading
> > >>> would give the right value.
> > >>>
> > >>> We finally discovered that the temperature sensor had an output
> current
> > >> of
> > >>> 10uA max and had to be "buffered" with a small cap (0.1uF was
> > sufficient
> > >> in
> > >>> this case). It seems that the internal analog switch has an
> effect on
> > the
> > >>> input pin impedance.
> > >>>
> > >>> Hope it helps
> > >>> --
> > >>> Olivier Gautherot
> > >>> olivier@...
> > >>> www.gautherot.net
> > >>> http://www.linkedin.com/in/ogautherot
> > >>>
> > >>> On Wed, Sep 26, 2012 at 6:43 PM, k_erkens wrote:
> > >>>
> > >>>> **
> > >>>>
> > >>>>
> > >>>> If im not mistaken, the value in the datasheet represents the
> internal
> > >>>> capacitance of the chip.
> > >>>> Because its an input you can probably put any value you want at the
> > >> input.
> > >>>> --
> > >>>> Kevin
> > >>>>
> > >>>> --- In l...
> , Jean-Sebastien Stoezel
> > >>>> wrote:
> > >>>>> Hi:
> > >>>>>
> > >>>>> Looking at the datasheet of the LPC1768, it seems table 18 lists
> > >> 15pF Cia
> > >>>>> as the maximum input capacitance that can be connected to an
> analog
> > >>>> input.
> > >>>>> This seems rather small and limiting.
> > >>>>> Looking at the board designed specifically for AN10974, the
> schematic
> > >>>> shows
> > >>>>> capacitors of 10uF and 0.1uF connected to the analog inputs...
> > >>>>>
> > >>>>> What is the actual maximum capacitance value that can be connected
> > >> to the
> > >>>>> input of an analog input, on an LPC1768?
> > >>>>>
> > >>>>> Thanks,
> > >>>>> Jean
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
Schematic attached, check page 2.

On Wed, Oct 3, 2012 at 2:30 PM, M. Manca wrote:

> **
> Il 03/10/2012 20:14, Jean-Sebastien Stoezel ha scritto:
>
> >
> >
> > Re 10uF capacitor: look up the schematic that comes with AN10974.
> >
> I know perfectly that application note, there is no schematic but just a
> sketch and it shows clearly that 10uF capacitor is a decoupling
> capacitor on the positive power supply and that there is a 100nF
> capacitor very near pin 8 of an 8 pin dip i.c. that usually is the
> VCC/VDD pin.
> So you are wrong.
>
> >
> > This is
> > how it was designed by NXP to provide measurements on the ADC.
> > Understood about using active filters. Not practical though when you want
> > to have a gain <1 and do not necessarily want to run dual rail power
> > supplies.
> >
> I don't see any problem both for gain and for power supply, you should
> need a rail to rail operational amplifier, it is a common solution.
>
> Please before to say that the ADC is not correctly designed check better
> your design and your knowledge, you should improve your analogic design
> capabilities. You should consider to use a good simulation tool as
> should be LTSpice IV from Linear Technologies (that is free) and start
> to design some active filter (there are some simple configurations with
> a 0.707 gain) and band limited amplifiers.
>
> >
> >
> > On Wed, Oct 3, 2012 at 12:30 PM, M. Manca
> > > > >wrote:
>
> >
> > > Il 03/10/2012 18:17, Jean-Sebastien Stoezel ha scritto:
> > > > I have to say I am more and more confused by the way the ADC works
> > on an
> > > > LPC1768, and actually how to properly use it.
> > > >
> > > > I am aware there has been a lot of discussions about it and I know
> NXP
> > > has
> > > > tried to calm things down by releasing AN10974 but still: it seems
> the
> > > ADC
> > > > is highly susceptible to any type of capacitive load connected to
> > it. The
> > > > schematics that come with AN10974 suggest you should be able to
> > connect
> > > > 10uF to an analog input.
> > > No, this is not written, it is written that a 10uF electrolytic
> > > capacitor (tantalum is better) should be used (better with a series
> > > inductor) to form a low pass decoupling filter. This means that a low
> > > pass LC filter should be connected very near the power supply input.
> > > Then you should place a 100nF ceramic capacitor very near to the analog
> > > positive power supply pin and connect the other pin to the analog power
> > > supply ground pin.
> >
> > > Tried this and the ADC becomes unstable. Tried
> > > > several capacitor values, as soon as you connect anything higher than
> > > 100pF
> > > > spikes start appearing the reading (full scale errors).
> > > Normally this is a symptom of poor ADC power supply filtering and poor
> > > knowledge of ADC modules integrated on microcontrollers.
> > >
> > > Just to be clear: the error is to think that an 8 input ADC is a
> > > monolithic block exposing an high impedance on every input.
> > > This is not correct because the ADC block is made by a single input ADC
> > > connected to a sample and hold (SH) circuit connected to an analog 8
> > > channel demultiplexer. The ADC input that is not accessible outside the
> > > microcontroller has an high impedance value but this is not true for
> the
> > > demultiplexer that connects in turn the 8 analog inputs to the SH. So
> > > considering that SH circutis works well ONLY if the leakage current of
> > > its input capacitor (that is realized inside the microcontroller) is
> > > very low, it is not a good idea to connect in parallel with it an
> > > electrolytic capacitor that has the highest leakage current possible
> > > (especially if it is an Aluminum type). The leakage current of a 10 uF
> > > electrolytic capacitor should be in the order of several tenths of uA,
> > > instead the leakage current of a 100 nF ceramic capacitor is in the
> > > order of units of nA and for this reason when you connect a ceramic
> > > capacitor you don't see this problem.
> > > > This makes me
> > > > believe that the Cia value of 15pF in the datasheet in table 18 is
> > > actually
> > > > the maximum capacitor value that can be connected to an ADC input.
> > > No, Cia is the capacitance exposed by an analog pin to the external
> > > circuits; you have to think at it as if there is a 15pF capacitor
> > > connected just before the analog input pins and the ADC ground pin and
> > > take care of this designing your interface circuits. 15pF is the sum of
> > > the SH input capacitor and the input capacitance (in parallel to the SH
> > > capacitance because the series resistance of the demultiplexer channel
> > > is near null) of a single analog input of the demultiplexer.
> > > >
> > > > Mind you I have been testing this on an MBed, which doesn't
> > necessarily
> > > > follow AN10974 layout guidelines. Nonetheless, the ADC conversions
> > from
> > > an
> > > > MBed are very stable if no capacitor is connected to the ADC input.
> > > Technically speaking the problem is totally due to the electrolytic
> > > capacitor, your interface circuit (that I don't know) and ADC power
> > > supply filtering.
> > >
> > > I personally verify the LPC17xx ADC operations on Keil MCB1700,
> > > LpcXpresso-1769, mbed and LPC1788-SK (also some user reported the same
> > > problem on 1788 parts) to give a more objective results then NXP field
> > > engineers. The ADC is perfectly operational and connecting filters on
> > > the inputs its performance is also better. Until now I found problems
> > > due to poor design of the interface circuit and ADC analog inputs
> > > programming errors so the ADC performance is heavily influenced by
> > > engineers skill and expertise to design analog circuits.
> > >
> > > In my opinion placing a 10uF electrolytic Aluminum capacitor directly
> in
> > > parallel to an analog input pit is a poor design practice.
> > >
> > > The correct way to design an ADC interface circuit is to design an
> > > amplifier circuit (with a gain > 1 if needed) to interface and
> > > decoupling the input sensor to the ADC input possibly using an
> > > operational amplifier considering that it has a very low impedance
> > > output circuit. The amplifier circuit should also integrate an anti
> > > alias filtering capabilities and should be tailored specifically for
> the
> > > ADC conversion rate (lower then 1/2 of the conversion rate).
> > > >
> > > > Jean
> > > >
> > > >
> > > >
> > > >
> > > > On Tue, Oct 2, 2012 at 9:58 PM, misterhershel
> > > > > wrote:
> > > >
> > > >> **
> > > >>
> > > >>
> > > >> The sampling capacitor internal to the ADC is connected to the
> input,
> > > >> prior to a conversion. The state of charge on this capacitor, is
> > > >> transferred to the input circuitry.
> > > >>
> > > >> This can be a problem if the source impedance is high, because the
> > > >> conversion can start, before the source has a chance to charge
> > the cap.
> > > >> This is also a problem when sampling multiple channels, because the
> > > >> resulting charge on the cap from one channel, is transferred to the
> > > source
> > > >> for the next channel.
> > > >>
> > > >> To make matters worse, there is no way to increase the delay between
> > > >> channel switching and start of conversion (other then slowing the
> > > >> conversion rate).
> > > >>
> > > >> For whatever reason, NXP has, as far as I can see, just about zero
> > > >> information on this subject.
> > > >>
> > > >> The MSP430 internal ADCs are similar, and explained in detail in the
> > > Texas
> > > >> Instrument docs.
> > > >>
> > > >> -Hershel
> > > >>
> > > >>
> > > >> --- In l...
> > , Olivier Gautherot
> wrote:
> > > >>> Jean-Sastien,
> > > >>>
> > > >>> there is no theoretical limit for the capacitor connected to the
> > input
> > > >> and
> > > >>> I would even recommend to put one if the signal you want to measure
> > > has a
> > > >>> high impedance (from the top of my head, NXP recommends an
> > impedance of
> > > >> 2K
> > > >>> max or something like that). We built a test board in the office
> > which
> > > >> has
> > > >>> a temperature sensor on ADC0 and the first tests reported
> > measurements
> > > >> that
> > > >>> were clearly out of range. I eventually figured out that a second
> > > reading
> > > >>> would give the right value.
> > > >>>
> > > >>> We finally discovered that the temperature sensor had an output
> > current
> > > >> of
> > > >>> 10uA max and had to be "buffered" with a small cap (0.1uF was
> > > sufficient
> > > >> in
> > > >>> this case). It seems that the internal analog switch has an
> > effect on
> > > the
> > > >>> input pin impedance.
> > > >>>
> > > >>> Hope it helps
> > > >>> --
> > > >>> Olivier Gautherot
> > > >>> olivier@...
> > > >>> www.gautherot.net
> > > >>> http://www.linkedin.com/in/ogautherot
> > > >>>
> > > >>> On Wed, Sep 26, 2012 at 6:43 PM, k_erkens wrote:
> > > >>>
> > > >>>> **
> > > >>>>
> > > >>>>
> > > >>>> If im not mistaken, the value in the datasheet represents the
> > internal
> > > >>>> capacitance of the chip.
> > > >>>> Because its an input you can probably put any value you want at
> the
> > > >> input.
> > > >>>> --
> > > >>>> Kevin
> > > >>>>
> > > >>>> --- In l...
> > , Jean-Sebastien Stoezel > > >>>> wrote:
> > > >>>>> Hi:
> > > >>>>>
> > > >>>>> Looking at the datasheet of the LPC1768, it seems table 18 lists
> > > >> 15pF Cia
> > > >>>>> as the maximum input capacitance that can be connected to an
> > analog
> > > >>>> input.
> > > >>>>> This seems rather small and limiting.
> > > >>>>> Looking at the board designed specifically for AN10974, the
> > schematic
> > > >>>> shows
> > > >>>>> capacitors of 10uF and 0.1uF connected to the analog inputs...
> > > >>>>>
> > > >>>>> What is the actual maximum capacitance value that can be
> connected
> > > >> to the
> > > >>>>> input of an analog input, on an LPC1768?
> > > >>>>>
> > > >>>>> Thanks,
> > > >>>>> Jean
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>
> > > >>>>
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >