0
\$\begingroup\$

I have a prototype device that is listening to the canBus for certain messages (there are only two nodes on the bus, my device, and the sending device). I'm having a problem where the sender constantly sends the same message, I think because the ACKs that I'm sending aren't being 'recognised', so the sender keeps retrying. I think it's because of this that my microcontroller is not picking up the messages (firing the can receive interrupt).

I also have another device which seems to work correctly and ACKs the message and it is not retried.

I have included a screenshot of the scope trace. The yellow trace is what the microcontroller is transmitting, and the red trace is what is being received from the CAN IC on the PCB. v8 is the broken version (note that directly after the ACK, the message is resent). v7 is the correct working version. There's a slight difference in the waveform between the two but I don't know what it means.

Thanks for your help.

scope traces

\$\endgroup\$
9
  • \$\begingroup\$ It looks Ok, except for receiving an error frame in V8? Do you have Acknowledge errors or did you develop the CAN controller yourself? \$\endgroup\$
    – Jeroen3
    Commented May 12, 2017 at 7:30
  • \$\begingroup\$ The can controller is built into the microcontroller (stm32f103z). I'll check if there's a register that reports errors. \$\endgroup\$
    – bananamana
    Commented May 12, 2017 at 8:09
  • \$\begingroup\$ It looks like I'm getting a "bit dominant error" according the the STM manual. Unfortunately it does not describe what that is and how I might go about resolving it.. \$\endgroup\$
    – bananamana
    Commented May 12, 2017 at 10:10
  • \$\begingroup\$ What do the actual CAN lines look like. Are they 120ohm terminated? \$\endgroup\$
    – Jeroen3
    Commented May 12, 2017 at 10:44
  • \$\begingroup\$ Yes, I'm using the same lines for both v7 and v8. They are terminated at both ends. \$\endgroup\$
    – bananamana
    Commented May 12, 2017 at 10:55

1 Answer 1

0
\$\begingroup\$

It looks like the CAN transceiver on the v8 board is not driving the bus and is effectively operating in receive-only / silent mode.

In the trace on the left, you can see that the dominant ACK bit that the v8 board sends on the TX pin didn't make it through to the bus and back onto the RX trace. The trace of the v7 board on the right shows the ACK bit successfully driving the bus into the dominant state.

Some possible causes to investigate:

Is the CAN transceiver in silent mode?

Some CAN transceivers have dedicated pins to disable them and place them into silent mode, others make their slew control pins do double duty for controlling silent mode by specifying a pullup/pulldown value that will disable the transmitter. Double check that the pulldowns in your design are correct and that the installed pulldowns match the design.

Is the CAN transceiver supply rail good enough?

I haven't seen this personally, but maybe the transceiver is trying to drive the bus, but isn't able to drive the lines to the correct differential level for a dominant bit because the supply rail is either too low voltage (most CAN transceivers expect a 5V rail), or because the rail can't supply enough current (100mA peak) for the dominant bit. Try scoping the CANH and CANL lines to check if transceiver is trying to drive the ACK bit and failing vs doing nothing at all.

Is the CAN transceiver broken?

Maybe you were unlucky and installed a broken part. Try swapping out the CAN transceiver with a new one and see if it helps.

\$\endgroup\$
1
  • \$\begingroup\$ It looks like CAN transceiver wasn't receiving enough volts, and so it wasn't able to drive the bus at all. It was expecting 4.5V while I was only supplying 3.3V. Thanks! \$\endgroup\$
    – bananamana
    Commented Jun 5, 2017 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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