Reply by May 17, 20182018-05-17
On Thu, 17 May 2018 17:09:29 +0200, Stef
<stef33d@yahooI-N-V-A-L-I-D.com.invalid> wrote:

>On 2018-05-15 Ryo Kato wrote in comp.arch.embedded: >> Hi there, >> >> I am trying to implement a CAN sniffer on an Altera DE2-115 evaluation board with the Terrasic AD/DA data conversion card (High Speed Mezzanine Card (HSMC) via SMA. I am using two A/D channels for CAN_H and CAN_L bus signals. >> >> Before testing it with real CAN signals I want to make sure that the connection is right in terms of voltage swing, differential termination and peak-to-peak voltage. If I got it right I expect a voltage swing of about 1 volt on the CAN_H and CAN_L signal, whereas the input characteristics for the data conversion card say something about 0.5V. But I am not sure if I understood it correctly. >> >> Could somebody please verify, unfortunately I am no expert in analog electronics. Any help is highly appreciated. > >Usually CAN signal level is 0/5V, so you should at least cover that.
Since the differential voltage can be as low as a few hundred millivolta, the ADC resolution should be in the order of tens of millivolts.
>To allow for some common mode differences, older tranceivers would accept >-7V to +12V signal levels. Newer chips accept even more, like this example >for 12V (car, noisy) systems that accepts +/-42V. > https://www.nxp.com/docs/en/data-sheet/TJA1057.pdf
The -7 to +12 V common mode range is the minimum you should be able to digitize property, but the ADC should tolerate a much larger swing, but it should be enough to indicate "overflow".
> >This could also be useful for you: > http://www.ti.com/lit/an/slla270/slla270.pdf > >So at least allow for -7/+12V voltages and +/-50V when you expect to use >your sniffer in noisy environments. > > >But why monitor the lines with two ADC's? Why not use a standard CAN >tranceiver and controller to receive all bus activity without generating >acks like all(?) CAN monitors?
If you want to know how close the system noise margins are, you definitively want to do analog measurements. Of course, one could even use an (analogue) dual channel oscilloscope and put into A-B mode to display the differential voltage. The oldest CAN controllers did not have Listen Only mode, but at least SJA1000 days, the Listen Only mode is usually available, which is nice for autobauding an existing network.
>Do you want to calculate the differential voltage from the ADC values and >then apply thresholds to convert to bits? You would need to sample a lot >faster than the bit rate (10X?, so 10MSPS for a 1Mbps CAN bus).
The interesting things that an analog converter will reveal, is over/undershots etc. similar analogue issues, long before those things cause problems in the digital domain. But as I said, a dual channel scope will do the same thing as the proposed analyzer.
Reply by Stef May 17, 20182018-05-17
On 2018-05-15 Ryo Kato wrote in comp.arch.embedded:
> Hi there, > > I am trying to implement a CAN sniffer on an Altera DE2-115 evaluation board with the Terrasic AD/DA data conversion card (High Speed Mezzanine Card (HSMC) via SMA. I am using two A/D channels for CAN_H and CAN_L bus signals. > > Before testing it with real CAN signals I want to make sure that the connection is right in terms of voltage swing, differential termination and peak-to-peak voltage. If I got it right I expect a voltage swing of about 1 volt on the CAN_H and CAN_L signal, whereas the input characteristics for the data conversion card say something about 0.5V. But I am not sure if I understood it correctly. > > Could somebody please verify, unfortunately I am no expert in analog electronics. Any help is highly appreciated.
Usually CAN signal level is 0/5V, so you should at least cover that. To allow for some common mode differences, older tranceivers would accept -7V to +12V signal levels. Newer chips accept even more, like this example for 12V (car, noisy) systems that accepts +/-42V. https://www.nxp.com/docs/en/data-sheet/TJA1057.pdf This could also be useful for you: http://www.ti.com/lit/an/slla270/slla270.pdf So at least allow for -7/+12V voltages and +/-50V when you expect to use your sniffer in noisy environments. But why monitor the lines with two ADC's? Why not use a standard CAN tranceiver and controller to receive all bus activity without generating acks like all(?) CAN monitors? Do you want to calculate the differential voltage from the ADC values and then apply thresholds to convert to bits? You would need to sample a lot faster than the bit rate (10X?, so 10MSPS for a 1Mbps CAN bus). -- Stef (remove caps, dashes and .invalid from e-mail address to reply by mail) pos += screamnext[pos] /* does this goof up anywhere? */ -- Larry Wall in util.c from the perl source code
Reply by Ryo Kato May 15, 20182018-05-15
Hi there,

I am trying to implement a CAN sniffer on an Altera DE2-115 evaluation board with the Terrasic AD/DA data conversion card (High Speed Mezzanine Card (HSMC) via SMA. I am using two A/D channels for CAN_H and CAN_L bus signals.

Before testing it with real CAN signals I want to make sure that the connection is right in terms of voltage swing, differential termination and peak-to-peak voltage. If I got it right I expect a voltage swing of about 1 volt on the CAN_H and CAN_L signal, whereas the input characteristics for the data conversion card say something about 0.5V. But I am not sure if I understood it correctly.

Could somebody please verify, unfortunately I am no expert in analog electronics. Any help is highly appreciated.

Regards, Ryo