CAN bus arbitration on oscilloscope
Modules on a CAN bus can start talking at any moment. To avoid collisions, a special arbitration scheme is used. But can it be seen on an oscilloscope? The answer is: somewhat.
Here is a waveform from article “Who said what” from PicoAuto website:
We can see two packets. At the end of each packet (areas A) there is an Acknowledgement pulse. It stands out because there are many modules responding, pulling the CAN-High voltage even higher, and the CAN-Low voltage even lower. However, at the beginning of packet 2 (area B) we can also see voltages different from the usual ones. This is the echo of the arbitration process – two modules started talking, but one of them quickly gave up after realizing the other one has higher priority.
To see this process clearly, we can try to connect not to the CAN lines, but to transmit (TXD) pins of transceivers inside modules. Normally, TXD is at 5V, but gets pulled to 0V when the module's microcontroller wants the CAN bus to go dominant:
In the following example, the blue trace is TXD for a scantool, sending OBD requests with ID 7DFh. The red trace is TXD for Body Integrated Unit (BIU), using IDs 514h and 620h. The scantool decides to start communication and pulls its TXD to ground. However, the BIU also wants to send a message with ID 514h. As 7 is 111b, and 5 is 101b, after sending the second bit of its ID, the scantool notices that the BIU put in zero instead, and gives up. Message with ID 7DFh is finally sent out 0.5ms later (see packet 1713 in the serial decoder window).
Here is the close-up of the message: