CANBUS is a two-wire, half-duplex, bus based LAN system that is ‘collision free’.
Data is BROADCAST onto the bus -THERE IS NO SUCH THNG AS A POINT TO POINT CONNECTION as with data LANs.
All nodes receive all broadcast data and decide whether or not that data is relevant.
A CANBUS B frame consists of a four byte header (containing a 29-bit identifier), followed by up to 8 data bytes.
A receiving node would examine the identifier to decide if it was relevant (e.g. waiting for a frame with ID 00001567 which contains data to switch on or off a motor).
It could do this via software (using a C if or case statement); in practice the Canbus interface contains firmware to carry out this task
using the acceptance filter and mask value to filter out unwanted messages.
The filter mask is used to determine which bits in the identifier of the received frame are compared with the filter
-
If a mask bit is set to a zero, the corresponding ID bit will automatically be accepted, regardless of the value of the filter bit.
-
If a mask bit is set to a one, the corresponding ID bit will be compare with the value of the filter bit;
if they match it is accepted otherwise the frame is rejected.