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%3EKDS%20v3.2.0%20%2B%20Processor%20Expert%E3%81%A7CAN%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E9%96%8B%E7%99%BA%E3%82%92%E9%96%8B%E5%A7%8B%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%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%E3%81%93%E3%81%AE%E3%83%89%E3%82%AD%E3%83%A5%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E3%81%AF%E3%80%81KDS%E3%81%A8Processor%20Expert%E3%82%92%E4%BD%BF%E3%81%84%E5%A7%8B%E3%82%81%E3%82%8B%E5%88%9D%E5%BF%83%E8%80%85%E3%81%AB%E9%81%A9%E3%81%97%E3%81%9F%E3%80%81KDS%E4%B8%8A%E3%81%A7%E3%81%AE%E7%B0%A1%E5%8D%98%E3%81%AACAN%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E9%96%8B%E7%99%BA%E6%96%B9%E6%B3%95%E3%82%92%E7%B4%B9%E4%BB%8B%E3%81%97%E3%80%81%E4%B8%BB%E3%81%ABCAN%E3%83%AB%E3%83%BC%E3%83%97%E3%83%90%E3%83%83%E3%82%AF%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E9%96%8B%E7%99%BA%E6%96%B9%E6%B3%95%E3%80%81%E3%80%8C%E3%82%B3%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E3%83%98%E3%83%AB%E3%83%97%E3%80%8D%E3%81%AE%E3%80%8C%E5%85%B8%E5%9E%8B%E7%9A%84%E3%81%AA%E4%BD%BF%E7%94%A8%E6%B3%95%E3%80%8D%E3%81%AE%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%E3%81%AB%E7%84%A6%E7%82%B9%E3%82%92%E5%BD%93%E3%81%A6%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E-%20%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AE%E9%80%81%E4%BF%A1%E3%81%BE%E3%81%9F%E3%81%AF%E5%8F%97%E4%BF%A1%E3%81%AE%E3%83%87%E3%83%A2(%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%81%BE%E3%81%9F%E3%81%AF%E3%83%9D%E3%83%BC%E3%83%AA%E3%83%B3%E3%82%B0%E4%BB%98%E3%81%8D)%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%E3%81%AF%E3%80%81%E3%80%8C%E3%82%B3%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E3%81%AE%E3%83%98%E3%83%AB%E3%83%97%E3%80%8D%E3%81%AE%E3%80%8C%E5%85%B8%E5%9E%8B%E7%9A%84%E3%81%AA%E4%BD%BF%E7%94%A8%E6%B3%95%E3%80%8D%E3%81%A7%E8%A6%8B%E3%81%A4%E3%81%91%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E-%20%E4%B8%80%E8%88%AC%E7%9A%84%E3%81%AA%E4%BD%BF%E7%94%A8%E3%82%B3%E3%83%BC%E3%83%89%E3%81%A7%E3%81%AF%E3%80%81%E8%BB%A2%E9%80%81%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%20ID%20%E3%81%AF%200x123u%20%E3%81%A7%E3%81%99%E3%81%8C%E3%80%81CAN_LDD%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%AF%E3%80%81%E5%8F%97%E4%BF%A1%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%20ID%20%E3%81%AF%200x7FF%20%E3%81%A7%E3%81%82%E3%82%8B%E3%81%9F%E3%82%81%E3%80%81%E5%90%8C%E3%81%98%E3%81%A7%E3%81%82%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AB%E6%B3%A8%E6%84%8F%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%E3%81%97%E3%81%9F%E3%81%8C%E3%81%A3%E3%81%A6%E3%80%81%E3%81%9D%E3%81%AE%E3%81%86%E3%81%A1%E3%81%AE1%E3%81%A4%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99(%E6%A8%99%E6%BA%96%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E5%BD%A2%E5%BC%8F%E3%81%A7%E3%81%AF%E3%80%81%E8%A8%B1%E5%AE%B9%E7%AF%84%E5%9B%B2%E3%81%AF0x00%E3%81%8B%E3%82%890x7FF%E3%81%BE%E3%81%A7%E3%80%81%E6%8B%A1%E5%BC%B5%E5%BD%A2%E5%BC%8F%E3%81%A7%E3%81%AF%E3%80%81%E7%AF%84%E5%9B%B2%E3%81%AF0x00%E3%81%8B%E3%82%890x1FFFFFFF%E3%81%A7%E3%81%99)%E3%80%81%E7%A7%81%E3%81%AE%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%A7%E3%81%AF%E3%80%81%E3%82%B3%E3%83%BC%E3%83%89%E4%B8%8A%E3%81%AETX%20ID%E3%82%920x123u%E3%81%8B%E3%82%890x7FFu%E3%81%AB%E5%A4%89%E6%9B%B4%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E3%83%89%E3%82%AD%E3%83%A5%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A8%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%82%92%E3%81%94%E8%A6%A7%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%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%E3%81%93%E3%81%AE%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%8F%E3%83%BC%E3%83%89%E3%82%A6%E3%82%A7%E3%82%A2%E3%81%AFTWR-K21F120M%E3%83%9C%E3%83%BC%E3%83%89%E3%80%81%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2%E3%81%AFKDS%20v3.2.0%E3%81%A7%E3%81%99%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%E5%85%A8%E8%88%AC%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%3ERe%3AKDS%20v3.2.0%20%2B%E3%83%97%E3%83%AD%E3%82%BB%E3%83%83%E3%82%B5%E3%82%A8%E3%82%AD%E3%82%B9%E3%83%91%E3%83%BC%E3%83%88%E3%81%A7CAN%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E9%96%8B%E7%99%BA%E3%82%92%E9%96%8B%E5%A7%8B%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%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%8A%95%E7%A8%BF%E3%81%99%E3%82%8B%E5%89%8D%E3%81%AB%E3%80%81%E3%82%82%E3%81%861%E5%88%86%E5%BE%85%E3%81%A4%E3%81%B9%E3%81%8D%E3%81%A7%E3%81%97%E3%81%9F%E3%80%82%E5%95%8F%E9%A1%8C%E3%82%92%E8%A6%8B%E3%81%A4%E3%81%91%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E4%BB%96%E3%81%AE%E8%AA%B0%E3%81%8B%E3%81%8C%E3%81%9D%E3%82%8C%E3%81%AB%E9%81%AD%E9%81%87%E3%81%97%E3%81%9F%E5%A0%B4%E5%90%88%E3%81%AB%E5%82%99%E3%81%88%E3%81%A6%E6%8A%95%E7%A8%BF%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E7%A7%81%E3%81%AF%E5%85%B8%E5%9E%8B%E7%9A%84%E3%81%AA%E4%BD%BF%E7%94%A8%E6%B3%95%E3%81%AE%E4%B8%8B%E3%81%A7%E3%83%98%E3%83%AB%E3%83%97%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A7%E7%AD%94%E3%81%88%E3%82%92%E8%A6%8B%E3%81%A4%E3%81%91%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E6%8B%A1%E5%BC%B5%2029%20%E3%83%93%E3%83%83%E3%83%88%20ID%20%E3%81%AE%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E6%AC%A1%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EFrame1.MessageID%20%3D%20(0x1401FFFF%20%7CLDD_CAN_MESSAGE_ID_EXT)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E3%81%93%E3%82%8C%E3%82%92%E8%A1%8C%E3%81%86%E3%81%A8%E3%80%81%E6%9C%9F%E5%BE%85%E3%81%A9%E3%81%8A%E3%82%8A%E3%81%AB%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
評価なし
バージョン履歴
最終更新日:
‎04-25-2016 02:49 AM
更新者: