June 2014: BenchBuddEE ADC Troubleshooting

June 19, 2014

So I have the ADC and related components soldered down on both boards, but am receiving inconsistent results. Frankly, it’s just a mess. Here is how it’s configured…

1. OPA in bypass
2. Gain jumper removed
3. V+Adj jumpered to TCIN_+ and set to lowest: 1.26V
4. Official code from Chris’ Github repo from “MCP3901 Initial Capture” used on both boards

On the custom board, the “16-bit combined value” (byte / (2.37/6536)) just sits there and fluctuates in the 450-900 range, regardless of what I do with the V+ADJ. I followed the voltage through from the terminal block, through the OPA and over to the ADC, and on pin 4 of the ADC (CHO+) I have an input that starts at .036V and steadily climbs up… currently climbing past .181V, and noisy as hell with a Peak to Peak voltage of 520mV sampled over the course of two minutes. In the span of 1mS, it fluctuates steadily just as much.

In the time it took me to type out that paragraph, the voltage at the CHO+ test point has now climbed to .218V.

On the official board, the “16-bit combined value” is pranged to 32767 and never changes. I followed the voltage through as before and starting with 1.263V at TCIN_+, I end up with, again, a slowly rising value at CH0+, currently at .263, that does change with V+ADJ.

MOSI and MISO show traffic on both boards and show what you’d expect (CH1 = SCLK)…

ADC MOSI 0x1FFFF Official Board

ADC MISO 0x7FFF Official Board

ADC MOSI 0x1FFFF Custom Board

ADC MISO 0x1F3 Custom Board

June 20, 2014

Further testing…

I put the official board on for testing, and swapped between reading the config2 register and reading the data register.

When reading from the data register, I receive the same 0x7FFF return on MISO that’s shown above, which coincidentally happens to be 50% of the ADC max value (0xFFFF/2 = 0x7FFF).

When reading from the config register, it returns only 16 bits, as expected, and shows the B00001100 value, which is what is expected from that register.

So I have now gone through and read data from every register on both boards… here are the results, which I don’t suspect provide much clarification…

Table of ADC Values Returned

… of particular note are the red figures on the custom board, which were fluctuating during measurement. Pretty sure that the MODULATOR register is supposed to be a fixed value.

* * *

Well, if I’d looked ahead instead of struggling at the “initial ADC Capture” stage, i’d have seen that there were two supplemental videos in the following week that require a jumper from the REFIN- to GND, and clearly indicating that R58 shouldn’t be soldered down yet, apparently.

On the custom board, I’d included a trace to AGND in the original design, which is why i was getting readings back, I imagine; it had a full reference. The official board doesn’t have that trace so it requires that bodge to enable the internal reference. After soldering on a bit of wire between C31 and the AGND side of R48, both boards were working exactly the same… just fluctuating in that 450-900 output range.

The next supplemental video mentions that R58 shouldn’t be soldered down yet, which I somehow missed in the original assembly video. So I’ve removed that jumper, and now the output changes as the potentiometer is twisted.

Unfortunately, I’m not in the clear yet. For some reason, the OPA on both boards is now just passing the 1.25V straight through with no gain jumpers on. Somehow it seems related to the removal of R58, but I don’t know why.

* * *

Looking at the schematic, I’m not sure now if it’s R49 or R58 that’s supposed to not be populated right now. Can someone with a functioning ADC clue me in? Also, does anyone have fully functional ADC firmware that I can have a look at? I want to make sure I’m providing enough space in my variables to accommodate the data without flipping into negative numbers or something like that.

June 25, 2014

I rewatched the videos and did a thorough physical check and R49 was missing on both boards. That’s soldered down now, and the ADC is not flipping to negative values or freaking out in quite the same way as before… however, it’s still not working.

Here’s the strange thing… the configuration is as follows:
V+ADJ set to 1.25V and connected to TCIN+.
GND at the terminal block connected to TCIN-.
No gain jumpers are bridged at the OPA.

When you first turn the board on, OPA pin 1 / Test Point CH0 show 1.30V, which seems very wrong to begin with, then after a few seconds jumps up to 3V without me doing anything other than sitting there watching the DMM (the value of V+ADJ doesn’t change). This happens on both boards, so I’ve managed to screw something up exactly the same… twice.

Further, when the ADC is reading the 1.30V, it’s displaying a fluctuating value of around 1500, which doesn’t make any sense either.

Could one of you enterprising souls out there with a working ADC please check the voltage levels on the OPA pins so I can compare against mine?

Nathan said…

Hey Dan – I will do some measurements this weekend if not earlier. For completeness do you have the Arduino hooked up and therefore what code are you using? Oh and which ground are you using for the DMM – Star or Agnd?

June 27, 2014

Arduino is connected and I am using the code below, which I unfortunately can’t upload to GitHub right now. I’m connecting the DMM to the AGND portion of star ground. Input voltage off of the V+ADJ is 1.25V into TCIN+, TCIN- is connected to the GNDPWR at the terminal block, no gain jumpers and FE_V+/- set to bypass. Here are my measurements…

Here’s the ADC code I’m using…

July 2, 2014

So, the last thing I could think of doing was replacing the OPA, but it hasn’t changed anything. The instrumentation amp is still outputting the input voltage, 1.25V at pin 1 for a few seconds before jacking up to around 3.0V. I am going to go back to the Session 1A videos for the opamp and see if I can find the math in there that might explain what I should be seeing at each pin, but I am at an absolute dead end in terms of troubleshooting for now.


July 3, 2014

Chris Gammell said…

Hey Dan,

I started digging back into my ADC code tonight and hopefully gave some points of troubleshooting. I didn’t resolve anything yet, but hopefully it’ll bring some sanity checks and points of reference.


July 4, 2014

Quick question… if I have 0V at both OPA pins 10 and 12 (because I haven’t connected anything to TCIN+/-), I should have 0V at every step of the instrumentation amp, including output, right? In that case, if I have any value at all at the CH0 test point, something is seriously wrong?

Chris Gammell said…

In theory,yes. What are pins4 & 11? Those are the rails

July 5, 2014

Pins 4 and 11 are in bypass, so 12.01V and -11.49V respectively.

Pins 10 and 12 are both 0V because TCIN+/- isn’t connected to anything.

Pin 1 is 1.81V. Baffling.

Chris Gammell said…

Hunh. What about pins 2 and 3? Can you probe and post all of the pins for the 3 op amps involved with the instrumentation amp?

July 6, 2014
With the board powered, FE_V in bypass, gain jumpers off and the Arduino detached…

Chris Gammell said…

Hey Dan,

I overlaid your numbers on top of the schematic, a practice I highly endorse. It helps to make sense of everything. See attached for what I mean, it should help answer some questions (or at least give you new places to look). Remember, voltage across resistors mean the current is flowing somewhere…your job is to figure out where it’s going! 🙂

ADC Circuit Current Flow

Ok, I’ve been staring at that for a couple hours now and I don’t understand. I’ve tried finding incorrect low impendance paths to both positive voltage sources and GND at every side of every component and I’m not seeing anything compelling. I’ve measured voltage at every side of every component and the only thing I’ve noticed is that the act of measuring things at the inputs of the opamp change it’s behavior. I’ve tried cleaning up potential solder bridges at really tight via locations.

I’ve tried thinking it through and I am stuck at the “I don’t understand why there’s any voltage at all at the inverting inputs of the first opamp stages.”

I’m really, really confused. My next step would be to rip the OPA off the board and see if any of the non-power rail pads are showing voltages when I power up the board. If there are suggestions to check before I do that, I’d appreciate it, because soldering it back down afterwards is going to be a pain; that thing is buried next to tall stuff.

Chris Gammell said…

The “measuring changes the voltages” really is worrisome. That points to other issues. What are you referencing the measurement against? Where are you probing?

If all else fails, I would suggest replacing the OPA4170. It’s never a great option, more of a “last resort” option, especially when things start to get weird like this. Be sure to try and keep the other part around though to see if you can’t replicate the behavior later (by soldering the original back down).

July 7, 2014
So, I unsoldered the OPA, and tested all the pads. 0V at every position except for the power rails which read correctly. I soldered down a new one, but am getting new, but still wacky fluctuating readings… it’s a little late for me to write it all down though.

In the meantime, since I’ll probably be asleep on the west coast when this gets read, shouldn’t I be able to calculate what my voltage should be at every pin and stage of the instrumentation amp given a known input voltage at the non-inverting inputs? For example, the first stage, without gain jumpers should just act like a buffer, so 0V in should result in 0V out with 0V at the inverting inputs as well, because the opamp doesn’t have anything to try to match. Since that means 0V at both outputs of the first stage, that would be 0V at the inputs to the second stage, resulting in 0V out again. That’s a correct assumption, right? I should be able to build a table using the instrumentation amp formula for any given input voltage, so that I could at least understand what a correctly operating device would look like.

Chris Gammell said…

Yes, that’s a good idea. You might also want to look at the LTSpice simulation, you can probe values remotely on each node.

However, I do agree with your analysis. If you have 0V at the input, you should have 0V at the output of the “buffers” effectively. The fact that you aren’t getting that still has me curious about the headers that go to the gain resistors. Perhaps the next step is to also desolder those?

Eelco said…

You said the TC inputs are not connected; could it be that they are floating? Maybe your DMM has a lower input impedance than the opamp. Do you get the same results with TC+/- shorted to ground?

Chris Gammell said…

Eelco has a great point. Especially since we don’t have anything else hooked up to the op amp inputs, it’s possible to push up to 100MOhms impedance on the terminals (that’s mostly based upon the leakage current into that terminal). See page 3 of this document: http://www.ti.com/lit/ds/symlink/opa4170.pdf. It’s likely the DMM is down closer to 10 MOhms (second to last page of the user manual: http://www.adafruit.com/pdfs/EX330_UM.pdf)

Ahhh… that finally put into words the little niggling whatever it was in the back of my head that was trying to explain why I was getting different readings between my two DMMs (different input impedance from two different manufacturers)! As soon as I put the TC inputs on GND, I got 0.00V all the way through the system (after removing and replacing the OPA).

It’s still not working, but nothing is fluctuating anymore and is starting to make more sense… here are the new readings with TCIN+ connected to V+_ADJ tuned to 1.26V…

TCIN+: 1.26
Pin 12: 1.26
Pin 13: 1.26
Pin 14: 1.27

TCIN-: 0.00
Pin 10: 0.00
Pin 09: 0.00
Pin 08: 0.01

Pin 03: 1.24
Pin 02: 1.26
Pin 01: 3.04

So following Chris’ suggestion above, I laid that over the schematic and this is what you get…

ADC Circuit Current Flow Part II

If I understand how this is supposed to work correctly, R8/R9 and R7/R10 are working as voltage dividers right? So on the Pin 3 side of R10 I should be seeing .0031V and on the Pin 2 side of R9 I should be seeing essentially the same value as the other because feedback would drive it to be equal.

Which means there’s a problem with the voltage divider?

PS: R58 is NOT soldered on the board.

PPS: Just pressed a jumper between the via to the right of R49 (easily accessed from the front of the board) and AGND, and the CH0 test point reads 0.031V, which is what it’s supposed to read, right?

* * *

I soldered down R58 and it’s working fully now on the official board, I’ll start working on the custom board next.

I caught up on the coding videos and am getting exceptionally steady output with 24bit width and 256 OSR running, moving up or down by 10 millivolts every three or four seconds, but the values reported are consistently low as the following chart shows…
ADC Voltage Table

I changed the code to read from CH1 as a test, and it’s bang on 0.44 consistently, matching the DMM.

Edit 2…
I went back to compare the reading of the CH0 test point against the calculated voltage but couldn’t because touching the DMM probe to the CH0 test point caused the ADC to really start varying it’s readings. As soon as I removed the probe it went back to steady state as described above.

July 16, 2014
Final followup on the ADC issues… I placed R58 down on the custom board and it is working now too. Very stable readings with 24-bit and oversampling set in the configuration register.