完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我在SPC560P上测试CAN过滤功能,但我不清楚CAN Mask如何工作。
配置如下: Rx ID = 0,Rx Individual Mask = 0xFFFFFF8; BCC = 1;从我的理解,然后CAN节点可以从0到7接收ID,但不能,只能仍然可以接收ID = 0;停下来 检查BUF00 Rx标志; 但是,当我设置Rx Individual Mask = 0时;可以接收所有CAN ID(在BUF00 Rx标志处停止检查); 那么,CAN ID掩码如何工作? ----------------- CAN_0.RXIMR [0] .R = 0xFFFFFFF8; / * Rx个人面具* / CAN_0.BUF [0] .ID.B.STD_ID = 0x0; / * Rx ID = 0 * / / *检查ID接收* / if(1 == CAN_0.IFRL.B.BUF00I){ CAN_0.IFRL.B.BUF00I = 1; // rx完成了 } 以上来自于谷歌翻译 以下为原文 I am testing CAN filtering Function on SPC560P,But am not clear about how CAN Mask working. Configure as following: Rx ID =0, Rx Individual Mask = 0xFFFFFF8; BCC = 1; From my understanding, then the CAN Node can Receive ID from 0 to 7, but cannot , only still can receive ID = 0; stop at BUF00 Rx Flag checked; But , when I set Rx Individual Mask = 0; all CAN ID can be received (stop at BUF00 Rx Flag checked); So, How the CAN ID Mask Working? ----------------- CAN_0.RXIMR[0].R = 0xFFFFFFF8; /*Rx Individual Mask*/ CAN_0.BUF[0].ID.B.STD_ID = 0x0; /*Rx ID = 0*/ /*Check ID Receive*/ if(1== CAN_0.IFRL.B.BUF00I){ CAN_0.IFRL.B.BUF00I = 1; // rx completed } |
|
相关推荐
1个回答
|
|
|
你好楚,
Rx ID = 0,Rx Individual Mask = 0xFFFFFF8; BCC = 1 Rx Individual Mask用于接受ID过滤和FIFO 面具比特 对于正常的Rx MB,掩码位会影响MB上编程的ID过滤器。对于Rx FIFO, 掩码位影响滤波器表(ID,IDE,RTR)中编程的所有位。 0过滤器中的相应位是“不关心” 1将根据收到的位检查过滤器中的相应位。 我不认为对于STD_ID = 0,RXIMR对掩模系统很有用 你应该使用不同于0的STD_ID。 你使用中断处理程序来检索CAN数据? 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Chu , Rx ID =0, Rx Individual Mask = 0xFFFFFF8; BCC = 1 Rx Individual Mask is used for acceptance for ID Filtering and the FIFO Mask Bits For normal Rx MBs, the mask bits affect the ID filter programmed on the MB. For the Rx FIFO, the mask bits affect all bits programmed in the filter table (ID, IDE, RTR). 0 The corresponding bit in the filter is “don’t care.â€� 1 The corresponding bit in the filter is checked against the one received. I do not think that for STD_ID=0, RXIMR is useful with mask system you should use a STD_ID different of 0. do you use the interrupt handler to retrieve the CAN Data ?
Best regards Erwan |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1453 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1502 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3649 浏览 1 评论
3842 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2461 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
727浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
663浏览 5评论
710浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
941浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
745浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 09:35 , Processed in 0.787081 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1821