CAN filtering is a mechanism in Controller Area Networks (CAN) used to control which messages a node can receive. In a CAN network, all nodes receive every message transmitted on the bus due to the nature of CAN communication. To enhance efficiency and reduce the processing burden of irrelevant data, nodes can configure filters to selectively receive specific messages. CAN filtering is categorized into software filtering and hardware filtering.
Software Filtering
Software filtering refers to the process of screening and processing CAN messages at the software level. Our CAN series products use software filtering logic based on CAN IDs. For example, our CAN-to-Ethernet devices, ECAN-E01/ECAN-E01S, support custom filtering of up to three CAN IDs via software.
Configuration Steps via the PC Application:
Configuration Items Explanation:
-
Enable Option: Check this box to enable the filter; leave it unchecked to disable the filter.
-
ID Upper Limit (Hex): Sets the maximum CAN ID for receivable data (input in HEX format).
-
ID Lower Limit (Hex): Sets the minimum CAN ID for receivable data (input in HEX format).
Note: The range of receivable CAN IDs is defined as the interval between the ID Lower Limit and the ID Upper Limit (inclusive). For instance, if the ID Upper Limit is set to 3 and the ID Lower Limit is set to 1, only CAN IDs 1, 2, and 3 will be received (all in HEX)
Hardware Filtering
Hardware filtering refers to the process of screening CAN messages at the CAN controller's hardware level. Our ECAN-E01/ECAN-E01S devices support the configuration of up to 14 hardware filters.
Configuration Steps via the PC Application:
Configuration Items Explanation:
-
Enable Option: Check this box to enable the filter; leave it unchecked to disable the filter.
-
Filter Mode Selection: Two modes are available:
-
Mask Filtering: In this mode, the hardware filter uses a mask and an identifier to define which messages are allowed. The mask determines which bits must match and which can be ignored. If the received message's identifier matches the filter's identifier at the positions where the mask is set to 1, the message is allowed. If a bit in the mask is set to 0, the corresponding bit in the identifier does not need to match.
-
Identifier List Filtering: In this mode, the hardware filter creates a list of identifiers that are allowed. Only messages with identifiers that exactly match one of the listed identifiers will be received.
-
Bit Width Selection: Options include 16-bit and 32-bit widths.
-
IDHigh & IDLow:
-
IDHigh: The upper 16 bits of the CAN message identifier.
-
IDLow: The lower 16 bits of the CAN message identifier.
-
MaskHigh & MaskLow:
-
MaskHigh: The upper 16 bits of the mask used in hardware filtering.
-
MaskLow: The lower 16 bits of the mask used in hardware filtering.
Additional Parameters
-
RTR (Remote Transmission Request Bit):
-
RTR differentiates between data frames and remote frames.
-
In a data frame, the RTR bit must be dominant (logic 0), indicating it contains actual data.
-
In a remote frame, the RTR bit must be recessive (logic 1), indicating a request for data with a specific identifier without carrying payload data.
-
Checked = Logic 1; Unchecked = Logic 0.
-
IDE (Identifier Extension Bit):
-
IDE differentiates between standard and extended frame formats.
-
In a standard frame, IDE is dominant (logic 0), meaning an 11-bit identifier is used.
-
In an extended frame, IDE is recessive (logic 1), meaning a 29-bit identifier is used.
-
Checked = Logic 1; Unchecked = Logic 0.
This comprehensive guide outlines the configuration and functionalities of software and hardware CAN filtering in our ECAN-E01/ECAN-E01S devices. By leveraging these features, users can optimize message handling in their CAN networks.