English
Language : 

LM3S2412 Datasheet, PDF (529/691 Pages) Texas Instruments – Stellaris® LM3S2412 Microcontroller
Stellaris® LM3S2412 Microcontroller
14.3.12
Handling of Interrupts
If several interrupts are pending, the CAN Interrupt (CANINT) register points to the pending interrupt
with the highest priority, disregarding their chronological order. The status interrupt has the highest
priority. Among the message interrupts, the message object's interrupt with the lowest message
number has the highest priority. A message interrupt is cleared by clearing the message object's
INTPND bit in the CANIFnMCTL register or by reading the CAN Status (CANSTS) register. The
status Interrupt is cleared by reading the CANSTS register.
The interrupt identifier INTID in the CANINT register indicates the cause of the interrupt. When no
interrupt is pending, the register reads as 0x0000. If the value of the INTID field is different from 0,
then there is an interrupt pending. If the IE bit is set in the CANCTL register, the interrupt line to
the CPU is active. The interrupt line remains active until the INTID field is 0, meaning that all interrupt
sources have been cleared (the cause of the interrupt is reset), or until IE is cleared, which disables
interrupts from the CAN controller.
The INTID field of the CANINT register points to the pending message interrupt with the highest
interrupt priority. The SIE bit in the CANCTL register controls whether a change of the RXOK, TXOK,
and LEC bits in the CANSTS register can cause an interrupt. The EIE bit in the CANCTLregister
controls whether a change of the BOFF and EWARN bits in the CANSTS can cause an interrupt. The
IE bit in the CANCTL controls whether any interrupt from the CAN controller actually generates an
interrupt to the microcontroller's interrupt controller. The CANINT register is updated even when
the IE bit in the CANCTL register is clear, but the interrupt will not be indicated to the CPU.
A value of 0x8000 in the CANINT register indicates that an interrupt is pending because the CAN
module has updated, but not necessarily changed, the CANSTS , indicating that either an error or
status interrupt has been generated. A write access to the CANSTS register can clear the RXOK,
TXOK, and LEC bits in that same register; however, the only way to clear the source of a status
interrupt is to read the CANSTS register.
There are two ways to determine the source of an interrupt during interrupt handling. The first is to
read the INTID bit in the CANINT register to determine the highest priority interrupt that is pending,
and the second is to read the CAN Message Interrupt Pending (CANMSGnINT) register to see
all of the message objects that have pending interrupts.
An interrupt service routine reading the message that is the source of the interrupt may read the
message and clear the message object's INTPND bit at the same time by setting the CLRINTPND
bit in the CANIFnCMSK register. Once the INTPND bit has been cleared, the CANINT register
contains the message number for the next message object with a pending interrupt.
14.3.13
Test Mode
A Test Mode is provided, which allows various diagnostics to be performed. Test Mode is entered
by setting the TEST bit CANCTL register. Once in Test Mode, the TX[1:0], LBACK, SILENT and
BASIC bits in the CAN Test (CANTST) register can be used to put the CAN controller into the
various diagnostic modes. The RX bit in the CANTST register allows monitoring of the CANnRX
signal. All CANTST register functions are disabled when the TEST bit is cleared.
14.3.13.1 Silent Mode
Silent Mode can be used to analyze the traffic on a CAN bus without affecting it by the transmission
of dominant bits (Acknowledge Bits, Error Frames). The CAN Controller is put in Silent Mode setting
the SILENT bit in the CANTST register. In Silent Mode, the CAN controller is able to receive valid
data frames and valid remote frames, but it sends only recessive bits on the CAN bus and it cannot
start a transmission. If the CAN Controller is required to send a dominant bit (ACK bit, overload flag,
June 18, 2012
529
Texas Instruments-Production Data