Maker Pro
Maker Pro

adc reading errors

Dear all,

I have problems on reading the ADS8326 16bit ADC, 250ksps output. The
uP reads the ADC Dout continuously at the moment, and each time the
reading is different although the input is a constant DC voltage.
There is a Instrument amp at the front end of the ADC input, and I put
some of the decouple caps in,e.g., the In+ , Vref, Vcc, etc. The Vref
is connected to the Opamp output.

I am not sure if it the the ground bouncing noise cause problem or
not. All components are on the breadboard, but they have digital
ground and analog gound seperately.

Can someone give me some ideas?

Many Thanks
 
J

John Larkin

Jan 1, 1970
0
Dear all,

I have problems on reading the ADS8326 16bit ADC, 250ksps output. The
uP reads the ADC Dout continuously at the moment, and each time the
reading is different although the input is a constant DC voltage.
There is a Instrument amp at the front end of the ADC input, and I put
some of the decouple caps in,e.g., the In+ , Vref, Vcc, etc. The Vref
is connected to the Opamp output.

I am not sure if it the the ground bouncing noise cause problem or
not. All components are on the breadboard, but they have digital
ground and analog gound seperately.

Can someone give me some ideas?

Many Thanks

How much variation are you seeing? In real life, a fast 16 bit ADC
will never deliver constant codes.

What kind of amp are you using, and what's its gain?

Lowpass filtering between the amp and the adc will help, if you can
stand some reduction in signal bandwidth.

What do you mean by "The Vref is connected to the Opamp output." ?

Is this one of those plastic breadboards? They're bad for this sort of
thing. And separating analog and digital grounds is usually bad, too.

John
 
Hello! John,
Thanks for your reply.

The amp is the instrument amplifier INA128. And I just put the +1.6V
signal to its in+, and the in- connected to the analog V-. The Ref pin
of INA128 is connected to the +2.5V after a Opamp. The Vout of the
INA128 goes to +4.1V, which I measured via a multimeter to confirm it
too. Gain=1. I did put 10Ohm and 1nF low pass filter for the ADC
input signal.

Lots of variations I see, not just 1-3 LSB variations, even the MSB
too. not sure if the uP read the code correctly or because of the
circuit noise etc.

What do you mean by "The Vref is connected to the Opamp output." ?
--- The Vref of the ADC need a low impedance.

They are plastic breadboards. What should I do? Make a PCB instead of
working on the breadboards?

Would the noise make such big difference on every bits?

Cheers,
 
J

John Larkin

Jan 1, 1970
0
Hello! John,
Thanks for your reply.

The amp is the instrument amplifier INA128. And I just put the +1.6V
signal to its in+, and the in- connected to the analog V-. The Ref pin
of INA128 is connected to the +2.5V after a Opamp. The Vout of the
INA128 goes to +4.1V, which I measured via a multimeter to confirm it
too. Gain=1. I did put 10Ohm and 1nF low pass filter for the ADC
input signal.

Lots of variations I see, not just 1-3 LSB variations, even the MSB
too. not sure if the uP read the code correctly or because of the
circuit noise etc.

What do you mean by "The Vref is connected to the Opamp output." ?
--- The Vref of the ADC need a low impedance.

They are plastic breadboards. What should I do? Make a PCB instead of
working on the breadboards?

Would the noise make such big difference on every bits?

Cheers,

B-B claims 3 lsb's p-p noise, which is pretty impressive. The INA128
will add seome of its own, but nothing radical. If you're seeing codes
all over the place, something is bad wrong.

Try grounding the ADC inputs and see what you get. You may have a
clocking problem or something. How are you getting the codes out of
the adc?

I usually lay out a board to do anything complex, but this case is
simple enough that you could still do it by hand. I like to get a
sheet of bare copperclad FR4 and build breadboards directly on the
(single!) ground plane, with axial passives, wire, and little
commercial adapter boards to break out surface-mount parts. That can
do very low noise stuff.

John
 
J

John Devereux

Jan 1, 1970
0
Hello! John,
Thanks for your reply.

The amp is the instrument amplifier INA128. And I just put the +1.6V
signal to its in+, and the in- connected to the analog V-. The Ref pin
of INA128 is connected to the +2.5V after a Opamp. The Vout of the
INA128 goes to +4.1V, which I measured via a multimeter to confirm it
too. Gain=1. I did put 10Ohm and 1nF low pass filter for the ADC
input signal.

Lots of variations I see, not just 1-3 LSB variations, even the MSB
too. not sure if the uP read the code correctly or because of the
circuit noise etc.

You could be reading the serial interface incorrectly, for example
reading each bit on the wrong edge of the clock so that the data is
changing at that instant. SPI interfaces have a "clock polarity" and a
"clock phase" setting; both these must match the ADC.

Look at the serial output on a scope and see if you still see the MSB
transitions then. I bet you don't. But if you do, remove the amplifier
and try shorting the ADC inputs to ground. Check you have the correct
supplies and reference voltage (you could connect the reference to the
positive supply if unsure).
What do you mean by "The Vref is connected to the Opamp output." ?
--- The Vref of the ADC need a low impedance.

They are plastic breadboards. What should I do? Make a PCB instead of
working on the breadboards?

I would use the "dead bug" prototyping method on plain copper clad PCB
material. (Or make a real PCB). You may also be able to buy an
evaluation board for the chip from the manufacturer, use it as a
starting point.
Would the noise make such big difference on every bits?

No.
 
B-B claims 3 lsb's p-p noise, which is pretty impressive. The INA128
will add seome of its own, but nothing radical. If you're seeing codes
all over the place, something is bad wrong.

Try grounding the ADC inputs and see what you get. You may have a
clocking problem or something. How are you getting the codes out of
the adc?

I usually lay out a board to do anything complex, but this case is
simple enough that you could still do it by hand. I like to get a
sheet of bare copperclad FR4 and build breadboards directly on the
(single!) ground plane, with axial passives, wire, and little
commercial adapter boards to break out surface-mount parts. That can
do very low noise stuff.

John

Thanks, John.
I tried a ground plane on a sheet metal, which is actually the base of
one of the breadboard I have. Now what uP got from ADC were almost all
zeros, as I had before.
I got all the ADC input zero when I use the C compiler build in SPI
function, and I thought it might be something wrong on the code, I
then changed the code to something like the following, not using any
built-in function. Afterwards I was able to read in different wrong
ADC input every time. Then I seperate the analog and digital ground,
not much help. Now I added in a metal plane as a ground plane, and the
readings are almost all zero.

Each instruction takes about 0.25usec, i.e., the ADC sampling rate is
about 4M, below its max. 6Mhz.

output_low(ADC_CS); //Enable ADC
for (i=0; i<6; i++){ //ADC conversion time, for 5 clock +
1clock
output_low(SCLK_Pin);
output_high(SCLK_Pin);
}
for (i=0; i<16; i++){ // read in ADC data
output_low(SCLK_Pin);
output_high(SCLK_Pin);
copy(ADCin_pin,buffer);
}

output_high(ADC_CS); //Disable ADC
 
J

John Larkin

Jan 1, 1970
0
B-B claims 3 lsb's p-p noise, which is pretty impressive. The INA128
will add seome of its own, but nothing radical. If you're seeing codes
all over the place, something is bad wrong.

Try grounding the ADC inputs and see what you get. You may have a
clocking problem or something. How are you getting the codes out of
the adc?

I usually lay out a board to do anything complex, but this case is
simple enough that you could still do it by hand. I like to get a
sheet of bare copperclad FR4 and build breadboards directly on the
(single!) ground plane, with axial passives, wire, and little
commercial adapter boards to break out surface-mount parts. That can
do very low noise stuff.

John

Thanks, John.
I tried a ground plane on a sheet metal, which is actually the base of
one of the breadboard I have. Now what uP got from ADC were almost all
zeros, as I had before.
I got all the ADC input zero when I use the C compiler build in SPI
function, and I thought it might be something wrong on the code, I
then changed the code to something like the following, not using any
built-in function. Afterwards I was able to read in different wrong
ADC input every time. Then I seperate the analog and digital ground,
not much help. Now I added in a metal plane as a ground plane, and the
readings are almost all zero.

Each instruction takes about 0.25usec, i.e., the ADC sampling rate is
about 4M, below its max. 6Mhz.

output_low(ADC_CS); //Enable ADC
for (i=0; i<6; i++){ //ADC conversion time, for 5 clock +
1clock
output_low(SCLK_Pin);
output_high(SCLK_Pin);
}
for (i=0; i<16; i++){ // read in ADC data
output_low(SCLK_Pin);
output_high(SCLK_Pin);
copy(ADCin_pin,buffer);
}

output_high(ADC_CS); //Disable ADC


OK, but what's the electrical setup? Is this a PC or a pic or what?
What sort of electrical port are you using, and how is it physically
wired to the adc? A little clock ringing or such could be bad. Have
you scoped the digital lines?

John
 
Hi! John,
It is a PIC18F452, and the PIN_C3 and C4 (SPI/SCLK/Din) are used for
sclk and data input. PIN-B7 is used for CS pin. Flying leads are used
to physically connect them.
I haven't got a scope on hand now.
 
Top