SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
The CAN module must be in initialization mode to configure the CAN bit timing.
For CAN bit timing software configuration flow, see Figure 24-181, CAN Bit-Timing Configuration.
Step 1: Enter initialization mode (DCAN_CTL[0] INIT = 1).
While the INIT bit is set, the message transfer from and to the CAN bus is stopped, and the status of the CAN_TX output is recessive (high).
The CAN error counters are not updated. Setting the INIT bit does not change any other configuration register.
Also, note that the CAN module is in initialization mode on device reset and during Bus-Off.
Step 2: Set the Configure Change Enable bit (DCAN_CTL[6] CCE = 1).
The access to the Bit Timing register (DCAN_BTR) for the configuration of the bit timing is enabled when both INIT = 1 and CCE = 1.
Step 3: Wait for the INIT bit to get set (=1). This would make sure that the module has entered Initialization mode.
Step 4: Write the bit timing values into DCAN_BTR. See Section 24.10.4.9.2, DCAN Bit Timing Registers for the values calculation for a given bit timing.
Step 5: Clear the CCE and INIT bits (=0).
Step 6: Wait for the INIT bit to clear (=0). This would ensure that the module has come out of Initialization mode.
Following these steps, the module comes to operation by synchronizing itself to the CAN bus, provided the DCAN_BTR is configured as per the CAN bus baud rate, although the message objects have to be configured before carrying out any communication.
The module will not come out of the Initialization mode if any incorrect DCAN_BTR values are written in step 4.
The required message objects should be configured as transmit or receive objects before the start of data transfer as explained in Section 24.10.4.12.1, CAN Module Initialization.