8 years, 9 months ago.

CAN is only working on CAN Low not High

Hello,

I have 2 C027 boards and worked the last week on activating the CAN Module and sending messages from one to another.

Communication is working, and messages are transfered.

Using a digital Oszilloscope, I tried to read the messages, and saw that only the CAN/L actually has the signals on it. CAN/H is high and has no signals on it

I tried it on both C027, and both show the same behaviour.

Any suggestions, or anything I have to switch around?

The Setup in the main routine for the CANS Signal is:

DigitalOut can_standby(CANS); can1.frequency(500000); can1.mode(CAN::Normal); can_standby = 0;

Question relating to:

The u-blox-C027 is a complete starter kit that allows quick prototyping of a variety of applications for the Internet of Things. The application board has a MAX-M8Q GPS/GNSS receiver and …

Driving the two lines is up to the CAN driver IC, nothing to do with the software or CPU. The only thing that could cause that would be a hardware issue or being connected to another device incorrectly.

Silly question but you're sure you're looking at the correct pins? The two ends of the 3 pin CAN header.

posted by Andy A 26 Jan 2016

I am looking at the right pins. Actually I can see the other signal too. I doublechecked the analog Signals, and can low lies between 1 and 2.5 V, whereas Can H is between 2.5 and 4V. Therefore I just have to figure out how to reset the ground between units. Thanks for the information though.

posted by Slawomir Suchy 27 Jan 2016

That sounds about right. Idle is both at 2.5, active is CAN low at a low voltage, CAN high at a high voltage. The spec requires at least a 1.5V difference when active, you've got 3V. Since it's a differential signal the ground between the two units isn't that important for CAN, as long as it's within a few volts everything will work fine.

posted by Andy A 27 Jan 2016

1 Answer

8 years, 9 months ago.

Hi Slawomir,

As Andy said, please make sure you are measuring signals on the right pins (outer pins of the green CAN connector).

Can H/L signals are differential, both signals have to move accordingly. In case of high speed can you should also add the termination resistors 120ohm to match the nominal impedance of the cable. Some info on that: http://www.ni.com/white-paper/9759/en/

I have made a trial run with the same setup as you, 2xC027 boards and the code:

can test

    static CAN can(CANRD, CANTD);
    DigitalOut canS(CANS);
    can.frequency(500000);
    canS = 0;
    CANMessage canTx(0xB5, "Nebo pozdrav", 8);   // sending test string here
    CANMessage canRx; 

... and it works fine for me.

Here is a snapshot from my scope: /media/uploads/jabe/scope_0.png You should have something similar on yours if you're measuring the right signals..

Hope this helps, Jaka

Thanks, that how it looks like.

I used the right pins. I connected the GNDs between Scope and C027, but the offset was still there.

I had the trigger-thresholds wrong at the scope for the digital data inputs. Now its working fine.

Thanks everybody for the quick answers.

posted by Slawomir Suchy 27 Jan 2016