EasyManua.ls Logo

Microchip Technology dsPIC33 series - 6.10 Aborting Transmission; 6.11 Remote Transmit Request - RTR; 6.12 Mismatch of DLC and Payload Size During Transmission

Microchip Technology dsPIC33 series
116 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
2018 Microchip Technology Inc. DS70005340A-page 71
CAN FD Protocol Module
6.10 Aborting Transmission
A pending transmission can only be aborted before the transmission of the message starts,
before the Start-of-Frame (SOF).
The transmission of a specific FIFO can be aborted by clearing TXREQ in the Transmit Queue
Control register; it cannot be aborted by clearing the bits in the C1TXREQH/L registers. Writing
a ‘0’ to one of the bits in the C1TXREQH/L registers will be ignored. The TXABT bit in the FIFO
Status register will be set after a successful abortion. TXREQ will remain set until the message
either aborts or is successfully transmitted.
Setting ABAT (C1CONH<11>) will abort all pending messages of all FIFOs. After all TXREQx bits
are cleared, ABAT has to be cleared in order to be able to transmit new messages.
Clearing TXREQ for a transmit FIFO will attempt to abort all transmissions in the FIFO. If a
message is successfully transmitted, the FIFO index will be updated as normal. If the message
is successfully aborted, the FIFO index will not change.
The user can then use the FIFO Message Index bits, FIFOCI<4:0> (C1FIFOSTAx<12:8>), to
identify messages that are transmitted. To reset the transmit FIFO index and erase all pending
messages the user can set FRESET. The FIFO can then be loaded with new messages to be
transmitted.
6.11 Remote Transmit Request – RTR
The CAN bus system has a method for allowing a master node to request data from another
node. The master sends a message with the RTR bit set. The message contains no data, only
an address to trigger a filter match.
Remote frames are only specified for CAN 2.0 frames; they are not supported in CAN FD frames.
The filter that is configured to respond to a Remote Transmit Request will point to a FIFO that is
configured for transmission and RTREN has to be set.
Automatic remote data requests can be handled without MCU intervention. If a FIFO is properly
configured, when a filter matches and points to the FIFO, the FIFO will be queued for
transmission.
The FIFO must be configured as follows:
Set TXEN to ‘1’.
A filter must be enabled and loaded with a matching message identifier
The Buffer Pointer for that filter must point to the TX FIFO. (Normally, a filter points to an
RX FIFO.)
RTREN bit must be set to ‘1’ to enable RTR.
The FIFO must be preloaded with at least one message to be sent.
When an RTR message is received, and it matches a filter pointing to a properly configured
transmit FIFO, the TXREQ bit is set, queuing the object for transmission according to priorities.
A FIFO will only be transmitted if TXEN and RTREN are set, and if it is NOT empty. When a
request for a remote transmission occurs while the FIFO is empty, the event will be treated as an
overflow and the RXOVIF bit will be set.
6.12 Mismatch of DLC and Payload Size During Transmission
The PLSIZEx bits reserve a certain number of bytes in the transmit FIFO. The CAN FD Protocol
Module handles mismatches between the DLC and payload size as follows:
If the DLC is smaller than the reserved payload, the number of data bytes specified by the
DLC will be transmitted.
If the DLC is bigger than the reserved payload, the module will not transmit the message.
Instead, it will set the IVMIF (C1INTL<15>) and DLCMM (C1BDIAG1H<15>) flags and
clear the TXREQ flag. The application can use the TEF to identify the message that is not
transmitted.

Related product manuals