ICP DAS USA tM-7565 User Manual page 65

The uart to can bus converter
Hide thumbs Also See for tM-7565:
Table of Contents

Advertisement

Sample point = (T
Because the maximum value limitation of the register PRS, PHS1, and PHS2, the numbers of
the Time Quantum always keeps in the range of 8 ~ 25. Therefore, users can use register BRP to
scale it. For example, if set the BRP to 25 (the register value of the BRP is 24), the numbers of
the Time Quantum is 500 / 25 = 20. Users can change the value of the PRS, PHS1, and PHS2 to
adjust the required sample point.
For example:
If users want to set the CAN baud rate to "40K" by user-defined method and use the sample
point 60%, set the clock mode to be 1 because the CAN Baud rate is more than 12K bps. When
the Clock mode is 1, the MCU uses X2 mode and the system clock is 20MHz. Otherwise, the
MCU uses X1 mode, and the system clock is 10MHz. The following steps will guide users to
calculate the Bit Timing register step by step.
1. Calculate the numbers of the TQ:
Numbers of the TQ = (System clock) / (CAN Baud Rate)
2. Adjust the numbers of the TQ by using the scale register, BRP. The TQ numbers always be in
the range of 8 ~ 25. Here, numbers of the TQ of one bit time is scaled to 20, and the BRP
would be as follows.
500 / 20 = 25 = (1+BRP)
3. Use sample point to decide the PRS, PHS1, and PHS2.
Sample point = 60% = (3 + PRS + PHS1) / (4+PRS+PHS1+PHS2)
Numbers of the TQ of one bit time = 20 = (4+PRS+PHS1+PHS2)
"(3 + PRS + PHS1) = 12" can satisfy the sample point 60%.
The PHS2 would be 7. If user choose PRS = 2, then PHS1 =7.
4. Generally, the SJW and SMP are set to 0. The SMP is defined as below:
=> SMP = 0: once, at the sample point.
=> SMP = 1: three times, the threefold sampling of the bus is the sample point and twice over
a distance of a 1/2 period of the T
decision of the three values.
I-7530, I-7530-FT, I-7530A, I-7565, tM-7530, tM-7530A, tM-7565 User Manual Version 1.5
Copyright © 2018 ICP DAS Co., Ltd. All Rights Reserved
+ T
syns
prs
= (3 + PRS + PHS) / (4+PRS+PHS1+PHS2)
= 20 M /40 k
=500
BRP = 24
+ T
) / (T
+ T
phs1
syns
prs
. The result corresponds to the majority
scl
E-mail: service@icpdas.com
+ T
+ T
)
phs1
phs2
65
Page:

Advertisement

Table of Contents
loading

Table of Contents