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.

TCAN4550: Sending and Reading CAN messages

Part Number: TCAN4550

Hi,

We are trying to bring up CAN interface in our custom board with TCAN4550 chip. 

So far, we are able to succesfully read the device ID register over SPI from the processor.

We are facing issues in sending and receiving CAN messages.

  • We have connected CAN interfaces of two of our custom boards together to test CAN send and receive.
  • We are using DemoCode Init_CAN and tx_write CAN message code on our linux driver.
  • From one device config TCAN4x5x_MCAN_WriteTXBuffer 0 & 1 .. send

TCAN4x5x_MCAN_TransmitBufferContents(1);     // Request that TX Buffer 1 be transmitteD

TCAN4x5x_MCAN_TransmitBufferContents(0);     // Now we can send the TX FIFO element 0 data that we had queued up earlier but didn't send.

  • CAN message is been transmitted continuously
  • On the other device, we read using below code in linux (e2e.ti.com/.../882873)
  • We are not receiving data on the other board.

Please let us know if we are missing anything here and let us know if you need more details.

Thanks,

Naveen

  • Hi Naveen,

    The link you provided to the e2e post you took the linux code from appears to be broken.  When I try to pullup that link I get a message stating:

    "Unfortunately, the page you've requested no longer exists. Please use the search form above to locate the information you're interested in."


    Could you check the link again and post it again in case there was an error in your original link?  Also, could you send me the title of the e2e thread that I could use in a search if the link once again does not work?  I will need to reference the code and post you are referring too in order to put your question in the proper context and understand what the problem might be.

    Thanks,

    Jonathan

  • Hi Jonathan,

    Thanks for the quick response.

    Here is the link for the thread

    Thanks!

    Naveen

  • Hi Naveen,

    I would like to clarify my understanding because I have a couple of questions.

    1. Are you creating a bare-metal application based on the example code you have referenced, or are you trying to use a Linux based application?  The code you have referenced is for a bare-metal application typically used with a non-Linux MCU, but you have also mentioned that you are using a Linux driver.  There is an official Linux driver adopted and supported in the Linux Kernel so I want to make sure I understand what you are trying to accomplish.  At the moment I am assuming that you have a Linux environment and are trying to create some bare-metal code to interface with the TCAN4550 in a form of hybrid system.  This is fine, but I just need to understand the goal.
    2. When you mention "CAN message is been transmitted continuously," does that mean that you are issuing the transmit command continuously, or is the transmitting board continuously transmitting the same message after only a single write command from the processor?  If the device is transmitting repeatedly on its own based on a single write command from the processor, then this is an indication the receive board has not "acknowledged" the message on the CAN bus and the transmitting board is simply following the CAN protocol of automatically re-transmitting the message again until it is acknowledged.  You can disable the automatic re-transmission feature with the DAR bit in the CCCR register.  But this could indicate the receiving board is not configured properly, or there is a hardware/schematic issue with the bus that is causing the signal to not be received properly.
    3. To help me better debug your communication issue, can you share with me the TCAN4550 portions of the schematics so that I can review them for errors or adjustments?  If you can share them in the forum that is great, but if you would prefer to keep them off the forum just let me know and I can send you an email. 
    4. Can you also share with me your configuration settings for the TCAN4550 devices?  What is the clock frequency, Nominal and Data Bit Timing settings, etc.

    Generally speaking, if your receiving TCAN4550 device is configured with the proper bit timings, then it will acknowledge any message on the CAN bus regardless of whether the processor is reading the incoming message from the RX Buffer/FIFO.  So we need to ensure that both the TX and RX devices are configured for the same settings, there is the proper CAN bus termination of 120 ohms at each end of the wiring harness, the clock frequencies are the same (typically 20Mhz or 40Mhz for CAN applications), the Vsup and Vio supply voltages are correct, etc. 

    Regards,

    Jonathan

  • Hi Jonathan, 

    Thanks for your detailed queries.

    My replies below:

    1. We have created our own linux driver and imported all the functions from msp430 demo code...like Init_CAN , writing to tx buf ID 0x144 and reading from rx_buf

    2. We are transmitting only once and seeing continuous retransmission
    3. I would prefer to share our codes and schematics over mail to you. This is my email: <Removed for privacy>
    4. We are using the same settings as in demo software. We would be sharing our codes over mail for your review.

    Regards,

    Naveen

  • Hi Naveen,

    Thank you for providing the schematics and code for review.  I have responded with comments through email and we can continue to communicate in this forum or through email as needed.

    Regards,

    Jonathan