完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
您好,我正在使用D3318演示板来学习CAN消息接收。我只是在这个演示板上播放CAN接收部分,现在我可以接收CAN总线分析器产生的CAN消息。现在我试着用这个演示板来接受一些MOREMsGSGID,而我没有。如果您查看源代码,MysGySIDIS定义AS0x123。我可以把它改成一个不同的MSGGSID,但是我不能使代码工作公式MSGySIDand我不知道如何。(我想拥有多个MSGJSID的原因是,如果我收到不同的MSGSID),我可以有一些动作来做。你能帮忙吗?谢谢您。
以上来自于百度翻译 以下为原文 Hi, I am using to use DM330018 demo board to learn the CAN message receiving. I am only playing the CAN receiving part for this demo board, and current I am able to receive CAN messages generating from CAN bus analyzer. Now I am trying to have this demo board to accept a few more MSG_SID, and I haven't successfully implemented it. If you look the source code, the MSG_SID is defined as 0x123. I can change it to a different MSG_SID, but I cannot make the code work for multiple MSG_SID and I don't know how. (The reason I would like to have multiple MSG_SID is I can have a few actions to do if I receive different MSG_SID) Could you please help? Thank you. |
|
相关推荐
14个回答
|
|
|
请在这里关闭这个线程,并坚持您的年轻ththHTTP://www. McCHIP.COM/FUMMS/FUNDSPE/1036765。
以上来自于百度翻译 以下为原文 Please close this thread here and stick to your younger thread http://www.microchip.com/forums/FindPost/1036765 |
|
|
|
|
|
校正:坚持…62和关闭…65,因为…62是在适当的线程中。(您的问题与编译器无关。)
以上来自于百度翻译 以下为原文 Correction: stick with ...62 and close ...65 as ...62 is in the appropriate thread. (Your problem has nothing to do with the compiler.) |
|
|
|
|
|
从HTTP://www. McCHIP.COM/FUMMS/M1036765.ASPX复制
以上来自于百度翻译 以下为原文 Copied from http://www.microchip.com/forums/m1036765.aspx |
|
|
|
|
|
好的-瞥见数据表…尼斯-一个大的外围设备有大量的配置选项(读:出错的机会)下面的代码(完全未测试)可能会起到作用,或者需要一些调试。无论如何,它旨在给出一些关于设置第二个RX消息所需的指示。
以上来自于百度翻译 以下为原文 OK - had a glimpse into the datasheet... Nice - a large peripheral with a plentitude of config options (read: chances for errors) The following code (completely untested) might do the trick - or require some debugging. Anyway, it is intended to give some indication on what is required to set up a second etc. RX message. /* configure acceptance filter 1 setup the filter to accept a standard id of 0xXXX, the macro when called as CAN_FILTERMASK2REG_SID(0x123) will write the register C1RXF0SID to accept only standard id of 0x123 */ C1RXF1SID = CAN_FILTERMASK2REG_SID(0xXXX); /* set filter to check for standard ID and accept standard id only */ C1RXM0SID = CAN_SETMIDE(C1RXM0SID); C1RXF1SID = CAN_FILTERSTD(C1RXF1SID); /* acceptance filter to use buffer 2 for incoming messages */ C1BUFPNT1bits.F1BP = 0b0010; /* enable filter 1 */ C1FEN1bits.FLTEN1 = 1; /* clear window bit to access ECAN control registers */ C1CTRL1bits.WIN = 0; /* ECAN1, Buffer 1 is a Receive Buffer */ C1TR01CONbits.TXEN2 = 0; |
|
|
|
|
|
谢谢你DU000 00 00 1。实际上我尝试添加第二过滤器,但仍然没有工作。我想我已经找到原因了,我认为在演示代码中有一个错误:这个板的原始演示代码有:C1Fun1Bist.FLTEN1=1;它应该是1FEN1BIT.FLTN0= 1SO,当我添加另一个过滤器时,我知道了。TC1FEN1位。FLTEN2=1,这与设置不一致。在我修正了这个问题之后。我的代码可以接受不同的消息ID。顺便说一下,我使用的是同一个带有不同过滤器的掩码,所以对于不同的消息ID,设置C1FMKSSEL1BIT.F1MSK= 0B01是很重要的。
以上来自于百度翻译 以下为原文 Thank you du000000001. Actually I did try to add the 2nd filter, and still didn't work. I think I have found the cause, and I think there is an error in the demo code: The original demo code for this board has: C1FEN1bits.FLTEN1 = 1; It should be C1FEN1bits.FLTEN0 = 1 So when I added another filter, I set C1FEN1bits.FLTEN2 = 1 which is not consistent with setting. After I fixed this issue. my code can accept a different message ID. By the way, I am using the same mask with different filter, so it is important to set C1FMSKSEL1bits.F1MSK = 0b01; for different message ID. |
|
|
|
|
|
似乎我得到了另一个版本的DSSPICEV-EVKIT,因为我的源代码中的设置是一致的,虽然我从来没有将CAN设置为操作。(我有其他原因使用EV,因为一些独特的特性。)无论如何,使用的FLTEX必须反映使用的RX缓冲区的索引。有趣的是,如果代码工作在你所配置的错误配置中。在解决bug的尝试中,你是不是错了?(我不希望“婴儿”会收到这样一个错误的配置。)热点提示:总是保留一个原始代码的副本供参考。得到一个很好的文件比较工具,当谈到比较文件……因为我非常熟悉CAN和CAN配置的所有方面(追溯到TIL 1995),我预计任何类型的CAN控制器的小问题-分类实现为“不讨厌”RESP。真讨厌。EV的CAN控制器可能排名“不太恼人”,因为它似乎遵循一些古老的I82526/I82527的设置:
以上来自于百度翻译 以下为原文 Seems I got another version of the dsPIC32EV EVKIT as the settings were consistent in my source although I never set the CAN into operation. (I had other reasons to use the EV due to some unique features.) Anyway - the FLTENx used has to reflect the index of the RX buffer used. Funny if the code worked at all with the misconfiguration you state. Could it be you mis-/overtyped in your attempts to solve the bug? (I wouldn't expect the "baby" to receive at all with such a misconfiguration.) Hot tip: always keep a copy of the original code for reference. And get a good file compare tool to use when it comes to comparing files... As I am very familiar with all aspects of CAN and CAN configs (dating back 'til 1995), I expect little problems with any kind of CAN controller - classifying the implementations as "less annoying" resp. "really annoying". The EV's CAN controller might rank as "less annoying" as it seems to follow some setup of the venerable i82526/i82527 :) |
|
|
|
|
|
在原始源代码中使用FLTN1,它仍然适用于原始代码。这是因为只有一个过滤器被使用。如果我需要使用12 MSGSID?是否需要为每个ID应用12个过滤器?谢谢。
以上来自于百度翻译 以下为原文 with FLTEN1 in the original source code, it will still work for original code. It is due to only one filter been used. What if I need to use 12 MSG_SID? do I have to apply 12 filter for each ID? Thanks. |
|
|
|
|
|
对于UO到15(?)RX消息,通常将一个单独的缓冲区分配给每个消息,也就是说,将掩码寄存器设置为“匹配所有位”,并将每个消息ID分配给单个RX缓冲区。除此之外,您还必须熟悉“消息(ID)屏蔽”概念,允许使用单一的缓冲区。多个RX消息(到一个可以通过单个缓冲器接收所有RX消息的点)。
以上来自于百度翻译 以下为原文 For uo to 15 (?) RX messages, it is quite usual to assign an individual buffer to each message. That is: set the mask register to "match all bits" and assign each message ID to a single RX buffer. Beyond that you will have to become familiar with the "message (ID) mask" concept, allowing to use a single buffer for multiple RX messages. (Up to the point where one might receive all RX messages via a single buffer.) |
|
|
|
|
|
我认为我的第二条消息有不同的消息ID,但今天我意识到它没有!我添加的第二个过滤器不能识别MSGyIDI2,我已经尝试了几天,仍然无法找出原因。有人能帮忙吗?1RxM1sid=ChanyFieldSkk2ReGySID(0x7FF);C1RXF1sid=ChanyFieldSkk2ReGySID(MSGySIDY2);C1RXM1SID=ChanyStimIDE(C1RXM1SID);C1RXF1sid=ChanyFieldSTD(C1RXF1SID);C1Bufpnt1BIT.F1BP= 0B011;C1FEN1BITS FLTN1=1;C1Tr23 CONTITES.TSEX2=0;这里是第二过滤器的代码:C1FMKSSEL1BITS F1MSK=0;谢谢。
以上来自于百度翻译 以下为原文 I thought my second message with different message ID worked, but today I realized it didn't! the 2nd filter I add doesn't recognize MSG_ID_2 and I have tried for a few days and still couldn't figure out the cause. Could someone help? Here is code for the 2nd filter: C1FMSKSEL1bits.F1MSK = 0; C1RXM1SID = CAN_FILTERMASK2REG_SID(0x7FF); C1RXF1SID = CAN_FILTERMASK2REG_SID(MSG_SID_2); C1RXM1SID = CAN_SETMIDE(C1RXM1SID); C1RXF1SID = CAN_FILTERSTD(C1RXF1SID); C1BUFPNT1bits.F1BP = 0b0011; C1FEN1bits.FLTEN1 = 1; C1TR23CONbits.TXEN2 = 0; Thanks. |
|
|
|
|
|
您使用过滤器位来过滤您想要接收的消息,您使用带有过滤位的掩码位,这样您就可以接受一系列消息ID的掩码位过滤位消息ID接受或拒绝0×x接受0,0接受1 1 1拒绝1 1。0拒绝1 1 1接受设置屏蔽和滤波器以接收多个消息在一个缓冲器中。000 0001 0100=0x014滤波器0111 1111 1100=0x7FC屏蔽0此缓冲器现在将接受0001 0001 0100=0x014000 0001 0001=0x015000α=0x016000μy=0x017。
以上来自于百度翻译 以下为原文 You use the filter bits to filter the messages you want to receive You use the mask bits with the filter bits so you can accept a range of message ID's Mask Bit Filter Bit Message ID Accept or Reject 0 x x Accept 1 0 0 Accept 1 0 1 Reject 1 1 0 Reject 1 1 1 Accept To set up the mask and filter to receive multiple messages in one Buffer. 000 0001 0100 = 0x014 Filter 0 111 1111 1100 = 0x7fc Mask 0 This buffer would now accept 000 0001 0100 = 0x014 000 0001 0101 = 0x015 000 0001 0110 = 0x016 000 0001 0111 = 0x017 |
|
|
|
|
|
非常感谢BTBASS!你的解释很有帮助,我让它起作用。在这一点上,我不得不承认,我仍然不理解缓冲区的实际概念,因为我想到了一个缓冲区的一个过滤器,而第264页的数据表显示CxBUFPNTn对每一个过滤器都有15个缓冲区,这真的让我感到困惑。认为没有必要去完全了解每一个细节,但是从你身上学到经验。再次感谢!
以上来自于百度翻译 以下为原文 Thank you very much btbass! Your explanation is very helpful and I made it work. At this point I have to admit that I still don't understand the actual concept of buffer because I thought one filter for one buffer, and the datasheet on page 264 shows CxBUFPNTn has 15 buffer for each filter which really confuses me. But anyhow I think there is no point to fully understand the every details but learn the experience from you. Thanks again! |
|
|
|
|
|
筛选器定义了哪些掩码实际上要考虑。通过这种方式,您可以用单个缓冲区(“多路复用接收”)接收多条消息。或强制所有比特的匹配。对一堆缓冲区有一个单独的过滤器就足够了,因为大多数应用程序只有少量的多路复用接收消息(如果有的话)。对于一些“业余爱好者”来说,你的方法可能会。在这里提供支持的“专业人员”做的不同:理解所有他们所使用的外围设备都是值得理解的。
以上来自于百度翻译 以下为原文 The filter defines which bits of the masks actually to consider. This way you can receive multiple messages with a single buffer ("multiplexed receive"). Or force the match of all bits. Having a single filter for a bunch of buffers is sufficient as most applications will have only a small number of multiplexed receive messages (if any). For some "hobbyist" your approach might do. The "Pros" delivering the support here do it differently: understand all that's worth understanding about the peripherals they use. |
|
|
|
|
|
我假设只有“商业”MCU可用,我知道它有…唯一一个新的DSPIC家庭出来之前。他们什么时候出去????但最终我们需要更多的频道,我编写了自己的软件仿真。正如你在MPC5xxx中所做的,或者也许是5V,33 eV具有很大的马力,同时仍然是5V。这使得在一些应用中更容易与世界其他地方的接口……我相信DSPIC3EV/EP中的CAN外围设备是由KvASE设计的,这意味着同样的C。在不同的家庭和供应商和硬件工具之间共享MCUs(我们的KVASER接口具有相同的寄存器集),PIC32 MX具有相同的寄存器,但是由于集成的DMA和消息是如何在RAM中组织的,所以存在两个差异,但是它被占用了。我大约30分钟把我的代码从DSPIC33 EV移植到PIC32 MX。但是,这个接口的一些方面确实很难理解。但请参阅参考手册,数据表的信息很少。
以上来自于百度翻译 以下为原文 SENT i presume ;) only "commercial" mcu available i know that has it.. the only one before the new dspic families are out. when will they be out??? but in the end we needed more channels and i wrote my own software emulation. as you would do in a MPC5xxx anyway. Or maybe that was the 5V, the 33EV has a lot of horsepower and while still being 5V. Makes it easier to interface with the rest of the world in some applications... I believe the CAN peripheral in the dsPIC33EV/EP is designed by kvaser, which means that the same configurations are shared between MCUs from different families and vendors and hardware tools (our kvaser interface has the same set of registers), PIC32MX has the same registers, however there are a couple of difference due to the integrated DMA and how the message is organized in ram, but it took me about 30 minutes to port my code from dsPIC33EV to PIC32MX. Still, some aspects of this interface are indeed hard to understand. but please, refer to the reference manual, the datasheet has very few informations |
|
|
|
|
|
不要分享你的假设。但Kvaser可能会使用这些微控制器中的一个作为工具的前端。不知道谁真正完成了逻辑设计。大多数第一代CAN控制器来自博世:不管硅制造商的逻辑设计是博世(包括最终错误眨眼:)从这些开始,并考虑到一些专利可能已经用尽,你可以自由创建你的CAN控制器。在某些方面仍然落后于尊敬的I82526。
以上来自于百度翻译 以下为原文 Don't share your assumption. But Kvaser might use one of these Microchip controllers as the frontend in their tool(s). Not sure who actually did the logic design. Most 1st generation CAN controllers came from Bosch: irrespective of the silicon manufacturer the logic design was Bosch (including eventual errors wink: Starting with these and considering that some patents might be exhausted now, you would be free to create the CAN controller of your like. In some aspects still backward compatible to the venerable i82526. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
490 浏览 0 评论
5806 浏览 9 评论
2346 浏览 8 评论
2234 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3541 浏览 3 评论
1146浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1116浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
883浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
492浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-10 04:49 , Processed in 0.995759 second(s), Total 98, Slave 81 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
4331