Datasheet

Table Of Contents
Table 39-4. Example Filter Configuration for Rx Buffers
Filter Element SFID1[10:0] / EFID1[28:0] SFID2[10:9] / EFID2[10:9] SFID2[5:0] / EFID2[5:0]
0 ID message 1 00 00 0000
1 ID message 2 00 00 0001
2 ID message 3 00 00 0010
After the last word of a matching received message has been written to the Message RAM, the
respective New Data flag in register NDAT1, NDAT2 is set. As long as the New Data flag is set, the
respective Rx Buffer is locked against updates from received matching frames. The New Data flags have
to be reset by the CPU by writing a ‘1’ to the respective bit position.
While an Rx Buffer’s New Data flag is set, a Message ID Filter Element referencing this specific Rx Buffer
will not match, causing the acceptance filtering to continue. Following Message ID Filter Elements may
cause the received message to be stored into another Rx Buffer, or into an Rx FIFO, or the message may
be rejected, depending on filter configuration.
Rx Buffer Handling
Reset interrupt flag IR.DRX
Read New Data registers
Read messages from Message RAM
Reset New Data flags of processed messages
39.6.5.4 Debug on CAN Support
Debug messages are stored into Rx Buffers. For debug handling three consecutive Rx buffers (e.g. #61,
#62, #63) have to be used for storage of debug messages A, B, and C. The format is the same as for an
Rx Buffer or an Rx FIFO element (see 39.9.2 Rx Buffer and FIFO Element ).
Advantage: Fixed start address for the DMA transfers (relative to RXBC.RBSA), no additional
configuration required.
For filtering of debug messages Standard / Extended Filter Elements with SFEC / EFEC = “111” have to
be set up. Messages matching these filter elements are stored into the Rx Buffers addressed by SFID2 /
EFID2[5:0].
After message C has been stored, the DMA request output is activated and the three messages can be
read from the Message RAM under DMA control. The RAM words holding the debug messages will not
be changed by the CAN while DMA request is activated. The behavior is similar to that of an Rx Buffers
with its New Data flag set.
After the DMA has completed the DMA unit sets the DMA acknowledge. This resets DMA request. Now
the CAN is prepared to receive the next set of debug messages.
Filtering for Debug Messages
Filtering for debug messages is done by configuring one Standard / Extended Message ID Filter Element
for each of the three debug messages. To enable a filter element to filter for debug messages SFEC /
EFEC has to be programmed to “111”. In this case fields SFID1 / SFID2 and EFID1 / EFID2 have a
different meaning (see 39.9.5 Standard Message ID Filter Element and 39.9.6 Extended Message ID
Filter Element). While SFID2 / EFID2[10:9] controls the debug message handling state machine, SFID2 /
EFID2[5:0] controls the location for storage of a received debug message.
SAM D5x/E5x Family Data Sheet
CAN - Control Area Network
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1220