English
Language : 

PIC18FXX8 Datasheet, PDF (230/402 Pages) Microchip Technology – 28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN Module
PIC18FXX8
19.4.3 INITIATING TRANSMISSION
To initiate message transmission, the TXREQ bit must
be set for each buffer to be transmitted. When TXREQ
is set, the TXABT, TXLARB and TXERR bits will be
cleared.
Setting the TXREQ bit does not initiate a message
transmission; it merely flags a message buffer as ready
for transmission. Transmission will start when the
device detects that the bus is available. The device will
then begin transmission of the highest priority message
that is ready.
When the transmission has completed successfully,
the TXREQ bit will be cleared, the TXBnIF bit will be set
and an interrupt will be generated if the TXBnIE bit is
set.
If the message transmission fails, the TXREQ will
remain set, indicating that the message is still pending
for transmission and one of the following condition flags
will be set. If the message started to transmit but
encountered an error condition, the TXERR and the
IRXIF bits will be set and an interrupt will be generated.
If the message lost arbitration, the TXLARB bit will be
set.
19.4.4 ABORTING TRANSMISSION
The MCU can request to abort a message by clearing
the TXREQ bit associated with the corresponding
message buffer (TXBnCON<3>). Setting the ABAT bit
(CANCON<4>) will request an abort of all pending
messages. If the message has not yet started transmis-
sion, or if the message started but is interrupted by loss
of arbitration or an error, the abort will be processed.
The abort is indicated when the module sets the ABT
bits for the corresponding buffer (TXBnCON<6>). If the
message has started to transmit, it will attempt to
transmit the current message fully. If the current
message is transmitted fully and is not lost to arbitration
or an error, the ABT bit will not be set because the
message was transmitted successfully. Likewise, if a
message is being transmitted during an abort request
and the message is lost to arbitration or an error, the
message will not be retransmitted and the ABT bit will
be set, indicating that the message was successfully
aborted.
DS41159D-page 228
 2004 Microchip Technology Inc.