AD converters
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
> I measured the battery pack's which powers the circuit voltage as
> 5.3V (+/-0.05V)
> I constructed a potential divider from two low tolerance but measured
> resistors, 16K5 (+/-1K) and 80K (+/-5K). The voltage at the the non-
> ground side of the 16K5 resistor (the non 5.3V side of the 80K
> resistor) was measured to be 0.8V(+/-0.05V). The ground of the
> ARMmite was connected to negative terminal of the battery pack.
Actually what your example showed was +/- 0.35%, +/-3.5 counts (each
one is 128).
So you're not far off what I've measured, which was +/- 0.15%. I also
used a battery with a resistor divider as an input (probably
equivalent impedance a little lower). Make sure to keep the wires
short. And in addition use a bench power supply, so the PC supply was
only coupled in through the diode capacitance.
> 5.3V (+/-0.05V)
> I constructed a potential divider from two low tolerance but measured
> resistors, 16K5 (+/-1K) and 80K (+/-5K). The voltage at the the non-
> ground side of the 16K5 resistor (the non 5.3V side of the 80K
> resistor) was measured to be 0.8V(+/-0.05V). The ground of the
> ARMmite was connected to negative terminal of the battery pack.
Actually what your example showed was +/- 0.35%, +/-3.5 counts (each
one is 128).
So you're not far off what I've measured, which was +/- 0.15%. I also
used a battery with a resistor divider as an input (probably
equivalent impedance a little lower). Make sure to keep the wires
short. And in addition use a bench power supply, so the PC supply was
only coupled in through the diode capacitance.
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
Hi
I'm also very disappointed in the A/D performance. It seems that the
sample and hold aperture varies from sample to sample. This produces
data that is really only useful to 8 bits. I have been using Pics for
applications exactly like yours and found them to be very accurate. My
ArmExpress has a pattern of every 4th reading being way off. I get
around this problem by sending the data to Excell and passing a
running average of four over it. This smooths the data but I'm not
very happy with it. You can divide each of your readings by 4 to get
the equivalent 8 bit value. This will be more stable but of course you
lose precision. Unfortunately,I'm about to abandon the Armexpress for
this reason.
I hope we'll hear from others who have attempted to get 10 bit out of
the A/D.
Pete
I'm also very disappointed in the A/D performance. It seems that the
sample and hold aperture varies from sample to sample. This produces
data that is really only useful to 8 bits. I have been using Pics for
applications exactly like yours and found them to be very accurate. My
ArmExpress has a pattern of every 4th reading being way off. I get
around this problem by sending the data to Excell and passing a
running average of four over it. This smooths the data but I'm not
very happy with it. You can divide each of your readings by 4 to get
the equivalent 8 bit value. This will be more stable but of course you
lose precision. Unfortunately,I'm about to abandon the Armexpress for
this reason.
I hope we'll hear from others who have attempted to get 10 bit out of
the A/D.
Pete
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
> 19008
...
> 19520
> 19072
> 19904
> 19008
Actually I was a little sloppy with my calculator (my head). The A/D
values was 297 to 311 (plus or minus 7). This is a little
higher/noisier than the board is capable of.
Accuracy in terms of percentages, has to be done in terms of the 3.3V
reference. For instance if you were measuring 0.01 V, with a single
bit being 0.003 V. A reading of 0.013 and 0.007 while just 1 bit,
looks like a big percentage.
So in general, keep the leads short (they make good antennas), use a
good power supply (PC is not). Maybe put a cap across the resistor
divider.
...
> 19520
> 19072
> 19904
> 19008
Actually I was a little sloppy with my calculator (my head). The A/D
values was 297 to 311 (plus or minus 7). This is a little
higher/noisier than the board is capable of.
Accuracy in terms of percentages, has to be done in terms of the 3.3V
reference. For instance if you were measuring 0.01 V, with a single
bit being 0.003 V. A reading of 0.013 and 0.007 while just 1 bit,
looks like a big percentage.
So in general, keep the leads short (they make good antennas), use a
good power supply (PC is not). Maybe put a cap across the resistor
divider.
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
>DO
>A = AD(2) ' A to D pin 2
>WAIT(10) ' wait ten milliseconds
>PRINT A
>UNTIL 0 ' loop forever
In addition, you might put the WAIT before the A/D conversion.
Remember this is a 60 MHz CPU running on the same silicon as the A/D
and the pad ring supply is shared with the analog reference, though it
is filtered.
The wait will minimize crosstalk from IOs changing on the die (your
PRINT statement)
>A = AD(2) ' A to D pin 2
>WAIT(10) ' wait ten milliseconds
>PRINT A
>UNTIL 0 ' loop forever
In addition, you might put the WAIT before the A/D conversion.
Remember this is a 60 MHz CPU running on the same silicon as the A/D
and the pad ring supply is shared with the analog reference, though it
is filtered.
The wait will minimize crosstalk from IOs changing on the die (your
PRINT statement)
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
Ok so I only eyeballed the spread in values (smallest to biggest)
which was about 19000 to 19800 at the most. But should we be be
talking statistics here or one-off values ? Thee is no reason I can
see for a fluctation that big - all the measurements shoul lie within
1 (possibly 2) step ie 64 (128) of each other. They do not. The
spread is more like 800, which is more than 10 steps.
As this was a dc measurement what need is there to keep wires short ?
The wires connecting all power/grounds and ARMmite to circuit were
about 0.5m.
The board was powered from the (PC) USB of course, but the voltage in
potential divider was from a completely separate battery, not a mains
connected bench power supply.
Ed
which was about 19000 to 19800 at the most. But should we be be
talking statistics here or one-off values ? Thee is no reason I can
see for a fluctation that big - all the measurements shoul lie within
1 (possibly 2) step ie 64 (128) of each other. They do not. The
spread is more like 800, which is more than 10 steps.
As this was a dc measurement what need is there to keep wires short ?
The wires connecting all power/grounds and ARMmite to circuit were
about 0.5m.
The board was powered from the (PC) USB of course, but the voltage in
potential divider was from a completely separate battery, not a mains
connected bench power supply.
Ed
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
The extreme values captured by the A/D were 19904 and 19008 (that I
showed). This is a spread of 100 * 896 / 19904 = 4.5% with no higher
precision than 100 * 64 / 19908 = 0.32% expected (top 10 bits in 16
bits resolution). The 3.3 volts is irrelevant.
Where did the 297 and 311 come from ?
I'm not knowledgeable about antennas & all that RF stuff (except that
it always crops up in areas where you don't want it and otherwise you
have a duff TV picture because you antenna "is the wrong type" LoL)
Ed
showed). This is a spread of 100 * 896 / 19904 = 4.5% with no higher
precision than 100 * 64 / 19908 = 0.32% expected (top 10 bits in 16
bits resolution). The 3.3 volts is irrelevant.
Where did the 297 and 311 come from ?
I'm not knowledgeable about antennas & all that RF stuff (except that
it always crops up in areas where you don't want it and otherwise you
have a duff TV picture because you antenna "is the wrong type" LoL)
Ed
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
> Ok so I only eyeballed the spread in values (smallest to biggest)
> which was about 19000 to 19800 at the most. But should we be be
> talking statistics here or one-off values ? Thee is no reason I can
> see for a fluctation that big - all the measurements shoul lie
within
> 1 (possibly 2) step ie 64 (128) of each other. They do not. The
> spread is more like 800, which is more than 10 steps.
You are seeing 30 mV of noise, so where does that come from--
> As this was a dc measurement what need is there to keep wires
short ?
> The wires connecting all power/grounds and ARMmite to circuit were
> about 0.5m.
A 0.5m wire is VERY long, and with 100K impedance makes a pretty good
antenna, picking up 100/120 Hz flourescent light buzz, 900 MHz WiFi,
cell phones, other stuff. Unless you're inside a Faraday cage you're
not really living in a DC world.
>
> The board was powered from the (PC) USB of course, but the voltage
in
> potential divider was from a completely separate battery, not a
mains
> connected bench power supply.
The PC power supply is an extremely noisy switcher, and some of that
noise will get coupled into the analog reference. By using a bench
supply (> 6V) the PC supply is isolated, by a back biased diode
(which is still a small noise contributor)
With a 3.3V reference, a single tick of the A/D is only 3mV. Which
is a pretty small voltage, and pretty easy to see that and a lot more
in a digital environment. Your meter won't see that as it averages a
lot of readings, but you'll easily see it on a scope.
> which was about 19000 to 19800 at the most. But should we be be
> talking statistics here or one-off values ? Thee is no reason I can
> see for a fluctation that big - all the measurements shoul lie
within
> 1 (possibly 2) step ie 64 (128) of each other. They do not. The
> spread is more like 800, which is more than 10 steps.
You are seeing 30 mV of noise, so where does that come from--
> As this was a dc measurement what need is there to keep wires
short ?
> The wires connecting all power/grounds and ARMmite to circuit were
> about 0.5m.
A 0.5m wire is VERY long, and with 100K impedance makes a pretty good
antenna, picking up 100/120 Hz flourescent light buzz, 900 MHz WiFi,
cell phones, other stuff. Unless you're inside a Faraday cage you're
not really living in a DC world.
>
> The board was powered from the (PC) USB of course, but the voltage
in
> potential divider was from a completely separate battery, not a
mains
> connected bench power supply.
The PC power supply is an extremely noisy switcher, and some of that
noise will get coupled into the analog reference. By using a bench
supply (> 6V) the PC supply is isolated, by a back biased diode
(which is still a small noise contributor)
With a 3.3V reference, a single tick of the A/D is only 3mV. Which
is a pretty small voltage, and pretty easy to see that and a lot more
in a digital environment. Your meter won't see that as it averages a
lot of readings, but you'll easily see it on a scope.
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
> I'm also very disappointed in the A/D performance. It seems that the
> sample and hold aperture varies from sample to sample. This produces
> data that is really only useful to 8 bits.
The ARMexpress and ARMexpressLITE are pretty space constrained. In the
original design to get everything onto the stamp sized board, VDDa and
VDD were tied together and share a single cap. I have not run an
experiment to see how good I could get A/D readings on those boards,
but 8 bit accuracy wouldn't surprise me.
But I have run that experiment on the ARMmite and was able to achieve a
repeated A/D readings within a range of 3 ticks of the A/D. This
corresponds to better than 9mV. The ARMmite does have a dedicated RC
filter on the VDDa pin, as does the wireless version and the ARMweb.
> sample and hold aperture varies from sample to sample. This produces
> data that is really only useful to 8 bits.
The ARMexpress and ARMexpressLITE are pretty space constrained. In the
original design to get everything onto the stamp sized board, VDDa and
VDD were tied together and share a single cap. I have not run an
experiment to see how good I could get A/D readings on those boards,
but 8 bit accuracy wouldn't surprise me.
But I have run that experiment on the ARMmite and was able to achieve a
repeated A/D readings within a range of 3 ticks of the A/D. This
corresponds to better than 9mV. The ARMmite does have a dedicated RC
filter on the VDDa pin, as does the wireless version and the ARMweb.
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
Thanks for these comments, which I understand.
I infer from what you say that if I used smaller resistors in
potential divider (like 10 or 20 times smaller) the probllem would be
less severe.
My other problem is that I don't have a 'scope, and this is my
attempt at making one !
Ed
I infer from what you say that if I used smaller resistors in
potential divider (like 10 or 20 times smaller) the probllem would be
less severe.
My other problem is that I don't have a 'scope, and this is my
attempt at making one !
Ed
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD converters
Smaller resistors would help, maybe more important is put the resistors
on the ARMmite board, and keep the leads short. Also choose values of
resistors so the max battery voltage after dividing is 3V or so.
You might also try a small ceramic cap across the measured voltage.
This will also average the noise out a bit. A big electrolytic cap is
useless for this purpose, as the internal resistance is so high it
looks like an open circuit at whatever the prevalent noise frequencies
are.
on the ARMmite board, and keep the leads short. Also choose values of
resistors so the max battery voltage after dividing is 3V or so.
You might also try a small ceramic cap across the measured voltage.
This will also average the noise out a bit. A big electrolytic cap is
useless for this purpose, as the internal resistance is so high it
looks like an open circuit at whatever the prevalent noise frequencies
are.