Help measuring a -12v logic signal  - Page 1
Forum section: electronics / projects

author: robertbaruch
author_rank: Regular Contributor
timestamp: September 18, 2016, 10:16:41 pm
content: See attached PDF for circuit details. Basically I have a board from the 1960's that uses -12v and 0v as logic levels. It uses -12v, 0v, and +6v as power. The fastest signal present is 400kHz.I'd like to convert -12v to 3v3 and 0v to 0v so that I can hook my Saleae and capture the signals. So, I figured all I needed to do is find a level shifter. There doesn't seem to be one for such large negative voltages, so I cobbled together one out of a high-speed analog comparator with digital output (MAX9201) and a voltage divider.Now, the MAX9201 can only handle limited analog voltages, so I figured I would use a voltage divider to move and attentuate the input to a good range. Specifically:-12v maps to 0v0v maps to 4v6v maps to 6v.Now, when I scope the board's signal using a 10x probe, I get a nice clean square wave. However when I scope the middle of the voltage divider, I'm getting effectively a triangle wave. See the attached image, which is where I connected the Saleae directly to the voltage divider (since the voltage range is fine for the Saleae).The resistors I'm using for the divider are 120k and 240k (so total load on the signal is 360k). I don't want to go much lower because I know the board can't drive that much.Can anyone help figure out (a) why dividing a square wave results in a triangle wave, and (b) how to fix it? Again, see the attached PDF for details on the board's circuitry and the circuit I'm using to measure the signal.

author: StillTrying
author_rank: Super Contributor
timestamp: September 18, 2016, 10:39:57 pm
content: It looks like input protection diodes conducting to me, although I can't find anything on the MAX9201 datasheet. Have a scope of your 2V reference.

author: robertbaruch
author_rank: Regular Contributor
timestamp: September 18, 2016, 11:02:31 pm
content: The 2v reference is totally clean.

author: tggzzz
author_rank: Super Contributor
timestamp: September 18, 2016, 11:31:34 pm
content: Don't forget the probe tip capacitance.120k//240k=>80k80k & 20pF=>1.6us time constant, which looks similar to the times in your diagram.You can do the detailed arithmetic, but high impedances and high speed is a difficult combination.

author: MarkL
author_rank: Unknown
timestamp: September 18, 2016, 11:34:40 pm
content: Your scope probe and the Saleae both have about 10pF of input capacitance. You are trying to drive that capacitance through a 240k resistor and that is giving you the triangle.One possible fix are to reduce the impedance of the resistor divider. It looks like the output circuit has an impedance of at least 1.5k so this approach should be fine.Also, it appears that you are using a newer model Saleae which can tolerate negative voltages. See here:http://support.saleae.com/hc/en-us/articles/208667766-Connecting-a-logic-analyzer-to-my-circuit-appears-to-interfere-with-it-s-operationhttp://support.saleae.com/hc/en-us/articles/210244723-Can-the-logic-analyzer-be-used-to-record-12V-or-24v-TTL-signals-CAN-RS-232-RS-485-Ethernet-or-other-non-cmos-signals-Since your signal swings 0 to -12V, you just need to get it shifted up into a range where the Saleae can sort out what's a 0 versus a 1 (similar to RS232). Even a simple voltage shifter using a 6V zener would probably be fine with a pullup via a 10k or 20k to the +5. You would then invert the logic in the Saleae SW as to which level is considered a "high" or "low".

author: StillTrying
author_rank: Super Contributor
timestamp: September 19, 2016, 01:11:09 am
content: 80k & 20pF=>1.6us time constantI used exactly the same values, that explains the first steep part of the slope, but not the kink and then slower part.As it is a comparator you're allowed to have a very wide differential voltage.Differential Input Voltage..................(VEE - 0.3V) to (VCC + 0.3V)Common Mode Input Voltage..........(VEE - 0.3V) to (VCC + 0.3V)But I'm suspicious that nowhere on the data sheet do they show a differential voltage of more than 100mV.If the top plot is its output, it's oscillating before going low.Supply decoupled near it? Checked both GNDs are connected ?

author: Marco
author_rank: Super Contributor
timestamp: September 19, 2016, 01:47:40 am
content: You're making this way too hard, just do a 100K/200K divider between the 6V rail and the 0/-12V signal, this will give you a 4/0V signal and with the high impedance the LA won't really care about the slightly higher voltage.You can do the inversion after capture.PS. 100K/200K might be pushing it for that high a frequency, I very much doubt it will care about an extra mA of current.

author: robertbaruch
author_rank: Regular Contributor
timestamp: September 19, 2016, 02:10:02 am
content: @StillTrying:If the top plot is its output, it's oscillating before going low.Supply decoupled near it? Checked both GNDs are connected ?I should have said, that the top plot and bottom are the same -- the bottom is just the analog version, and the top is the thresholded version, both from a single Saleae input. That is, the signal goes into the Saleae which is set to measure both analog and digital for that pin.

author: robertbaruch
author_rank: Regular Contributor
timestamp: September 19, 2016, 02:26:45 am
content: @MarkLSince your signal swings 0 to -12V, you just need to get it shifted up into a range where the Saleae can sort out what's a 0 versus a 1 (similar to RS232). Even a simple voltage shifter using a 6V zener would probably be fine with a pullup via a 10k or 20k to the +5. You would then invert the logic in the Saleae SW as to which level is considered a "high" or "low".That makes sense. Yes, I have the newer tolerant Saleae. While in this case the board's resistor to ground is 1k5, elsewhere I've seen as high as 12k, so I may have to fiddle with the resistance. I think this is worthy of a try. I'd have to be sure to keep enough current flowing through the zener in both states (-12v and 0v) to maintain the zener's voltage. I'll report back once I find an appropriate zener.

author: robertbaruch
author_rank: Regular Contributor
timestamp: September 19, 2016, 03:14:12 am
content: I dug up a 5.1v zener, and it seems to work! I used a 6v supply, so that even with an output of 0v, the zener would still have current going through it to remain on.

author: MarkL
author_rank: Unknown
timestamp: September 19, 2016, 04:21:16 am
content: Quote from: robertbaruch on September 19, 2016, 03:14:12 amGreat; glad it worked for you!

author: StillTrying
author_rank: Super Contributor
timestamp: September 19, 2016, 04:53:48 pm
content: Suppose this means we'll never know what caused that strange waveform!

author: MarkL
author_rank: Unknown
timestamp: September 19, 2016, 06:10:09 pm
content: Quote from: StillTrying on September 19, 2016, 04:53:48 pmIt looks like parasitic capacitance across R102 to me. (Maybe this circuit is on a protoboard?)The little (approx) 1V fast slope is tracking the edge of "IN" because of the coupling from the parasitic capacitance. Then the slower slope after that is the probe capacitance charging and discharging through 240k once "IN" has reached high or low.