- //<<Can bit time config
- stcCanInitCfg.stcCanBt.PRESC = 1u-1u;
- stcCanInitCfg.stcCanBt.SEG_1 = 5u-2u;
- stcCanInitCfg.stcCanBt.SEG_2 = 3u-1u;
- stcCanInitCfg.stcCanBt.SJW = 3u-1u;
- /*
- Fcanclk = XTAL_VALUE = 8M
- TQ = (PRESC+1) / Fcanclk = 1 / 8M
- BT = tseg1 + tseg2 = ((SEG_1+2) + (SEG_2+1)) * TQ = (5+3) * (1/8Mhz) = 1/1M
- */
1位要1/1M秒,换算成波特率就是1M了。
|