|
这段是复制例程中的,感觉不太对啊,求大家指教。记得书上写的是:SYSCLKOUT 是CAN 模块系统的时钟频率,与CPU 的时钟频率一样,那么对于150 MHz SYSCLKOUT ,CAN 模块系统的时钟频率也应该为150 MHz,那么下面这段的CAN clock是什么意思?又是如何计算出来的?记得书上公式中有个SYSCLKOUT /2,那么对于红色部分,位速率=(150M/2)/10/15=500k才对啊,怎么会是1 Mbps呢?
/******************************************************/
/* Bit configuration parameters for 150 MHz SYSCLKOUT */
/******************************************************/
/*The table below shows how BRP(reg) field must be changed to achieve different bit
rates with a BT of 15, for a 80% SP:
---------------------------------------------------------------
BT = 15, TSEG1(reg) = 10, TSEG2(reg) = 2, Sampling Point = 80%
---------------------------------------------------------------
1 Mbps : BRP(reg)+1 = 10 : CAN clock = 15 MHz
500 kbps : BRP(reg)+1 = 20 : CAN clock = 7.5 MHz
250 kbps : BRP(reg)+1 = 40 : CAN clock = 3.75 MHz
125 kbps : BRP(reg)+1 = 80 : CAN clock = 1.875 MHz
100 kbps : BRP(reg)+1 = 100 : CAN clock = 1.5 MHz
50 kbps : BRP(reg)+1 = 200 : CAN clock = 0.75 MHz
The table below shows how to achieve different sampling points with a BT of 15:
----------------------------------------------------------------------
Achieving desired SP by changing TSEG1(reg) & TSEG2(reg) with BT = 15
----------------------------------------------------------------------
TSEG1(reg) = 10, TSEG2(reg) = 2, SP = 80%
TSEG1(reg) = 9, TSEG2(reg) = 3, SP = 73%
TSEG1(reg) = 8, TSEG2(reg) = 4, SP = 66%
TSEG1(reg) = 7, TSEG2(reg) = 5, SP = 60%
The table below shows how BRP(reg) field must be changed to achieve different bit
rates with a BT of 10, for a 80% SP:
--------------------------------------------------------------
BT = 10, TSEG1(reg) = 6, TSEG2(reg) = 1, Sampling Point = 80%
--------------------------------------------------------------
1 Mbps : BRP(reg)+1 = 15 : CAN clock = 10 MHz
500 kbps : BRP(reg)+1 = 30 : CAN clock = 5 MHz
250 kbps : BRP(reg)+1 = 60 : CAN clock = 2.5 MHz
125 kbps : BRP(reg)+1 = 120 : CAN clock = 1.25 MHz
100 kbps : BRP(reg)+1 = 150 : CAN clock = 1 MHz
50 kbps : BRP(reg)+1 = 300 : CAN clock = 0.5 MHz
*/ |
阿莫论坛20周年了!感谢大家的支持与爱护!!
该献的血还是要献的。你不献他不献。难道让我去献? --- 出自坛友:lovejp1981
|