11.6.2 CAN Controller Registers

This section describes the register and bit description of various categories of registers in the CAN controller. In addition, system registers which are applicable to CAN are described in this section. This provides programmers the view for firmware development. Microchip recommends using drivers provided in the tool set for application development.

The CAN base address resides at 0x40015000 and extends to address 0x40015FFF in the Cortex-M3 processor memory map. The registers set in the CAN controller are summarized in the following table.

Table 11-7. Summary of CAN Controller Registers
Register NameAddressR/WReset ValueDescription
Table 11-80x018R/W0CAN configuration register.

The CAN controller has to be configured prior to its use. The configuration includes effective CAN data rate, CAN data synchronization, and message buffer arbitration. This register has to be configured before the CAN controller is started (Run mode).

Run or STOP of the CAN controller is a different action than reset. See Command Register for more details.

Table 11-90x014R/W0The CAN controller is used in different operating modes. By disabling transmitting data, it is possible to use the CAN in 
Listen-only mode, enabling features such as automatic bit rate detection. Before starting the CAN controller, all the CAN configuration registers have to be set according to the target application.
Table 11-100x020R/W0Transmit Message0 buffer control and command register
Table 11-110x024R/W0Transmit Message0 buffer identifier register
Table 11-120x028R/W0Transmit Message0 buffer data high register
Table 11-130x02CR/W0Transmit Message0 buffer data low register
Table 11-150x0CR0Transmit (TX) message buffer status.

This bundles transmit request (TxReq) pending flags from all 32 receive message buffers.

Table 11-160x220R/W0Receive Message0 buffer command and control register
Table 11-170x224R/W0Receive Message0 buffer Identifier register
Table 11-180x228R/W0Receive Message0 buffer data high register
Table 11-190x22CR/W0Receive Message0 buffer data low register
Table 11-200x230R/W0Acceptance Mask Register (AMR)

The AMR register defines whether the incoming bit is checked against the ACR register

Table 11-210x234R/W0Acceptance Code Register (ACR)
Table 11-220x238R/W0AMR- Data
Table 11-230x23CR/W0ACR- Data
Table 11-250x08R0Receive (RX) message buffer status. This bundles message available (MsgAv) flags from all 32 receive message buffers.
Table 11-260x01CRW0Error capture register

Can be used to perform additional CAN bus diagnostics

Table 11-270x010R0CAN error status indicator register

Provides visibility into CAN controller error state, receive error count, and transmit error count. Special flags to report error counter values equal to or in excess of 96 errors are available to indicate heavily disturbed bus situations.

Table 11-280x004R/W0Interrupt enable register

Writing 1 to a particular bit enables the corresponding interrupt source as set in INT_STATUS.

Table 11-290x00R/W0x00Interrupt status register

Writing 1 to a particular bit sets the corresponding interrupt source.

The associated enable bit in INT_ENABLE must also be set for this interrupt to be generated.

The following sections describe the functionality and the bit description of each of the registers in more details.