English
Language : 

LM3S2965_0711 Datasheet, PDF (412/574 Pages) List of Unclassifed Manufacturers – Microcontroller
Controller Area Network (CAN) Module
16.4
16.4.1
Controller Area Network Functional Description
The CAN module conforms to the CAN protocol version 2.0 (parts A and B). Message transfers that
include data, remote, error, and overload frames with an 11-bit identifier (standard) or a 29-bit
identifier (extended) are supported. Transfer rates can be programmed up to 1 Mbps.
The CAN module consists of three major parts:
■ CAN protocol controller and message handler
■ Message memory
■ CAN register interface
The protocol controller transfers and receives the serial data from the CAN bus and passes the data
on to the message handler. The message handler then loads this information into the appropriate
message object based on the current filtering and identifiers in the message object memory. The
message handler is also responsible for generating interrupts based on events on the CAN bus.
The message object memory is a set of 32 identical memory blocks that hold the current configuration,
status, and actual data for each message object. These are accessed via the CAN message object
register interface. The message memory is not directly accessable in the Stellaris® memory map,
so the Stellaris® CAN controller provides an interface to communicate with the message memory.
The CAN message object register interface provides two register sets for communicating with the
message objects. Since there is no direct access to the message object memory, these two interfaces
must be used to read or write to each message object. The two message object interfaces allow
parallel access to the CAN controller message objects when multiple objects may have new
information that needs to be processed.
Initialization
The software initialization is started by setting the INIT bit in the CAN Control (CANCTL) register,
with software or by a hardware reset, or by going bus-off, which occurs when the transmitter's error
counter exceeds a count of 255. While INIT is set, all message transfers to and from the CAN bus
are stopped and the status of the CAN transmit output is recessive (High). Entering the initialization
state does not change the configuration of the CAN controller, the message objects, or the error
counters. However, some configuration registers are only accessible when in the initialization state.
To initialize the CAN controller, set the CAN Bit Timing (CANBIT) register and configure each
message object. If a message object is not needed, it is sufficient to set it as not valid by clearing
the MsgVal bit in the CANIFnARB2 register. Otherwise, the whole message object has to be
initialized, as the fields of the message object may not have valid information causing unexpected
results. Access to the CAN Bit Timing (CANBIT) register and to the CAN Baud Rate Prescalar
Extension (CANBRPE) register to configure the bit timing are enabled when both the INIT and
CCE bits in the CANCTL register are set. To leave the initialization state, the INIT bit must be
cleared. Afterwards, the internal Bit Stream Processor (BSP) synchronizes itself to the data transfer
on the CAN bus by waiting for the occurrence of a sequence of 11 consecutive recessive bits (Bus
Idle) before it takes part in bus activities and starts message transfers. The initialization of the
message objects is independent of being in the initialization state and can be done on the fly, but
message objects should all be configured to particular identifiers or set to not valid before the BSP
starts the message transfer. To change the configuration of a message object during normal
operation, set the MsgVal bit in the CANIFnARB2 register to 0 (not valid). When the configuration
is completed, MsgVal is set to 1 again (valid).
412
November 30, 2007
Preliminary