Physical
This page documents the Physical (PHY) configuration.
The Physical section configures parameters related to the CAN-bus.
Configuration file fields
This section is autogenerated from the Rule Schema file.
Mode can.phy.mode
Device CAN bus mode. Configures how the device interacts with the bus. In Normal mode, the device can receive, acknowledge and transmit frames. In Restricted mode, the device can receive and acknowledge, but not transmit frames. In Bus Monitoring mode, the device can receive, but not acknowledge or transmit frames. It is recommended to always use the most restrictive mode possible.
Type |
Default |
Options |
---|---|---|
integer |
1 |
Normal (receive, acknowledge and transmit): |
Automatic retransmission can.phy.retransmission
Retransmission of frames that have lost arbitration or that have been disturbed by errors during transmission.
Type |
Default |
Options |
---|---|---|
integer |
1 |
Disable: |
CAN FD specification can.phy.fd_spec
Configures the CAN FD specification used by the device. Shall match the specification used by the CAN bus network.
Type |
Default |
Options |
---|---|---|
integer |
0 |
ISO CAN FD (11898-1): |
Bit-rate configuration mode can.phy.bit_rate_cfg_mode
Configures how the CAN bus bit-rate is set. Modes Auto-detect and Bit-rate support all standard bit-rates. Non-standard bit-rate configuration can be set using Bit-timing. It is recommended to set the bit-rate manually if it is known.
Type |
Default |
Options |
---|---|---|
integer |
0 |
Auto-detect: |
Configuration explained
This section contains additional information and examples.
Mode
The mode
field configures to what extend the CANedge is allowed to communicate on the CAN-bus.
Note
It is recommended to use the most restrictive mode possible.
Retransmission
The retransmission
configures how the CANedge should react when message transmissions fail. Failed transmissions can either be aborted or retried.
Bit-rate configuration mode
The bit_rate_cfg_mode
, selects how the bit-rate is configured. In most cases, a simple bit-rate can be set. For more advanced cases, the more extensive bit-timing can be used.
Bit-rate / bit-timing
The input clock to the CAN-bus controllers is set to 40 MHz (480 MHz prescaled by 12).
The bit-rate modes Auto-detect
and Bit-rate (simple)
support the following list of bit-rates12:
Bitrate |
BRP |
Quanta |
Seg1 |
Seg2 |
SJW |
---|---|---|---|---|---|
5k |
100 |
80 |
63 |
16 |
4 |
10k |
50 |
80 |
63 |
16 |
4 |
20k |
25 |
80 |
63 |
16 |
4 |
33.333k |
10 |
120 |
95 |
24 |
4 |
47.619k |
8 |
105 |
83 |
21 |
4 |
50k |
10 |
80 |
63 |
16 |
4 |
83.333k |
4 |
120 |
95 |
24 |
4 |
95.238k |
4 |
105 |
83 |
21 |
4 |
100k |
5 |
80 |
63 |
16 |
4 |
125k |
4 |
80 |
63 |
16 |
4 |
250k |
2 |
80 |
63 |
16 |
4 |
500k |
1 |
80 |
63 |
16 |
4 |
800k |
1 |
50 |
39 |
10 |
4 |
1M |
1 |
40 |
31 |
8 |
4 |
2M |
1 |
20 |
15 |
4 |
4 |
4M |
1 |
10 |
7 |
2 |
2 |
In Auto-detect
mode, the device attempts to determine the bit-rate from the list of detectable bit-rates. Depending on factors such as data patterns, bit-rate deviation etc. it may not always be possible to detect the bit-rate automatically.
Warning
It is recommended to set the bit-rate manually when possible
Warning
Bit-rate auto-detect cannot be used to detect a CAN FD switched bit-rate
In mode Bit-timing (advanced)
, the bit-rate timing can be set directly. The following equations can be used to calculate the bit-timing fields:
Input clock: \(CLK = \frac{480000000}{12} = 40000000 = 40\text{ MHz}\)
Quanta: \(Q = 1 + SEG_1 + SEG_2\)
Bit-rate: \(BR = \frac{CLK/BRP}{Q}\)
Sample point: \(SP = 100 \cdot \frac{1 + SEG_1}{Q}\)
Sample point calculator
Below calculator can be used to search for bit-timing configurations matching a specific sample-point. The calculator takes the following inputs:
Type
: Standard (SD
) or FD (FD
) bit-timingBR
: Bit-rateSP-TARGET
: Sample-point target percentageSP-TOLERANCE
: Sample-point tolerance percentage (increase to include more results)
Examples
Example: Matching bit-timing settings based on different input clock frequency (CLK
).
Settings to match (based on a 80 MHz input clock):
Bit-rate: 2M
Quanta: 40
SEG1: 29
SEG2: 10
Sample point: 75%
Above settings are based on an input clock with frequency:
The CANedge uses a 40 MHz input clock. To obtain a bit-rate of 2 M with a 40 MHz input clock, the number of quanta is calculated as:
To obtain a sampling point of 75%, SEG1 is calculated as:
Now, SEG2 is calculated as:
The equivalent bit-timing settings using the 40 MHz input clock of the CANedge becomes:
BRP: 1
SEG1: 14
SEG2: 5