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.

CCS/TMS570LS0714: CAN Protocal

Part Number: TMS570LS0714
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hai,

I am Currently Working on CAN Protocal, In Halcogen we Configure CAN as either TX or Rx How to Configure CAN for both TX and RX, and Where we can assign address for CAN Protocal in Halcogen created code Please let me now

Please Share me Sample code where CAN is configured as Tx and Rx

Thanks,

M. Poorna Chandu

  • Hello Poorna,

    The DCAN data communication happens through the CAN TX and CAN RX pins. The individual CAN message object should be configured for communication over a CAN network. The message objects are stored in the message RAM. The whole message RAM should be configured before putting the CAN into operation. The individual message object can be configured to transmit data or receive the data, but not both. You can change the configuration of any message object, but I recommend you use separate message objects or mailbox for TX and RX.

    For example using message object 1 for TX, and use message object 2 for RX.

  • Hai Wang,

    Thank's for the reply, 

    1.Currenly i have Configured DCAN message 1 and DCAN message 2 as Receiver, When i used message object 1 for receiving i am able to receive and when i use message object 2 I am unable to receive(in Tx side i am using message object 1 for transmitting (Do i need to change any thing in transmitting side) )

    2.What is the format of data frame in sample code

    3.How to set 11 bit identifier

    4.Up to how many bytes i can send in data frame(in example we are sending up to null charcter(HOW?))

    5.attached the code please for reference, Please Check it3821.CANRXv3.0.zip

    Thank You,

    Poorna

  • Hello Poorna,

    1. You can transmit message from DCAN1 message box to any of DCAN2 message box, but you can not transmit data from DCAN1 message box to other DCAN1 message box. You need to configure the MASK of RX object to let the message pass the acceptance filter.

    2. There is no specific data form for CAN transmission. The maximum ddata length s 8-bytes for each transfer.

    3. In HalCoGen CANx General windows, uncheck "Enable Identifier Extension" to use 11-bit ID

    4. Per transfer, it is up to 8 bytes. DLC is used to define the data length. If the data length is less than 8, the remaining bytes of the message object may be overwritten by non specified values.

    5. I will check you code later.

  • The message object 1 and 2 in your example are configured for receiving message. The ID for message object is 2, and the ID mask is 0x3FF. If the ID of coming message is not 2, the message will not be accepted.

  • Hai Wang,

                    once again thanks for reply, really TI support is making us to move fast

                    From your reply i understood that for DCAN1 we have 64 message objects, which means we can have 64 different standard identifiers for a single DCAN

                    is it correct?

                    How to set the Identifier and  mask in halcogen?

                    when iam getting data with the help of receive function in halcogen without processing the data frame, how i can get only 8-byte data (how start of frame, ide, data length etc getting eleminated with out processing?)

                    How to get full data frame(with ide, data length,end of frame etc), in to recive buffer to process on my own(is it possible?)

                   

    Thanks,

    chandu

                    

                    

  • Hello chandu,

    You are correct. You can have 64 different standard identifiers for one CAN module (CAN1, CAN2, ..).

    The HALCoGen includes 2 CAN examples (polling mode, and INT mode). It also shows the CAN configuration in HALCOGen step by step. You can give ID and define the MASK in HALCOGen CAN config GUI.