How to Start CAN Module Development on KDS v3.2.0 + Processor Expert

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to Start CAN Module Development on KDS v3.2.0 + Processor Expert

How to Start CAN Module Development on KDS v3.2.0 + Processor Expert

- This document introduces how to develop a simple CAN module application on KDS, it is suitable for the beginners to start using the KDS and Processor Expert, and it mainly focus on how to developing a CAN Loopback application, how to use the “Typical Usage” of “help on component”.

- About the Sending or Receiving data demo(with interrupt or polling) we can find on  the "Typical Usage" of "help on component" .

- Pay attention that , in the Typical Usage code , the Transfer Message ID is 0x123u, while in the CAN_LDD default configuration , the Receive Message ID is 0x7FF, they are should be same . So we should change one of them (In standard frame format, the admissible range is from 0x00 to 0x7FF; in extended format, the range is from 0x00 to 0x1FFFFFFF ), on my project , I change the TX ID from 0x123u to 0x7FFu on the code, about the detail information,

please look at the document and application project.

 

This application hardware is TWR-K21F120M board, software is KDS v3.2.0 .

标签 (1)
附件
评论

I'm using KDS v3.2.0 with Process Expert and a FRDM-KE06.  I'm trying to send CAN data frames with extended 29 bit message IDs. Everything works fine if I use 11 bit standard message IDs, but if I set the frame message ID to a 29 bit extended frame, the message ID is truncated to 11 bits. I'm setting the message ID as follows:

Frame1.MessageID = 0x1401FFFF;

Frame2.MessageID = 0x1402FFFF;

Then sending message as follows:

Error_CAN = CAN1_SendFrame(CAN1_DeviceData, 1U, &Frame1);

Error_CAN = CAN1_SendFrame(CAN1_DeviceData, 2U, &Frame2);

When I monitor the CAN, I'm only seeing 0x7FF as the message ID for both messages. I've tried different CAN monitoring tools to rule that out. If I change the message IDs as follows:

Frame1.MessageID = 0x1;

Frame2.MessageID = 0x2;

...Then they show up with message IDs 0x1 and 0x2 respectively. 

 

My Message Buffers tab does not look the same as yours in PE. Here is a screenshot:

messagebufferstab.PNG

What do I need to do in order to send extended frame message IDs with PE and KDS 3.2.0?

I should have waited one more minute before posting. I found the problem. Posting in case anyone else runs into it. I found the answer in the help file under typical usage. For extended 29 bit IDs, they need to be set as follows:

Frame1.MessageID = (0x1401FFFF | LDD_CAN_MESSAGE_ID_EXT);

After doing this, it works as expected.

%3CLINGO-SUB%20id%3D%22lingo-sub-1129316%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%A6%82%E4%BD%95%E5%9C%A8%20KDS%20v3.2.0%20%2B%20Processor%20Expert%20%E4%B8%8A%E5%90%AF%E5%8A%A8%20CAN%20%E6%A8%A1%E5%9D%97%E5%BC%80%E5%8F%91%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1129316%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3Dutf-8%22%20%2F%26gt%3B%0A%3CP%3E-%20%E6%9C%AC%E6%96%87%E6%A1%A3%E4%BB%8B%E7%BB%8D%E4%BA%86%E5%A6%82%E4%BD%95%E5%9C%A8KDS%E4%B8%8A%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84CAN%E6%A8%A1%E5%9D%97%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%EF%BC%8C%E9%80%82%E5%90%88%E5%88%9D%E5%AD%A6%E8%80%85%E5%BC%80%E5%A7%8B%E4%BD%BF%E7%94%A8KDS%E5%92%8CProcessor%20Expert%EF%BC%8C%E4%B8%BB%E8%A6%81%E8%AE%B2%E8%A7%A3%E5%A6%82%E4%BD%95%E5%BC%80%E5%8F%91CAN%20Loopback%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%EF%BC%8C%E4%BB%A5%E5%8F%8A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E2%80%9C%E7%BB%84%E4%BB%B6%E5%B8%AE%E5%8A%A9%E2%80%9D%E4%B8%AD%E7%9A%84%E2%80%9C%E5%85%B8%E5%9E%8B%E7%94%A8%E6%B3%95%E2%80%9D%E3%80%82%3C%2FP%3E%3CP%3E-%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BC%E5%BC%8F%E4%B8%AD%EF%BC%8C%E8%8C%83%E5%9B%B4%E6%98%AF%E4%BB%8E%200x00%20%E5%88%B0%200x1FFFFFFF%20%EF%BC%89%EF%BC%8C%E5%9C%A8%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%EF%BC%8C%E6%88%91%E5%9C%A8%E4%BB%A3%E7%A0%81%E4%B8%8A%E5%B0%86%20TX%20ID%20%E4%BB%8E%200x123u%20%E6%9B%B4%E6%94%B9%E4%B8%BA%200x7FFu%EF%BC%8C%E5%85%B3%E4%BA%8E%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF%EF%BC%8C%3C%2FP%3E%3CP%3E%E8%AF%B7%E6%9F%A5%E7%9C%8B%E6%96%87%E6%A1%A3%E5%92%8C%E5%BA%94%E7%94%A8%E9%A1%B9%E7%9B%AE%E3%80%82%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%9C%AC%E5%BA%94%E7%94%A8%E7%A1%AC%E4%BB%B6%E4%B8%BATWR-K21F120M%E6%9D%BF%EF%BC%8C%E8%BD%AF%E4%BB%B6%E4%B8%BAKDS%20v3.2.0%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1129316%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E6%A6%82%E8%BF%B0%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1129318%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%20KDS%20v3.2.0%20%2B%20Processor%20Expert%20%E4%B8%8A%E5%90%AF%E5%8A%A8%20CAN%20%E6%A8%A1%E5%9D%97%E5%BC%80%E5%8F%91%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1129318%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3Dutf-8%22%20%2F%26gt%3B%0A%3CP%3E%E6%88%91%E5%BA%94%E8%AF%A5%E5%86%8D%E7%AD%89%E4%B8%80%E5%88%86%E9%92%9F%E5%86%8D%E5%8F%91%E5%B8%96%E3%80%82%E6%88%91%E5%8F%91%E7%8E%B0%E4%BA%86%E9%97%AE%E9%A2%98%E3%80%82%E5%8F%91%E5%B8%83%E4%BB%A5%E9%98%B2%E5%85%B6%E4%BB%96%E4%BA%BA%E9%81%87%E5%88%B0%E6%AD%A4%E9%97%AE%E9%A2%98%E3%80%82%E6%88%91%E5%9C%A8%E5%85%B8%E5%9E%8B%E7%94%A8%E6%B3%95%E4%B8%8B%E7%9A%84%E5%B8%AE%E5%8A%A9%E6%96%87%E4%BB%B6%E4%B8%AD%E6%89%BE%E5%88%B0%E4%BA%86%E7%AD%94%E6%A1%88%E3%80%82%E5%AF%B9%E4%BA%8E%E6%89%A9%E5%B1%95%E7%9A%8429%E4%BD%8DID%EF%BC%8C%E9%9C%80%E8%A6%81%E8%BF%9B%E8%A1%8C%E5%A6%82%E4%B8%8B%E8%AE%BE%E7%BD%AE%EF%BC%9A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E5%B8%A71.%E6%B6%88%E6%81%AFID%20%3D%20(0x1401FFFF%20%7C%20LDD_CAN_MESSAGE_ID_EXT)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E5%AE%8C%E6%88%90%E6%AD%A4%E6%93%8D%E4%BD%9C%E5%90%8E%EF%BC%8C%E5%AE%83%E4%BC%9A%E6%8C%89%E9%A2%84%E6%9C%9F%E5%B7%A5%E4%BD%9C%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
无评分
版本历史
最后更新:
‎04-25-2016 02:49 AM
更新人: