cancel
Showing results for 
Search instead for 
Did you mean: 

CAN transceiver-less communication for only two nodes

inky
Associate II

Question moved from this post.

If I have two devices on the same PCB. say an F7 and an MP157, can the CAN_TX of one be connected to the CAN_RX or the other without a CAN transceiver? Similar to UARTs on the same PCB. Maybe series resistors would be required, or pull ups?

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

To answer that question:


@inky wrote:

I don't follow why the RX and TX of both chips are joined together, instead of the UART configuration. Please explain


In the CAN protocol, every node on the bus should listen continuously to what happening on the bus.

  1. In the arbitration phase, the senders while they are sending at the same time, they are listening to the bus level and compare to what they are sending: each difference is reported from the sender side as a loss of arbitration and put itself silent.
  2. In the data phase: the winner of the arbitration will continue to send its frame while it is listening to what happening on the bus. Each difference between what it is sending and what to it is listening is reported as an error.

Even if there are only two nodes on the CAN bus, these mechanisms couldn't be established when a cross connection of CAN_Tx <-> CAN_Rx is adopted.
That's why RX and TX of each node are joined together in the above configuration to let the sender listen to what it is sending.

Hope it's clear now.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

9 REPLIES 9
Ozone
Principal III

> If I have two devices on the same PCB. say an F7 and an MP157, can the CAN_TX of one be connected to the CAN_RX or the other without a CAN transceiver?

Electrically yes, but this only works for two nodes, and short distances.
Technically, this would not really be CAN. But fine for testing.

Of course you would need a GND connection as well.
Series resistors might help for signal quality, but the MCU CAN pins are standard PP outputs, no pull-ups required. 

mƎALLEm
ST Employee

Hello,

That could work with this config (I remember I tested it years ago):

CAN_Tx in open drain/common GND:

mALLEm_0-1768486869158.png

or CAN_Tx in Push-pull with common GND of all circuits:

mALLEm_1-1768487026929.png

but not recommended for high distances.

See also: https://www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

And using higher bitrates (a.k.a. CAN-FD or CAN-XL) would aggravate issues.


@Ozone wrote:

And using higher bitrates (a.k.a. CAN-FD or CAN-XL) would aggravate issues.


Agree.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
inky
Associate II

Thanks, I was only looking for point-to-point comms. Maybe using it for firmware updates on the F7, from the MP157, instead of a UART.

I don't follow why the RX and TX of both chips are joined together, instead of the UART configuration. Please explain

That shouldn't work as the UART does: with cross connection of Tx <-> Rx. There is an arbitration and acknowledgement mechanism in CAN communication that should be kept in place that Tx <-> Rx cross connection doesn't permit.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
mƎALLEm
ST Employee

In the configurations proposed above, the arbitration and acknowledgement are seen on any Rx from all Tx of the available CAN nodes (frame broadcast) which is the case where transceivers are used. 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello,

To answer that question:


@inky wrote:

I don't follow why the RX and TX of both chips are joined together, instead of the UART configuration. Please explain


In the CAN protocol, every node on the bus should listen continuously to what happening on the bus.

  1. In the arbitration phase, the senders while they are sending at the same time, they are listening to the bus level and compare to what they are sending: each difference is reported from the sender side as a loss of arbitration and put itself silent.
  2. In the data phase: the winner of the arbitration will continue to send its frame while it is listening to what happening on the bus. Each difference between what it is sending and what to it is listening is reported as an error.

Even if there are only two nodes on the CAN bus, these mechanisms couldn't be established when a cross connection of CAN_Tx <-> CAN_Rx is adopted.
That's why RX and TX of each node are joined together in the above configuration to let the sender listen to what it is sending.

Hope it's clear now.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
inky
Associate II

Thanks guys :)