![GigaDevice Semiconductor GD32A50 Series Скачать руководство пользователя страница 633](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32a50-series/gd32a50-series_user-manual_2225782633.webp)
GD32A50x User Manual
633
Conversely, if a valid edge is detected in BS2, not in SYNC_SEG, BS2 is cut down with up to
SJW maximumly, so that the transmit point is moved earlier.
Bit sampling
BSPMOD in CAN_CTL1 register defines the sampling mode of CAN bits at the Rx input pin.
When BSPMOD is 0, only one sample (the sample point) is used.
When BSPMOD is 1, three samples are used to determine the received bit value, that is the
one on the sample point, and the two preceding samples.
Note:
This bit cannot be set when CAN FD is enabled.
Baudrate
CAN module has two clock domains:
The clock of Control Interface and CAN registers derives from the APB2 clock.
The clock of Protocol controller (CANCLK) can be configured by CANxSEL[1:0] bit in
RCU_CFG2 register, to derive from oscillator clock, or APB2 clock, or APB2 clock
devided by 2, or IRC8M internal clock.
The CAN calculates its baudrate as follows:
BaudRate =
1
CAN Bit Time
(23-7)
CAN Bit Time = t
SYNC_SEG
+ t
PTS
+ t
PBS1
+ t
PBS2
(23-8)
with
t
SYNC_SEG
= 1 × t
q
(23-9)
t
PTS
= (N
PTS
+ 1) × t
q
or
t
PTS
= N
DPTS
× t
q
(23-10)
t
PBS1
= (N
PBS1
+ 1) × t
q
(23-11)
t
PBS2
= (N
PBS2
+ 1) × t
q
(23-12)
t
q
= (N
BAUDPSC
+ 1) × t
CANCLK
(23-13)
In the equations, for nominal bit rate:
N
PTS
,
N
PBS1
,
N
PBS2
, and
N
BAUDPSC
are configured by the PTS[5:0] bits, PBS1[4:0] bits,
PBS2[4:0] bits, and BAUDPSC[9:0] bits respectively in CAN_BT register.
For data bit rate:
N
DPTS
,
N
PBS1
,
N
PBS2
, and
N
BAUDPSC
are configured by the DPTS[4:0] bits, DPBS1[2:0] bits,
DPBS2[2:0] bits, and DBAUDPSC[9:0] bits respectively in CAN_FDBT register.