A2C-SG2-M12
WWW.LILLIESYSTEMS.COM
18 of 44
0x0E = 100 kb/s – sampling point 75%
0x0F = 50 kb/s – sampling point 75%
AUTOTRANS: Enable / disable automatic re-transmission on CAN bus
0x00 = No automatic retransmission
0x01 = Automatic retransmission
In addition of the
BAUD
and
AUTOTRANS
values, the data bytes 2 to 5 must contain the chars as shown in 7.2.1. This is to some
degree prevent the baud rate to change and cause a CAN bus error if the filters are set incorrectly.
7.2.2
Command: Get baud rate
To get the current baud rate
Command
Sub Command
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
0xE7
DLC = 0x01 (values above 1 are also valid, but Data bytes are not used)
Reply
Command
Sub Command
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
0xE7
BAUD
AUTOTRANS
Not defined
DLC = 0x04
The reply format follows the same format as seen in 7.2.1
7.3
Custom baud rate
The following values must be calculated first.
𝑇1 =
36 × 10
𝐵𝑎𝑢𝑑 𝑟𝑎𝑡𝑒 × 𝑃𝑅𝐸𝑆
𝑩𝑺𝟏 = 𝑇1 × 𝑆𝑎𝑚𝑝𝑙𝑒 𝑃𝑜𝑖𝑛𝑡 − 1, 𝑚𝑢𝑠𝑡 𝑏𝑒 𝑙𝑒𝑠𝑠 𝑡ℎ𝑎𝑛 16
𝑩𝑺𝟐 = 𝑇1 − 𝐵𝑆1 − 1, 𝑚𝑢𝑠𝑡 𝑏𝑒 𝑙𝑒𝑠𝑠 𝑡ℎ𝑎𝑛 8
Example: Generate baud rate of 62.5kbits / second: We first select a prescale (PRES) value that creates an even T1 number. 36 is
selected. The sample point is chosen to be 75%
36 × 10
62500 × 32
= 16 = 𝑇1
16 × 0.75 − 1 = 11 = 𝐵𝑆1 − 𝑠𝑎𝑡𝑖𝑠𝑓𝑦 𝑎 𝑣𝑎𝑙𝑢𝑒 𝑙𝑒𝑠𝑠 𝑡ℎ𝑎𝑛 16, 𝑜𝑘!
16 − 11 − 1 = 4 = 𝐵𝑆2 − 𝑠𝑎𝑡𝑖𝑠𝑓𝑦 𝑎 𝑣𝑎𝑙𝑢𝑒 𝑙𝑒𝑠𝑠 𝑡ℎ𝑎𝑛 8, 𝑜𝑘!
7.3.1
Command: Set custom baud rate
From the above calculations we can now send the following message.
Command
Sub Command
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
0x54
0x01
SJW
BS1
BS2
PRES_MSB
PRES_LSB
DLC = 0x07 (values above 7 are also valid, but Data bytes are not used)
SJW:
Resynchronization Jump Width, Specifies the maximum number of time quanta the CAN hardware is allowed to lengthen or
shorten a bit to perform resynchronization. This parameter can be a value of:
0x01 = 1 time quantum
0x02 = 2 time quantums
0x03 = 3 time quantums
0x04 = 4 time quantums
BS1:
Specifies the number of time quanta in Bit Segment 1. This parameter can be a value of
0x01 = 1 time quantum
0x02 = 2 time quantums
…
0x10 = 16 time quantums