1
\$\begingroup\$

In a number of MCU families there are built in CAN bus controllers, which include self testing function of loop back. Loop Back mode can be configured as External Loop Back and Internal Loop Back. Here's a figure of how controller treats RX and TX lines in both these modes: CAN bus loop back modes

As it says in my particular datasheet,

This mode is provided for hardware self-test. To be independent from external stimulation, the CAN ignores acknowledge errors (recessive bit sampled in the acknowledge slot of a data/remote frame) inLoop Back Mode. In this mode the CAN performs an internal feedback from its Tx output to its Rx input. The actual value of the CAN_RX input pin is disregarded by the CAN. The transmitted messages can be monitored at the CAN_TX pin.

So acknowledge errors are ignored, right. Is there still need for connection of an external transceiver circuit, along with a teramination resistor of 120 Ohms (or two in parallel for complete bus), or can that be disregarded or do you even recommend to leave the MCU's RX and TX pins floating?

asked Mar 24 at 9:19
\$\endgroup\$
1
  • \$\begingroup\$ Loopback mode is a debug mode which is essentially just good for one thing: testing code until you have proper hardware in place. So no, you don't need any transceiver or termination. Keep in mind however that in loopback mode the CAN controller might ACK itself. When running on a real CAN bus you must have an external node to make those ACK. \$\endgroup\$ Commented Mar 24 at 10:59

1 Answer 1

1
\$\begingroup\$

As your datasheet says: Internal loop back, nothing happens on the Tx pin. Rx pin is ignored. External loop back, the Tx pin shows what is being transmitted internally. Rx pin is ignored.

All you need is to ensure that the Rx pin is not floating as a part of good GPIO pin configuration and circuit wiring practice, to avoid potential oscillations and power drain. Which is nothing to do with the CAN function.

Of course if you actually intend to use the interface then a transceiver chip and possibly a termination resistor will be needed : these internal test modes do not care if it is present.

answered Mar 24 at 10:53
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.