如何根据 Tq 和时钟频率 ? 计算 CAN 总线波特率
首先,我想我知道如何从图中的参数计算CAN总线波特率,这是一个CAN FD配置。
clock frequency :80000 k
pre-scaler :1
so we can get the Tq = 1/80000 K
BTL cycles : 40
time for a bit = 40 * (1/80000K) = 1/2000k
So we can get the baud rate = 1/ (1/2000k) = **2000k .**
this Baud rate which we calculated is equal to the value which the CANoe Generated.
但令我困惑的是:当我使用这种方法计算 CAN(不是 CAN FD)的波特率时,结果与CANoe生成的值不同,为什么??? CAN 和 CAN FD 之间有什么不同吗? 你能帮我吗?非常感谢 !
clock :16000K
Pre-sacler :1
tq = 1/16000k
BTL : 16
time for a bit = 16*1/16000k = 1/1000k
baud rate = 1000k
but result generate via CANoe is 500k ,seems somewhere i missing a "divide by 2 " ??
first , I think I know how to calculate the CAN bus Baud rate form the parameter in picture blew ,this is a CAN FD config.
clock frequency :80000 k
pre-scaler :1
so we can get the Tq = 1/80000 K
BTL cycles : 40
time for a bit = 40 * (1/80000K) = 1/2000k
So we can get the baud rate = 1/ (1/2000k) = **2000k .**
this Baud rate which we calculated is equal to the value which the CANoe Generated.
But what puzzles me is :when I use this method to calculate the Baud Rate for a CAN(not CAN FD),the result is different from the value which the CANoe generated ,why ??? is there something different between CAN and CAN FD ??
could you please to help me ? thank you very much !
clock :16000K
Pre-sacler :1
tq = 1/16000k
BTL : 16
time for a bit = 16*1/16000k = 1/1000k
baud rate = 1000k
but result generate via CANoe is 500k ,seems somewhere i missing a "divide by 2 " ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CANOE的CAN控制芯片是SJA1000,来自CANOE帮助文档。
该芯片的 :
CAN时钟=系统时钟*预分频器*2
这个问题的关键点是这里的“2”,对于其他芯片,比如STM32F103,CAN总线设置的时钟是36Mhz,不需要除以“2”
所以下面的时钟频率可能是我猜的系统时钟
按照这个规则,我设置了另一块开发板的参数,测得通讯成功。
同时CANOE的用户只需关注波特率和采样点即可,无需过多关注其他参数。
希望这对您有帮助
the CAN control chip for CANOE is SJA1000 ,from the CANOE help document.
for this chip :
CAN clock = system clock * pre-scaler * 2
the key-point of this question is the "2" here ,for other chip ,such as STM32F103 ,Clock set for CAN bus is 36Mhz,it doesnt need to divide by “2”
so the clock frequency below maybe the system clock I guess
According to this rule, I set the parameters of another development board, and the measured communication was successful.
meanwhile the user of CANOE should just focus on Baud rate and sample point ,There is no need to pay too much attention to other parameters.
Hope this helps you