3.4.1 Interrupts Scheme
3.4.2 Mailbox Interrupt
www.ti.com
Interrupts
The interrupt flags are set if the corresponding interrupt condition occurred. The system interrupt flags are
set depending on the setting of GIL (CANGIM.2). If set, the global interrupts set the bits in the CANGIF1
register, otherwise they set in the CANGIF0 register.
The GMIF0/GMIF1(CANGIF0.15/CANGIF1.15) bit is set depending on the setting of the MIL[n] bit that
corresponds to the mailbox originating that interrupt. If the MIL[n] bit is set, the corresponding mailbox
interrupt flag MIF[n] sets the GMIF1 flag in the CANGIF1 register, otherwise, it sets the GMIF0 flag.
If all interrupt flags are cleared and a new interrupt flag is set, the CAN module interrupt output line
(ECAN0INT or ECAN1INT) is activated if the corresponding interrupt mask bit is set. The interrupt line
stays active until the interrupt flag is cleared by the CPU by writing a 1 to the appropriate bit.
The GMIF0 (CANGIF0.15) or GMIF1 (CANGIF0.15) bit must be cleared by writing a 1 to the appropriate
bit in the CANTA register or the CANRMP register (depending on mailbox configuration) and cannot be
cleared in the CANGIF0/CANGIF1 register.
After clearing one or more interrupt flags, and one or more interrupt flags are still pending, a new interrupt
is generated. The interrupt flags are cleared by writing a 1 to the corresponding bit location. If the GMIF0
or GMIF1 bit is set, the mailbox interrupt vector MIV0 (CANGIF0.4-0) or MIV1 (CANGIF1.4-0) indicates the
mailbox number of the mailbox that caused the setting of the GMIF0/1. It always displays the highest
mailbox interrupt vector assigned to that interrupt line.
Each of the 32 mailboxes in the eCAN or the 16 mailboxes in the SCC can initiate an interrupt on one of
the two interrupt output lines 1 or 0. These interrupts can be receive or transmit interrupts depending on
the mailbox configuration.
There is one interrupt mask bit (MIM[n]) and one interrupt level bit (MIL[n]) dedicated to each mailbox. To
generate a mailbox interrupt upon a receive/transmit event, the MIM bit has to be set. If a CAN message
is received (RMP[n]=1) in a receive mailbox or transmitted (TA[n]=1) from a transmit mailbox, an interrupt
is asserted. If a mailbox is configured as remote request mailbox (CANMD[n]=1, MSGCTRL.RTR=1), an
interrupt occurs upon reception of the reply frame. A remote reply mailbox generates an interrupt upon
successful transmission of the reply frame (CANMD[n]=0, MSGID.AAM=1).
The setting of the RMP[n] bit or the TA[n] bit also sets the GMIF0/GMIF1 (GIF0.15/GIF1.15) flag in the
GIF0/GIF1 register if the corresponding interrupt mask bit is set. The GMIF0/GMIF1 flag then generates
an interrupt and the corresponding mailbox vector (= mailbox number) can be read from the bit field
MIV0/MIV1 in the GIF0/GIF1 register. If more than one mailbox interrupts are pending, the actual value of
MIV0/MIV1 reflects the highest priority interrupt vector. The interrupt generated depends on the setting in
the mailbox interrupt level (MIL) register.
The abort acknowledge flag (AA[n]) and the abort acknowledge interrupt flag (AAIF) in the GIF0/GIF1
register are set when a transmit message is aborted by setting the TRR[n] bit. An interrupt is asserted
upon transmission abortion if the mask bit AAIM in the GIM register is set. Clearing the AA[n] flag(s) clears
the AAIF0/AAIF1 flag.
A lost receive message is notified by setting the receive message lost flag RML[n] and the receive
message lost interrupt flag RMLIF0/RMLIF1in the GIF0/GIF1 register. If an interrupt shall be generated
upon the lost receive message event, the receive message lost interrupt mask bit (RMLIM) in the GIM
register has to be set. Clearing the RML[n] flag does not reset the RMLIF0/RMLIF1 flag. The interrupt flag
has to be cleared separately.
Each mailbox of the eCAN (in eCAN mode only) is linked to a message- object, time-out register (MOTO).
If a time-out event occurs (TOS[n] = 1), a mailbox timeout interrupt is asserted to one of the two interrupt
lines if the mailbox timeout interrupt mask bit (MTOM) in the CANGIM register is set. The interrupt line for
mailbox timeout interrupt is selected in accordance with the mailbox interrupt level (MIL[n]) of the
concerned mailbox.
SPRU074F – May 2002 – Revised January 2009
eCAN Configuration
77