This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DCAN

Other Parts Discussed in Thread: TMS570LS3137

Hi,

   I am using TMS570LS3137 board for my application , I am trying to use CAN protocol for communicating with other devices . i am using HAL-code generator and code composer studio as IDE . Now i am not able to understand the message box concepts of TI. can you tell me in details about Message box as we all know the CAN basically have the concept of message identifier.

And one more query regarding the arbitration if 2 nodes are trying to send data in endless loop continuously with out DELAY with mess ID 1 and 2  respectively  and i am trying to receive both the message in the 3rd node . Here only message whose ID is 1 is able to receive in the third node . What might be the reason behind this?? 

  • Hi Abhijith,

    The message box or message object concept is fairly straightforward. Each CAN message object is comprised of several fields as shown in the picture below (pasted from TRM):

    The DCAN module on LS3137 MCUs uses a RAM to store each message object. Up to 64 message objects can be stored. Each of these message objects appears in DCAN RAM as shown in the following picture (again, from TRM):

    You can define each message object to be either a TX message object or an RX message object. This is configured using the "Dir" field (0 for RX, 1 for TX).

    As for your query about arbitration between nodes with message ids 1 and 2: you observe that the node that sends message id 2 always loses arbitration to the node that sends message id 1. This is by design. CAN defines logic level '0' as a dominant state and logic level '1' as a recessive state. When two nodes are transmitting at the same time, the node that sends a dominant state wins the arbitration over the node that sends a recessive state at the same time. So the node that sends 0001 will always win arbitration over the node that sends 0010

    Regards, Sunil

  • Hi Sunil,

                   Thank You for your reply . I have a doubt that how exactly the arbitration is done  if we have 4 nodes trying to transmit 6 messages 2 messages by each node. for eg: 

    NODE 1 transmitting messages of id 0x01 and 0x02.

    NODE 2 transmitting messages of id 0x03 and 0x04.

    NODE 3 transmitting messages of id 0x05 and 0x06. 

    These 3 nodes are transmitting these messages in continuous tight loop, In NODE 4 i have to receive the messages with id in following order

    message id : 0x01  

    message id : 0x02

    message id : 0x03

    message id : 0x04

    message id : 0x05

    message id : 0x06

     This should continue in this format . Now is that correct what i am thinking how CAN is going work or any mistake in understanding the concept?.

    Actually we have 3 development kits ie : 1 HDK4357 and  2 HDK3137.

    Here how exactly i can test the CAN operation ?. Actually we are a railway based company so we want to use CAN for our communication and also we are very new tho this protocol .

  • Hi Abhijith,

    There are some other external resources that explain the CAN protocol's arbitration scheme better. For example, you can refer this wiki page:
    en.wikipedia.org/.../CAN_bus

    Note that CAN message ids determine their priorities, based purely on this arbitration scheme. Also, this is a "fixed" priority scheme. So if node 1 attempts to send messages with ids 1 or 2 all the time (or in a tight continuous loop), no other node will get to transmit their messages.

    Regards,
    Sunil
  • Hi Sunil,
    Thanks a lot for your reply. I will try this out and give tell the status regarding this . In the mean time i wanted to know does TMS570LS3137 supports CAN-OPEN protocol ?. If no ,which Micro controller of TI's support CAN-OPEN which is similar to TMS570LS3137.
  • bhijith,

    CANopen is a higher-layer protocol based on the CAN data-link and physical layer. This means that in terms of the OSI model, CANopen implements the layers above and including the network layer.

    So the answer to your question is "Yes, all Hercules MCUs support the CANopen protocol". There are several providers of CANopen stacks based on the CAN data-link and physical layers. See this page for example: http://www.simmasoftware.com/canopen.html

    Regards,

    Sunil

  • Dear Sunil,
    Thanks a lot for your reply and sorry for late reply . We understood the what exactly is CAN-OPEN and we contacted simma software and having a discussion about this .

    Regards ,
    Abhijith Raghavendra.