EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: NiHaoMike on October 12, 2024, 01:12:58 am
-
I'm working on an adapter board for a cheap FX2 logic analyzer to allow it to analyze differential signals up to a few Mbps such as CAN and RS485. The problem I'm trying to solve is how to make the offset adjustable? For example, CAN uses a threshold of about 0.7V while RS485 uses a threshold of near 0V. I could just get a bunch of RS485 receivers and a bunch of CAN receivers and just switch between them, but that seems a bit silly.
-
There is a problem in that they are DC coupled and at least the RS-485 (+/-12V on the THVD24xxV) can have a fairly wide common mode voltage range, quite different to the CAN bus and its CM voltage of 2.5V.
-
Why not use general purpose analogue comparators?
One input would be your signal, the other would be the threshold voltage set by a trimpot etc.
-
Why not use general purpose analogue comparators?
One input would be your signal, the other would be the threshold voltage set by a trimpot etc.
For differential buses like CAN, the threshold is the difference in voltage between the lines that triggers a 1 vs a 0. So a standard comparator won't work.
-
Why not use general purpose analogue comparators?
One input would be your signal, the other would be the threshold voltage set by a trimpot etc.
For differential buses like CAN, the threshold is the difference in voltage between the lines that triggers a 1 vs a 0. So a standard comparator won't work.
You will already have ensured signal integrity using a scope, specifically including a check to see that the differential voltage margin is correct. Now all you have to do is interpret the digital signal based on the known good analogue waveforms.
Possibility one: use two comparators with the threshold set to the specified common mode voltage, and combine the difference digitally.
Possibility two: use one comparator with inputs connected to the differential inputs, not specifying the common mode voltage, but allowing the comparator to work out which input is higher.
Personally I'd start with the latter. The former is more likely to be used in the input pods of a bog-standard logic analyser.
-
Possibility two: use one comparator with inputs connected to the differential inputs, not specifying the common mode voltage, but allowing the comparator to work out which input is higher.
That won't work for CAN since its 0 voltage is close to 0V difference. A 1 is defined as more than 0.7V difference.
-
Possibility two: use one comparator with inputs connected to the differential inputs, not specifying the common mode voltage, but allowing the comparator to work out which input is higher.
That won't work for CAN since its 0 voltage is close to 0V difference. A 1 is defined as more than 0.7V difference.
Use a SN65HVD230 3.3V CAN Transceiver with Standby Mode, or similar
-
Use a SN65HVD230 3.3V CAN Transceiver with Standby Mode, or similar
How to support RS485 with that other than with the kludgy hack of using a RS485 receiver in parallel?
-
It's probably worth special casing CAN. The vast majority of differential signalling standards have 0 volts differential as the threshold. For CAN, given that as tggzzz has pointed out you have already verified signal integrity, just operate you logic analyzer input in singled ended mode looking only at CAN Hi with the comparator threshold set to 2.5-3V. Since you are presumably going to want to support both signal ended and differential signalling, this is no extra hardware.
-
I'm working on an adapter board for a cheap FX2 logic analyzer to allow it to analyze differential signals up to a few Mbps such as CAN and RS485. The problem I'm trying to solve is how to make the offset adjustable? For example, CAN uses a threshold of about 0.7V while RS485 uses a threshold of near 0V. I could just get a bunch of RS485 receivers and a bunch of CAN receivers and just switch between them, but that seems a bit silly.
Dual solutions are simple to apply and easy to understand or upgrade. It's not really silly or a kludge.
Any 'proper' alternative will be tricky : many new parts have wide common mode, and high ESD, and moderately high input resistance.
You could get a fast (sub 10ns) rail-rail comparator, and apply differential divider/bias resistors to give you a better common mode range, then inject a small optional offset current for CAN thresholds.
The resistors need to be low enough to not compromise MHz, but high enough to not be a lot worse than a standard part.
It would need careful layout and tuning.
lcsc have interesting parts like MX3501T23_C5359092_Comp_RRIO_SHDN_4p5ns_1mVos_2pA_3p2mA_6mVHyst_80MHz_SOT26_10c
-
Put the CAN and RS485 receivers on your board and trigger off the single ended outputs?
-
Since you are presumably going to want to support both signal ended and differential signalling, this is no extra hardware.
Single ended is done by using the logic analyzer as is. At this point, I'm thinking of 4 channels differential with the other 4 digital channels as passthroughs for when it's necessary to capture single ended signals at the same time as well as an analog passthrough for the one analog channel on those FX2 analyzers. The 4 differential channels should cover the case of SPI over differential lines.
-
For what it's worth even though I think the circuit is a bit ridiculously complicated it does what you are asking for. The comparator is for illustrative purposes only and not suitable because of limited common mode voltage range. The level of hysteresis is set by controlling the current I1 and the value of the input resistors. Voltages shown are the inputs to the comparator. The signal generator generates a +/-2V square wave with slow edges.
Make of it what you will.
-
Use a SN65HVD230 3.3V CAN Transceiver with Standby Mode, or similar
How to support RS485 with that other than with the kludgy hack of using a RS485 receiver in parallel?
The kludgy hack would be to throw something together that does two jobs badly. The clean hack is to to both jobs well.
If that means two receivers, sobeit.
-
Another use case I just thought of is "current loop" interfaces, where a twisted pair cable connects to an optoisolator. That is done so that it would not be necessary for a device that uses such an isolated interface to supply power to both sides of the isolator circuit, the remote side would be entirely powered by the signals from the remote device. (Note that only one end of the link would be isolated, the other end just uses common logic signals and resistors.) It would need an offset threshold just like CAN does, but more than 0.7V in the case of an opto-Darlington return channel. At this point, I'm leaving it as a "stretch goal" to be implemented if it doesn't require unreasonable complexity.
-
Just for completeness, the previous circuit was drawing the current for I1 through the external driver, this circuit doubles the complexity but supplies the current locally so that the drivers don't need to supply the current.