完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
问题:是否有可能将程序中的完整CAN邮箱的标识符更改为实际上有8多个完整的CAN邮箱?答:是的,可以在程序中动态地改变完整的CAN邮箱的标识符。可以通过写入CAN TX MSG标识符寄存器来改变标识符。这是一个32位寄存器,用来存储标识符值。在使用标准CAN的情况下,CAN TX MSG寄存器中最重要的11位将包含标识符值。因此,在写入到CAN TX MSG寄存器之前,您必须为标准CAN将其移位21位。类似地,如果使用扩展的CAN,MSB 29位包含标识符值。在这种情况下,您必须在写入寄存器之前移位3位。您可以使用以下函数写入上述寄存器。在使用标准满的情况下,可以使用CythSeTyRG32((Req32))和ChanaTx[邮箱] [txid,(id & lt;lt;21u)];在使用扩展完整的可以使用CythSeTrEGR32((Req32*)和ChanyTx [邮箱] .txid,(IDE和lt;3U))的情况下,其中ID-标准的11位标识符;IDE -扩展的29位标识符上述功能将允许您拥有超过8个完整的CAN消息。附上这篇文章是示例项目。
拉链 3.2兆字节 以上来自于百度翻译 以下为原文 Question: Is it possible to change the identifier of a FULL CAN Mailbox in the program to virtually have more than 8 FULL CAN mailboxes? Answer: Yes it is possible to change the identifier of the FULL CAN mailbox dynamically in the program. The identifier can be changed by writing to the CAN Tx Msg Identifier register. This is a 32 bit register which is used to store the identifier value. In case of using a standard CAN, the Most Significant 11 bits of the CAN Tx Msg register will contain the Identifier value. So before writing to the CAN Tx Msg Register you have to shift it by 21 bits for the standard CAN. Similarly if you are using the Extended CAN, the MSB 29 bits contain the identifier value. In this case you have to shift by 3 bits before writing to the register. You can write to the above mentioned register using the following functions. In case of using Standard FULL CAN use CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (ID << 21u)); In case of using Extended FULL CAN use CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (IDE << 3u)); Where ID – standard 11 bit Identifier; IDE – Extended 29 bit Identifier Thus using the above function will allow you to have more than 8 FULL CAN messages. Attached along with this post is the example project .
|
|
相关推荐
5个回答
|
|
问题:是否有可能将程序中的完整CAN邮箱的标识符更改为实际上有8多个完整的CAN邮箱?
答:是的,可以在程序中动态地改变完整的CAN邮箱的标识符。可以通过写入CAN TX MSG标识符寄存器来改变标识符。这是一个32位寄存器,用来存储标识符值。在使用标准CAN的情况下,CAN TX MSG寄存器中最重要的11位将包含标识符值。因此,在写入到CAN TX MSG寄存器之前,您必须为标准CAN将其移位21位。类似地,如果使用扩展的CAN,MSB 29位包含标识符值。在这种情况下,您必须在写入寄存器之前移位3位。您可以使用以下函数写入上述寄存器。在使用标准满的情况下,可以使用CythSeTyRG32((Req32))和ChanyTx[邮箱]。TXID,(ID & lt;& 21t);在使用扩展完整的CAN的情况下使用CythSeTrEGR32((Req32*)和ChanyTx [邮箱] .txid,(IDE和lt;3U));其中ID -标准11位标识符;ID-扩展的29位标识符TH。使用上述功能,我们将允许您拥有超过8个完整的CAN消息。附上这篇文章是示例项目。 以上来自于百度翻译 以下为原文 Question: Is it possible to change the identifier of a FULL CAN Mailbox in the program to virtually have more than 8 FULL CAN mailboxes? Answer: Yes it is possible to change the identifier of the FULL CAN mailbox dynamically in the program. The identifier can be changed by writing to the CAN Tx Msg Identifier register. This is a 32 bit register which is used to store the identifier value. In case of using a standard CAN, the Most Significant 11 bits of the CAN Tx Msg register will contain the Identifier value. So before writing to the CAN Tx Msg Register you have to shift it by 21 bits for the standard CAN. Similarly if you are using the Extended CAN, the MSB 29 bits contain the identifier value. In this case you have to shift by 3 bits before writing to the register. You can write to the above mentioned register using the following functions. In case of using Standard FULL CAN use CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (ID << 21u)); In case of using Extended FULL CAN use CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (IDE << 3u)); Where ID – standard 11 bit Identifier; IDE – Extended 29 bit Identifier Thus using the above function will allow you to have more than 8 FULL CAN messages. Attached along with this post is the example project . |
|
|
|
这对于全能RX邮箱ID似乎不起作用。它不会改变激活中断的ID。有人知道这是否可能吗?
以上来自于百度翻译 以下为原文 This doesn't seem to work for CAN FULL RX Mailbox IDs. It doesn't change the ID that activates the interrupt. Anyone know if that is possible? |
|
|
|
静态随机存取存储器
对于不同的ID,您所解释的发送CAN消息的方法似乎不是我的工作。我使用PoSoC5LPand使用Calto3.3。 当我尝试以0x1作为标识符发送CAN消息ID时,我看到了0x4000消息ID,并设置了IDE位。所以,它是如何被当作扩展的CN消息ID的。我甚至试图重置IDE位,它对我不起作用。 任何帮助都是值得赞赏的。 以上来自于百度翻译 以下为原文 SRAM, The method what you explained to transmitt the CAN message wuth a different ID seems not workign for me. I have PSoC5lp and using creator3.3. When I try to send the CAN message ID with 0x1 as identifier, I see the 0x40000 message ID, and the IDE bit is set. So, some how it is treated as extended CN message ID. I even tried to reset the IDE bit, it did not work for me. Any help is appreciated. |
|
|
|
rnr15483586 发表于 2019-6-18 14:35 静态随机存取存储器 我现在可以发送消息了。对于扩展的和标准的消息ID,我移动了3位,工作正常。我不知道为什么21位的左移不能正常工作。 以上来自于百度翻译 以下为原文 SRAM, I am able to transmit the messages now. For both extended and standard message ID, I am shifting by 3 bits and is working fine. I am not sure why the left shift by 21 bits is not working fine. |
|
|
|
静态随机存取存储器
我有一个类似的问题,我一直在使用你在运行时更改ID的函数。但是,即使在TX侧的TX ID寄存器和RX侧的RX IDReX都完全相同,当我在调试器中查看它们时,所发送的消息不会被接收。我知道所有其他配置都是正确的,因为如果我在开始时在CAN块中设置相同的ID,它就可以正常工作。不过,我需要能够在运行时更改IDS。 以上来自于百度翻译 以下为原文 SRAM, I'm having a similar issue where I've been using the functions you said to change the id at runtime. However, even though both the tx id register on the tx side and the rx id register on the rx side are exactly the same when I look at them in the debugger the message being transmitted doesn't get received. I know everything else is configured properly since if I set the same id's in the CAN block at the beginning it works fine. I need to be able to change the ids at runtime though. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2102 浏览 1 评论
1848 浏览 1 评论
3666 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1783 浏览 6 评论
1533 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
565浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
419浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
434浏览 2评论
380浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
912浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 14:39 , Processed in 1.204707 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号