Jump to content
Electronics-Lab.com Community

Recommended Posts

Posted

1. What is CAN?

Controller Area Network (CAN) is a standard protocol used for communication between electronic devices in vehicles. CAN filters are used to filter the messages received on the CAN bus, ensuring that only specific data frames are processed. In CAN communication, the configuration of the filters is crucial for performance and message handling accuracy.

2. What is the Single Filter Mode in CAN Filters?

Before using the ECAN-E02 in single filter mode, it’s important to understand that single filter mode refers to a filter configuration where only a single filter condition is applied. In this mode, the CAN controller uses this one condition to filter the incoming CAN messages. Messages that meet the filter condition will be accepted and passed to the application for processing, while those that do not meet the condition will be discarded.

Main Features:

  1. Simple and Easy to Use: The single filter mode is usually simple, ideal for scenarios where only a specific type of message is of interest.
  2. Simple Filtering Rules: There is only one filter rule to match a specific identifier (ID), which reduces complexity for applications.
  3. Moderate Performance Impact: Since there is only one filter condition, the single filter mode typically does not impose a significant load on system performance, making it suitable for applications requiring low latency.

3. ECAN-E02’s Single Filter Mode

Let’s first observe the ECAN-E02’s user interface for the single filter mode:

  1. CodeHigh represents bits 16 to 31, and CodeLow represents bits 0 to 15.
  2. Similarly, MaskHigh represents bits 16 to 31, and MaskLow represents bits 0 to 15.
  3. In the ECAN-E02 filtering interface, you can directly configure the Code and Mask values. For the ST (Standard) frame:
    • RTR represents the remote frame.
    • ID00-ID10 represents the 11-bit standard frame ID.
    • DB1[0-7] represents the first byte of the data frame (8 bits).
    • DB2[0-7] represents the second byte of the data frame (8 bits) (from left to right, with "XX" meaning no configuration required).
    For the ET (Extended) frame:
    • RTR represents the remote frame.
    • ID00-ID28 represents the 29-bit extended frame ID (with "XX" indicating no configuration required).

After understanding the basic configuration, we can analyze the setup based on test settings.

Test Setup Example:

We want to achieve the following configuration:

  • CodeHigh (Hex): 0x0020
  • CodeLow (Hex): 0x0008
  • MaskHigh (Hex): 0xFFCF
  • MaskLow (Hex): 0xFFF3

After saving the parameters and restarting the device, use a network debugging tool to connect to channel 1 server, and a CAN analyzer to connect to channel 1’s CAN interface. The network tool will only receive standard data frames with odd IDs, where the fourth bit of the second data byte is high (e.g., a data frame like 00 08 00 00 00 00 00 00 can be received). It will also receive extended data frames with odd IDs where the 17th bit is 0 and the 18th bit is 1 (e.g., ID 50001 can be received).

Configuration Explanation:

  1. Standard Data Frame Filtering (ST):

    • Frame ID: The filter condition specifies that the frame ID must be odd. This is because any number with an increment of 1 in this position will result in an odd ID, so only odd-numbered standard frames will be received.
    • Data Byte Filtering: In the DB2[3] part of the standard frame, the Code is 1 and the Mask is 0, which means this bit must be high. The Mask condition ensures that this bit matches the Code value. As a result, only standard data frames with odd IDs and where the fourth bit of the second data byte is high (e.g., 00 08 00 00 00 00 00 00) can be received.
  2. Extended Data Frame Filtering (ET):

    • Frame ID: For the extended frame, the ID must start with 1 in the first bit, and the 17th bit should be 0 and the 18th bit should be 1, as per the Mask settings. Therefore, only extended frames with odd IDs and where the 17th bit is 0 and the 18th bit is 1 (e.g., ID 50001) will be accepted.

Conclusion:

By configuring the Code and Mask values appropriately, the ECAN-E02’s single filter mode can efficiently filter CAN messages based on the specific frame ID and data content, optimizing communication for applications such as CAN bus diagnostics or custom communication setups. This setup enables a simple yet effective way of filtering messages that match specific criteria, ensuring the system processes only relevant data.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...