Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will happen in CAN?

I had an interview. The interviewer asked me:

If two nodes are sending two messages of the same identifier (0x100) with different data, who will win the arbitration? Which message will be there on the bus?

If node 1 wins then what about node 2's message? When will node 2's message be sent?

like image 736
Rasmi Ranjan Nayak Avatar asked Oct 27 '25 05:10

Rasmi Ranjan Nayak


1 Answers

There are two cases here

  1. Same ID and the same DATA field
  2. Same ID with a different DATA field

CASE 1: when two nodes are trying to transmit the same ID and the same data field, the CAN will see it as a single message, and it will send it on the CAN bus. Here you really can't say if node 1 is sending or node 2 is sending, because both has the same ID and data.

CASE 2: here the data field is different. Until the arbitration field there will be no problem. Since the data is different for both the nodes you will get a bus error. This is because your data field is protected by a CRC and bit stuffing also will come into the picture.

like image 107
Kiran.vanam Avatar answered Oct 29 '25 07:10

Kiran.vanam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!