完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
使用can1原来使用baud rate:1Mbit,通讯正常
改为:250k ,就无法正常收发数据,请各位帮忙看看问题点所在 #if 0Can1_Handle.Instance = CAN1; Can1_Handle.Init.Prescaler = 6; Can1_Handle.Init.Mode = CAN_MODE_NORMAL; Can1_Handle.Init.SyncJumpWidth = CAN_SJW_1TQ; Can1_Handle.Init.timeSeg1 = CAN_BS1_5TQ; Can1_Handle.Init.TimeSeg2 = CAN_BS2_3TQ; Can1_Handle.Init.TimeTriggeredMode = DISABLE; Can1_Handle.Init.AutoBusOff = ENABLE; Can1_Handle.Init.AutoWakeUp = ENABLE; Can1_Handle.Init.AutoRetransmission = DISABLE; Can1_Handle.Init.ReceiveFifoLocked = DISABLE; Can1_Handle.Init.TransmitFifoPriority = DISABLE; if (HAL_CAN_Init( Can1_Handle) != HAL_OK) { Error_Handler(); } #endif //250kbps --> CAN_BS1_7TQ ,CAN_BS2_1TQ ,Prescaler =24 #if 1 Can1_Handle.Instance = CAN1; Can1_Handle.Init.Prescaler = 24; Can1_Handle.Init.Mode = CAN_MODE_NORMAL; Can1_Handle.Init.SyncJumpWidth = CAN_SJW_1TQ; Can1_Handle.Init.TimeSeg1 = CAN_BS1_7TQ; Can1_Handle.Init.TimeSeg2 = CAN_BS2_1TQ; Can1_Handle.Init.TimeTriggeredMode = DISABLE; Can1_Handle.Init.AutoBusOff = ENABLE; Can1_Handle.Init.AutoWakeUp = ENABLE; Can1_Handle.Init.AutoRetransmission = DISABLE; Can1_Handle.Init.ReceiveFifoLocked = DISABLE; Can1_Handle.Init.TransmitFifoPriority = DISABLE; if (HAL_CAN_Init( Can1_Handle) != HAL_OK) { Error_Handler(); } #endif |
|
相关推荐
1个回答
|
|
找一个工具,算一下这三个参数的配置,或者找一下主频相同的例程的配置,只修改分频参数,可能时钟有偏差。
Can1_Handle.Init.SyncJumpWidth = CAN_SJW_1TQ; Can1_Handle.Init.TimeSeg1 = CAN_BS1_5TQ; Can1_Handle.Init.TimeSeg2 = CAN_BS2_3TQ; |
|
|
|
只有小组成员才能发言,加入小组>>
调试STM32H750的FMC总线读写PSRAM遇到的问题求解?
1659 浏览 1 评论
X-NUCLEO-IHM08M1板文档中输出电流为15Arms,15Arms是怎么得出来的呢?
1571 浏览 1 评论
998 浏览 2 评论
STM32F030F4 HSI时钟温度测试过不去是怎么回事?
695 浏览 2 评论
ST25R3916能否对ISO15693的标签芯片进行分区域写密码?
1617 浏览 2 评论
1878浏览 9评论
STM32仿真器是选择ST-LINK还是选择J-LINK?各有什么优势啊?
664浏览 4评论
STM32F0_TIM2输出pwm2后OLED变暗或者系统重启是怎么回事?
530浏览 3评论
548浏览 3评论
stm32cubemx生成mdk-arm v4项目文件无法打开是什么原因导致的?
517浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 17:29 , Processed in 0.824993 second(s), Total 80, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号