采用内部晶振8M,6倍PLL主频48M,配置250K波特率,实际示波器抓的怎么和预期不符?估算少了6倍?
这是配置代码:
//CAN speed = (48M) / CAN_Prescaler / (1+BS1+BS2) = 48000000/32/6 = 250K
CAN_InitStructure.CAN_SJW=CAN_SJW_1tq; // 1tq、BS1、BS2的值跟波特率有关
CAN_InitStructure.CAN_BS1=CAN_BS1_3tq;
CAN_InitStructure.CAN_BS2=CAN_BS2_2tq;
CAN_InitStructure.CAN_Prescaler=32; // 分频系数为32
CAN_Init(CAN, &CAN_InitStructure); // 初始化CAN1 |