SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Mach3Maelstrom
#162398
I've been troubleshooting this ADC and been making no progress.

The situation: I have a few boards with this 12-bit parallel output ADC in my board design. This ADC receives voltage from an op amp and sends the digital lines to a CPLD.

Even if my Vin value is zero volts, the LSB on a few ADCs is stuck at HIGH output. No matter what I try, I cannot get the LSB to go low ever again.

I've tried the following:
  • Lifting the ADC LSB pin and checking to see if the net itself is accidentally being pulled high by another device. It's not - it's the LSB pin going HIGH.
  • Lifting the Vin pin and shorting it to analog ground, to eliminate noise as a variable. It's not - LSB pin is still HIGH.
  • Reflashing the CPLD based on the code that working boards are using. LSB pin is still HIGH.
  • On a few other boards, the ADC works perfectly - output of 0 when input is 0, etc. I've compared the state of the ADC pins on a working board with the non-working board - all of the pins are the same configuration (HIGH, LOW, 2.5V, etc) EXCEPT for the LSB, which remains HIGH on the non-working board and LOW on the working boards.
Do I just have a bad batch of ADCs installed on my boards or am I forgetting something even simpler?

I've used up my spare ADCs, so I can't swap the ADC on the non-working board out yet. Unless someone suggests otherwise, I may just desolder the ADCs on a working board vs a non-working board, swap them, and resolder the parts and see what happens. But since that's really time consuming and risky with lead-free solder, I'd really prefer not to do this :?

I appreciate any help you can offer me. Thanks in advance!

ADC Datasheet: http://goo.gl/gdzzCz
By waltr
#162401
ADS7820UB adc.
That link is not to a true data sheet but this one is:
http://www.ti.com/lit/ds/sbas047/sbas047.pdf

Next I think we will need a complete schematic on the circuit (including all ADC connection, decoupling caps, etc).
Questions:
1- How clean is the power supply? Is it totally free of any glitches and spikes? These can kill chips.
2- Is there any over Voltage protect on the ADC input? Over Voltage can kill a chip.
3- what Voltage range should be on the ADC input?
4- Has a conversion been done? Outputs are not valid until a convert finishes.
5- Did you take ~CS (pin 25) high to see if the outputs tri-state?
6- Is the ADC in Byte or word output mode?
7- Is BUSY going low during a conversion then high?
8- Did you verify the signals and timing per Figure 3 of the DS.
9- Did you follow to guidelines in the Layout section of the DS?
10- Is the ADC getting hot or overly warm? Have you measured its current draw?
11- Are all the ADC's ground pins connected? Check each pins soldering for opens and shorts.
By fusedlightning
#162414
Another question - in your original statement, it seemed unclear if the LSB would -ever- go low. If you put a nonzero voltage on, will you see the LSB go through transitions? If the LSB's completely stuck high, that definitely sounds like a hardware problem.

However, if the LSB simply won't go low at zero volts (meaning the ADC is reading 0b000000000001), that could just be a miniscule calibration error.
By Mach3Maelstrom
#162437
Thanks for your replies, waltr & fusedlightning!

waltr - Thanks for the correction - to answer your questions:

Image

To give more information, the ADC should read the analog value for about 10 seconds at a time.
Also, the R/C and BUSY lines are driven by the CPLD.
Also, the Vin signal is driven by an inverting op-amp.

1) The power supply is very clean, tested via o-scope.
2) The signal Vin comes from an op amp, whose gain is calibrated to never exceed 2.5V.
3) 0 to 5V
4) The R/C line doesn't change state during conversion
5) Just tried it, and the outputs go into tri-state.
6) The design calls for Word mode, though I'm uncertain how it can be converted to Byte mode.
7) BUSY occasionally goes LOW during a live conversion, but not the entire 10 second duration.
8 ) The timing is on spec as per Figure 3.
9) Yes, except for the reference - for that I've used an ADR381ARTZ. Also pictured above.
10) The ADC doesn't get warm - current draw is not high.
11) Verified each joint and net, no shorts or opens.

fusedlightning - The LSB does transition as I increase from 0V. Interestingly enough, I ran a voltage ramp through Vin to test it and the LSB fluctuated between 0 and 1.
  • If I cut off the voltage ramp while the LSB is LOW, then the LSB stays LOW.
  • If I cut off the voltage ramp while the LSB is HIGH, then the LSB stays HIGH.
I honestly don't know what that means - although I'm wondering if I'm getting this because my op amp's inverting input is open (and thus indeterminate), but when I test the Vin pin, it's not that noisy.

I've swapped out the chips like I said in my OP - the working board stopped working and the non-working board works as needed, but this may just ascertain what you said, fusedlightning... that it's a calibration error. How can I remedy this with this ADC?
By fusedlightning
#162441
To make sure I understand what you said:

1) If you put 0V into the ADC, on some devices you get 0b000000000000 out, and others you get 0b000000000001 out.
2) As you increase the voltage from 0V to 2.5V, you see the LSB flip repeatedly between 0 and 1.
3) If you stop the voltage increase, the LSB stays where it last was.
4) If you then return to 0V, the LSB will not change from where it was when you stopped the voltage increase

If all four of those are accurate, that is indeed an interesting behavior. However, if I was incorrect in 4), and when you drop back to 0 volts, the LSB flips high again, that definitely just sounds like a calibration problem to me.

I don't know much about your particular part, but unless the part provides a method for calibration, it sounds like this may be a software fix.
By Mee_n_Mac
#162442
Mach3Maelstrom wrote: Also, the R/C and BUSY lines are driven by the CPLD.
Also, the Vin signal is driven by an inverting op-amp.
... although I'm wondering if I'm getting this because my op amp's inverting input is open (and thus indeterminate), but when I test the Vin pin, it's not that noisy.
I'm not sure about the original problem, that you don't get exactly 000...000 out with zero volts in doesn't surprise me. There will be some small offset error in the system. This can be calibrated out, either using additional hardware or done in software.

The original problem was stated as "Even if my Vin value is zero volts, the LSB on a few ADCs is stuck at HIGH output. No matter what I try, I cannot get the LSB to go low ever again." I emphasized the portion that would have indeed indicated a bad A/D but if the lsb changes 0-1-0-1 as Vin ramps then the lsb isn't "stuck", it's just that there's an lsb (or so) of voltage offset

I noticed the 2 statements quoted above. First the BUSY line is an output of the A/D, it tells the CPLD that a conversion is in process. When it goes HIGH after a conversion, it's a sign that the data is valid. It shouldn't be driven by the CPLD. Second ... what ? The op-amp's inverting input is not connected to anything ? I don't know how that even works. Can you supply a schematic of this ?
By Mach3Maelstrom
#162444
fusedlightning: All 4 of your points are correct. To emphasize on #4, if I abruptly change Vin to 0V, then the LSB will not change value.

Mee_n_Mac: I made that statement "cannot get the LSB to go low ever again" before I applied the voltage ramp. I realize I wasn't clear at all when I wrote that - my apologies. When I said that, I was referring to no matter how many times I cycle the power.

Finally, regarding your WHAAAAAT?! :-): When I cut power to the voltage ramp, I did it by creating an open circuit between the op amp input and the op amp itself. During normal operation, there's power going to the op amp input. Once more, perhaps I was unclear in writing that and created a wetware problem ;-)

Anyway, because this issue appears to be board by board, I'm worried that:
  • The LSB will output an incorrect value during normal readings, and
  • Calibrating it via software won't be so straight-forward - will probably have to manually adjust it on a case-by-case basis
Please let me know all your thoughts, that is before I start sinking a lot of hours into the software.
By fusedlightning
#162445
How accurate a result are you really looking to get? The LSB on a 12-bit bus scaled 0-2.5v (as I believe your situation is), is only 0.0006 volts (0.6mV!). Even if the ADC is scaled 0-5v, the LSB only represents 1.2mV. Is this kind of accuracy within the noise of your system?

It's sounding more and more that what you're seeing is correct hardware (though Mee_n_Mac will be able to confirm this better than me), and simply a slight calibration difference unit to unit. This is not uncommon at all.

The reason the LSB would not change with an abrupt change is that as you drop back down to zero volts, the entire edge happens in one conversion cycle. Then, you're back to your 0v state, which matches a digital output of 0b000000000001.

The simplest solution would be just to drop the LSB. If you REALLY need all 12 bits, it may be that this part just doesn't match your specification in terms of voltage tolerances.
By Mee_n_Mac
#162449
To add to the above, if your system absolutely depends on having less than an lsb of DC error ... you're screwed. The A/D doesn't promise that over it's range (0-5V). I also doubt the analog circuitry can deliver that level of accuracy. If the lsb bothers you, subtract it out. If needed you could add switches to the input circuitry someplace to open the normal signal path, ground the path to the A/D and then measure and subtract whatever offset is measured. That would be a worst case solution. Even better would be to add in a true white noise (zero mean) source and average a hundred or so samples. That would get you sub-lsb accuracy on the offset.
By waltr
#162464
I'm in total agreement with Mee_n_Mac and fusedlightning now that we have a better explanation.

If you just disconnect the ADC input there is no reason for it to go to zero Voltage and is more likely to stay (internal sampling cap). Instead of just disconnecting the ADC input try grounding it with a resistor (about 1k). Does the lsb now change?
By Mach3Maelstrom
#162538
Wow, thanks for all your inputs! This clears a lot of things up.

Mee_n_Mac: To be clear, I recognize that trying to get less than LSB of accuracy is impossible (at least without some clever reference configurations or other setup).

I wanted to understand why the ADC was outputting a non-zero value - and perhaps learn if this slight difference will screw up my outputs (i.e. is it a linear error where it's just +-1.22mV the true value or does it scale where as Vin increases, the output starts getting more and more inaccurate).

From what I've read and studied on ADCs, it appears to be the former, so I can deal with being off by +-1.22mV.

fusedlightning: As I stated above, I know that I won't be getting a more accurate reading than the LSB. Also, thanks for your excellent description of why the "abrupt change" would result in an output of 0b000000000001 - makes sense why I'm seeing this behavior!

waltr: As I mentioned in the OP, the LSB doesn't change when I short the Vin pin to analog ground. But as you mention, the internal sampling cap may be holding its voltage, resulting in the 0b000000000001 reading.