CAN filtering is a mechanism used in controller area networks to control

WhatsApp Channel Join Now

CAN filtering is a mechanism used in controller area networks to control which messages can be received by nodes. In a CAN network, all nodes receive all messages on the network because of CAN bus communication. In order to improve efficiency and reduce the burden of processing irrelevant data, nodes can configure filters to only receive specific messages. CAN filtering is divided into software filtering and hardware filtering.

Software filtering:

CAN software filtering refers to the process of filtering and processing messages transmitted on the CAN bus at the software level. The software filtering logic of our CAN series products is to filter CAN ID. The following example uses our CAN to Ethernet device ECAN-E01/ECAN-E01S. Our company’s Ebyte CAN to Ethernet device ECAN-E01/ECAN-E01S supports custom 3-way software CAN ID filtering.

Configure the filter parameters through the host computer.

Configuration item description:

1. Enable option: Check to enable the filter, otherwise the filter is invalid.

2. ID upper limit (Hex): This configuration item is to set the maximum CAN ID that can receive data, enter the HEX value.

3. ID lower limit (Hex): This configuration item is to set the minimum CAN ID that can receive data, enter the HEX value.

Note: The CAN ID range for receiving data is between the ID lower limit (Hex) and the ID upper limit (Hex). As shown in the figure above, the ID upper limit is 3 and the ID lower limit is 1, then the received CAN IDs are only 1, 2, and 3 (all HEX values ​​here)

Hardware filtering:

CAN hardware filtering refers to the process of filtering messages transmitted on the CAN bus at the hardware level of the CAN controller. The following example uses our company’s CAN to Ethernet device ECAN-E01/ECAN-E01S. Our company’s CAN to Ethernet device ECAN-E01/E01S device supports setting 14 sets of hardware filtering.

Configure the filter parameters through the host computer.

Configuration item description:

1. Enable option: Check to enable the filter, uncheck to disable the filter.

2. Filter mode selection: There are 2 filter modes, the first is mask bit filtering, and the second is identifier list filtering.

Mask bit filtering: In this mode, the hardware filter uses a mask bit and an identifier to define which messages can pass. The mask bit determines which bits need to be matched and which bits can be ignored. If the received message identifier matches the identifier in the filter where the mask bit is 1, the message can pass. If a bit in the mask code is 0, the corresponding bit in the identifier match value does not have to match the corresponding bit in the identifier of the received frame.

Identifier list filtering: In this mode, the hardware filter creates a list of identifiers that are allowed to pass. The message will only be received if the identifier of the received CAN message completely matches an identifier in the list.

3. Bit width selection: one is 16bit and the other is 32bit.

4. IDHigh & IDLow: IDHigh (high 16 bits of CAN message identifier), IDLow (low 16 bits of CAN message identifier)

5. MaskHigh & MaskLow: MaskHigh (high 16 bits of mask used in hardware filter configuration), MaskLow (low 16 bits of mask used in hardware filter configuration)

RTR: Remote Transmit Request Bit. The RTR bit is used to distinguish between data frames and remote frames. In data frames, the RTR bit must be “dominant” (logical 0), indicating that this is a data frame containing actual data; while in remote frames, the RTR bit must be “hidden” (logical 1), indicating that this is a remote frame requesting the transmission of a data frame with a specific identifier, which does not contain actual data payload itself. Checked is logical 1, unchecked is logical 0.

IDE: Identifier extension bit. The IDE bit is used to distinguish between standard frame format and extended frame format. In a standard frame, the IDE bit is dominant (logic 0), indicating that this is a standard format data frame, using an 11-bit identifier; in an extended frame, the IDE bit is recessive (logic 1), indicating that this is an extended format data frame, using a 29-bit identifier. Checking is logic 1, and unchecking is logic 0.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *