English
Language : 

PIC18F258 Datasheet, PDF (226/384 Pages) Microchip Technology – High Performance, 28/40-Pin Enhanced FLASH Microcontrollers with CAN
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 trans-
mission 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 mes-
sage buffer (TXBnCON<3>). Setting the ABAT bit
(CANCON<4>) will request an abort of all pending mes-
sages. If the message has not yet started transmission,
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 mes-
sage has started to transmit, it will attempt to transmit the
current message fully. If the current message is transmit-
ted 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 arbi-
tration or an error, the message will not be retransmitted
and the ABT bit will be set, indicating that the message
was successfully aborted.
DS41159B-page 224
Preliminary
 2002 Microchip Technology Inc.