完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
非常关键的实现。我已经看到了这样的要求,如果我正在发送一个CAN消息,我应该能够向上层表明消息是成功传输的,如CouxExpRestMug()。我正在使用CAN中断实现。目前,我只是设置Tx中断。所以,我需要把一个共同的旗帜在主体和中断?我说的对吗?另一个疑问是,我要等待多久才能确定消息没有被传送?事情很复杂,因为我每隔10毫秒有几条信息要发送,请告知。提前感谢。Micro是DSPIC33 EV家族。
以上来自于百度翻译 以下为原文 Very critical implementation. I have seen the requirement like if I am transmitting a CAN message i should be able to indicate to upper layer that the message is transmitted successfully like CANTxConfirmation(). I am implementing the CAN using interrupt based. Currently i am just setting the Tx interrupt. So, I need to put a common flag in the main and interrupt? Am I correct? The other doubt is how long should i wait before i decide the message is not transmitted? The things are complicated as i have several messages to be transmitted at every 10ms. Please advise. Thanks in advance. The micro is dspic33ev family. |
|
相关推荐
5个回答
|
|
对于10毫秒的TX周期,在汽车应用中,10毫秒内的错误信号被认为是足够的。(在RX方面,您可能会看到RX超时20)。因此,在调度下一个传输消息时,只需检查最后一个消息是否已被发送,如果没有,则增加错误标志。
以上来自于百度翻译 以下为原文 For a TX period of 10 ms, in automotive applications an error signalling within 10 ms is considered sufficient. (On the RX side you might see an RX timeout of 20 .. 30 ms for such a message.) So: when scheduling the next transm8ssion of such a message, simply check whether the last one has been transmitted and raise the error flag if not. |
|
|
|
非常感谢你的回复。很少有其他的疑问是在接收的情况下,让我们说我必须收到4条信息。如果通信是正确的,或者我将正确接收所有的消息,或者我可能不接收所有的消息。我说的对吗?因此,如果我正在检查接收错误,我需要检查每个独立的接收消息错误或CAN完成的消息接收错误。请告知。
以上来自于百度翻译 以下为原文 Thank you very much for the reply. Few other doubts are in case of reception, let us say i have to receive some 4 messages. If CAN communication is proper then either i will receive all the messages properly or i may not receive all the messages. Am I correct? So if i am checking for the reception error do i need to check each independent reception message error or the CAN complete message reception error. please advise. |
|
|
|
检查每一个RX消息!如果总线无法运行,您将无法接收任何信息,这可能是一个发送ECU有一些“问题”-导致只有一个消息丢失。
以上来自于百度翻译 以下为原文 Check every single RX message! While you wouldn't receive anything if the bus were inoperational, it might be that a transmitting ECU has some "issue" - resulting in only a single message missing. |
|
|
|
|
|
|
|
我假设你正在为相关的缓冲器设置TXReq位来启动CAN传输。当消息已被发送时,TXReq位将自动清除。因此,您可以在一个循环中等待,直到它被重置(可能不是一个好主意),或者在主调度器循环中周期性地轮询它,以检查它是否已被发送。参见DS70353C部分21.61.1,也可以启用发送中断,指示特定缓冲器中的消息已发送(TBIF),使用ICODE来确定确切的缓冲器。种子70353C部分21.113.1。您可以在主调度器中设置/检查位字段标志,并清除ISR中的位,以指示该缓冲器中的消息已被发送。传输时间取决于波特率和CAN总线加载。如果较高优先级消息试图在总线上传输,则消息将被延迟。这取决于你的CAN总线设计,你需要等待多长时间。
以上来自于百度翻译 以下为原文 I assume you are setting the TXREQ bit for the relevant buffer to initiate the CAN transmission? The TXREQ bit will be cleared automatically when the message has been transmitted. So you could wait in a loop until it is reset (probably not a good idea), or poll it periodically in your main scheduler loop to check it has been sent. See DS70353C section 21.6.1. You can also enable a transmit interrupt which indicates that a message in a particular buffer has been sent (TBIF), use ICODE to determine the exact buffer. See DS70353C section 21.11.3.1. You could set/check a bit-field flag in your main scheduler and clear the bits in the ISR to indicate that the message in that buffer has been sent. The transmit time is dependent on you baud rate and the CAN bus loading. The message will be delayed if higher priority messages are trying to transmit on the bus. It depends on you CAN bus design as to how long you would need to wait. T |
|
|
|
只有小组成员才能发言,加入小组>>
5284 浏览 9 评论
2056 浏览 8 评论
1968 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3231 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2277 浏览 5 评论
820浏览 1评论
709浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
654浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
710浏览 0评论
607浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-12 21:15 , Processed in 1.294048 second(s), Total 87, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号