The MCAN module employs two sets of acceptance filters - one set for standard and one set for extended identifiers. These filters can be assigned to an Rx Buffer or to one of the two Rx FIFOs.
The main features of the filter elements are:
- Each filter element can be configured as:
- Range filter (from - to)
- Filter for specific IDs (for one or two dedicated IDs)
- Classic bit mask filter
- Each filter element can be enabled/disabled individually
- Each filter element can be configured for acceptance or rejection filtering
- Filters are checked sequentially and execution (acceptance filtering procedure) stops at the first matching filter element or when the end of the filter list is reached
Related configuration registers are:
- Global Filter Configuration (MCAN_GFC) register
- Standard ID Filter Configuration (MCAN_SIDFC) register
- Extended ID Filter Configuration (MCAN_XIDFC) register
- Extended ID AND Mask (MCAN_XIDAM) register
Depending on the configuration of the filter
element (see SFEC/EFEC in Section 18.5.16) if filter matches, one of the following actions is performed:
- Received frame is stored in
FIFO 0 or FIFO 1
- Received frame is stored in
Rx Buffer
- Received frame is stored in
Rx Buffer and generation of pulse at filter event pin is performed. This is
high level single MCAN_ICLK pulse.
- Received frame is
rejected
- Set High Priority Message
interrupt flag MCAN_IR.HPM
- Set High Priority Message
interrupt flag MCAN_IR.HPM and store received frame in FIFO 0 or FIFO 1
Acceptance filtering starts when complete Message ID is received. Acceptance filtering stops at the first matching enabled filter element or when the end of the filter list is reached. If a filter element matches - the Rx Handler starts writing the received message data in portions of 32-bit to the matching Rx Buffer or Rx FIFO. If an error condition occurs (for example: CRC error), this message is rejected with the following impact on the affected Rx Buffer or Rx FIFO:
- Rx Buffer: New Data flag (MCAN_NDAT1/MCAN_NDAT2) of matching Rx Buffer is not set, but Rx Buffer (partly) overwritten with received data (for error type, see MCAN_PSR.LEC and MCAN_PSR.DLEC fields,respectively).
- Rx FIFO: Put index of matching Rx FIFO is not
updated, but related Rx FIFO element (partly) overwritten with received data
(for error type, see MCAN_PSR.LEC and MCAN_PSR.DLEC fields, respectively).
If matching Rx FIFO is configured to operate in overwrite mode, the boundary
conditions described in Section 18.5.13.2.2 must be considered.
Note: When an accepted message is written to one of the two Rx FIFOs, or into
an Rx Buffer, the unmodified received identifier is stored independent
of the filters used. The result of the acceptance filter process is
strongly depending on the sequence of configured filter
elements.