This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

eCAN arbitration in Piccolo



Hello,

We are using CAN bus with a proprietary (non-standard) high level protocol. There can be an arbitrary number of nodes connected to the bus, and at start-up we auto-assign node IDs using a master node that assigns a different CAN ID to every slave node. The nodes use this CAN ID to transmit their CAN packets.

Initially, some nodes have the same node ID and send frames (at the same time) with same CAN ID and their serial numbers in the CAN dataWe know that CAN packets with same ID and different data are not supposed to be sent in a "well-designed" system, but we only do this at the beggining to automatically assign different IDs to each node, based on their serial number (which is always different). There only are identical Piccolos in this CAN bus.

This process works well, but we noticed that the two nodes with the same ID compete for a few miliseconds to send the packet, and because they have different data, they get errors during these retries. After this time (around 6 to 8ms) one of the nodes sends the packet successfully and almost immediately the other one sends it too.

The strange thing is that after this first time where the two nodes compete to send the packet for 6-8ms, if they want to send again under the same conditions (packet with same ID and different data), this time there is some kind of arbitration that works like the CAN ID arbitration that makes one of the nodes immeditialy send the data first (without any retry) and then the other node. The node that "wins" is the one with the first different/dominant bit, which is identical to the arbitration used in the CAN ID.

We thought that the modules may be going to error-passive mode, however the EP bit in CANES is 0 and CANTEC is 127 when this "data arbitration" starts to work. 

We would like this "data arbitration" to be always active because it makes our protocol very clean and consistent. 

Can somebody explain this behaviour and tell me how to enable it during the configuration?

Thank you in advance,

Max

  • Hello,

    I think now I better understand what's going on. The two nodes are going to error-passive mode after a few ms of competing to send the packets with same ID and different data. CANTEC goes to 128, toggles the error-passive mode, sends the CAN packet successfully and CANTEC is decremented in one, that's why I always read a 127 value.

    The CAN peripheral stays in that mode with CANTEC=127, so every time CANTEC is increased in one (because of a data collision), it goes to error-passive mode and enables that "data arbitration" that is useful for my application.

    The first time (after configuring the CAN peripheral) when the nodes send the packets with same ID and different data, CANTEC takes a few ms to be increased to 128 and enable the error-passive mode. After this first time, CANTEC is one count away (127) from enabling the passive mode so it enables it immediatelly and I don't see the "competition" any more.

    I hope I'm clear with my explanation...

    My question would change to the following: is any disadvantage in going back and forth to the error-passive mode? 

    Could I just leave error-passive mode enabled since the beggining?

    Thanks,

    Max