11.6.3 Configuration Register

The CAN configuration register CAN_CONFIG is a 32-bit register that is used to configure the functionality of the CAN controller. The CAN controller has to be configured prior to its use. The following table shows the CAN_CONFIG register and summarizes the bit description within the register.

Table 11-8. CAN_CONFIG
Bit NumberNameDescription
31ReservedReserved
[30:16]CFG_BITRATEConfiguration bit rate

Prescaler for generating the time quantum which defines the TQ:

0: One time quantum equals 1 clock cycle

1: One time quantum equals 2 clock cycles

32767: One time quantum equals 32768 clock cycles

15ReservedReserved
14ECR_MODEError-capture mode

0: Free running. The ECR register shows the current bit position within the CAN frame.

1: Capture mode. The ECR register shows the bit position and type of the last captured CAN error.

13SWAP_ENDIANThe byte position of the CAN receive and transmit data fields can be modified to match the endian setting of the processor or the used CAN protocol.

0: CAN data byte position is not swapped (big endian)

1: CAN data byte position is swapped (little endian)

12CFG_ARBITERTransmit buffer arbiter

0: Round robin arbitration

1: Fixed priority arbitration

[11:8]CFG_TSEG1Time segment 1. Time segment 1 includes the propagation time

Length of the first time segment:

tseg1 = CFG_TSEG1+1

CFG_TSEG1 = 0 and CFG_TSEG1 = 1 are not allowed

[7:5]CFG_TSEG2Time segment 2

Length of the second time segment:

tseg2 = CFG_TSEG2+1

CFG_TSEG2 = 0 is not allowed

CFG_TSEG2 = 1 is only allowed in Direct-sampling mode

4AUTO_RESTARTThe CAN can be set to restart either “by hand” or automatically after a bus-off.

0: After bus-off, the CAN must be restarted “by hand”. This is the recommended setting.

1: After bus-off, the CAN restarts automatically after 128 groups of 11 recessive bits.

[3:2]CFG_SJWSynchronization Jump Width 1

sjw ≤ tseg1 and sjw ≤ tseg2

1SAMPLING_MODECAN bus bit sampling

0: One sampling point is used in the receiver path

1: Three sampling points with majority decision are used

0EDGE_MODECAN bus synchronization logic

0: Edge from ‘R’ to ‘D’ is used for synchronization

1: Both edges are used