1
\$\begingroup\$

I have a CAN bus consisting of only two devices. Each device is transmitting a periodic status message. I am getting periodic error frames (about 1 error frame every 10 transmissions.) When I look at the CAN bus waveform with an oscilloscope I see this:

Error Frame Capture

Does this look like a collision to you?

I thought the CAN bus protocol establishes that a device does not transmit on the bus if the bus is dominant. Even if two devices try to transmit the transmission will stop once one of the devices has loss arbitration.

Edit: Thanks for the responses. The schematics are very simple. I have a CAN Bus Transceiver connected to a PIC MCU. The same circuit has worked on other applications. There is only two nodes on the bus.

Perhaps this is a better screen capture: Screencapture 2

Node 1 begins to transmit on the bus. It sends it's 29 bit identifier, then the DLC (both ok), it then begins to send its data fields D0 - D7 (D0 contains a number and D1-D7 happen to have all 0s). The electrical signal is good on the bus, but for some reason, the scope is unable to decode it. Perhaps the other node is also unable to decode the message and thinks the bus is recessive. I did check the voltage level are higher than the thresholds. It appears node 2 begins to transmit while node 1 is still transmitting it's data fields. After 5 dominant bits node 1 tries to send a recessive bit, but the bus is held high by Node 2. This causes a bit stuffing error and an error frame is sent.

After the error frame is sent, node 1 retransmits the exact same message and it is successful every time. Screen capture of a frame immediately following an error frame

Here is a comparison of the two exact same massages. Black is the good message, blue is the error frame Comparizon of two messages Overlay of both good and bad messages

\$\endgroup\$
4
  • \$\begingroup\$ Is your baudrate 500kbps? \$\endgroup\$
    – Lundin
    Jul 7 at 13:33
  • \$\begingroup\$ My baud rate is 1Mbps \$\endgroup\$
    – AgentXq
    Jul 8 at 0:53
  • \$\begingroup\$ "Black is the good message, blue is the error frame" No! An error frame is simply a sequence of dominant bits longer than the bit stuffing sequence. What are the most common causes of CAN bus communication errors?. "After 5 dominant bits node 1 tries to send a recessive bit, but the bus is held high by Node 2. This causes a bit stuffing error and an error frame is sent." No, that is the error frame. As for what caused it, I don't know. Are you sending the same packages from multiple nodes? \$\endgroup\$
    – Lundin
    Jul 8 at 6:25
  • \$\begingroup\$ Also I found this explanation which is good: copperhilltechnologies.com/can-bus-guide-error-frame \$\endgroup\$
    – Lundin
    Jul 8 at 6:28
1
\$\begingroup\$

CAN doesn't have collisions, save for the special case where you send two frames with the same arbitration field (identifier etc) but different data. This could perhaps be the case here? Since it looks like a node starts transmitting, then aborts and starts spamming error frames.

The odd little voltage peak at the end normally comes from another node filling in the ACK bit. This is expected to look different from the rest of the package in terms of voltage levels.

But your scope pic doesn't really look like a valid CAN frame, but rather the start of one, followed by a bunch of error frames (6 dominant bits in a row). Similarly, an EOF sequence after the ACK bit with dominant bits would indicate an error as well.

\$\endgroup\$
0
\$\begingroup\$

The can bus has a collision management scheme.

From the scope waveform, it looks like more of an electronic issue than a collision.

Post a schematic of your design.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.