The Controller Area Network (Can): Prioritizing
Conflicts can arise in a network when several control modules try to transmit messages at the same time. For example, if the driver brakes at the same time as the front seat passenger changes the climate control settings and a passenger in the rear seat uses the power windows. To ensure safe operation the messages must be prioritized. In addition, the delays that arise when messages are queued must be reasonable. This is so the customer does not feel the system is slow.
To solve problems with conflicts and time delays there is a priority order of messages to ensure good functionality.
Prioritizing of messages is determined by the number of zeroes at the beginning of a message, the more zeroes the higher the priority.
Prioritizing occurs as follows:
- When the network is available all the control modules with "something to say" send bit one in their message.
- All the control modules detect what has been transmitted on the network
- If a control module has transmitted 0 those that have sent 1 stop and wait until the next time the network is available
- Those that transmitted 0 transmit bit two of the message
- If a control module has transmitted 0 as bit two those that have sent 1 stop and wait until the next time the network is available and so on.
The message with the highest priority (most zeroes at the beginning) "wins" and is sent first.
The end of a message is seven zeroes. The control modules then know that the network is available and a new message can be sent in priority order.