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-Q1: How can I check the transmission completion ?

Part Number: TCAN4550-Q1
Other Parts Discussed in Thread: TCAN4550
What is the fastest way to check the transmission completion in each frame?
If the ACT value of the PSR register is not 7 (NoChange) as shown below, may it be determined that the transmission is completed (whether there is an error or not)?

readValue = AHB_READ_32 (can_idx, REG_MCAN_PSR);
if ((readValue & 0x00000007)! = 7)
   break;
  • User,

    I suppose if you check the ACT value before and after communication, and they both read back idle, then it can be implied that the transmission is complete. Another way is enable the TCE bit in register 1054, and then monitor the TC bit in register 1050. This works based on the controller transmitting and receiving the full message including the ACK bit from other nodes on the bus.

    If there are no other nodes on the bus while testing this, then the ACK bit will not be transmitted and the controller will not recognize the transmission as complete. 

    Regards,

  • Thanks for the comment.

    The ACT value of the PSR register has already been checked and transmission starts.
    But sometimes the LEC value doesn't change in NoChange.

    How can I enable TC interrupts?
    Although the setting is as shown below, the TC bit is not set even though the transmission is completed.

         TCAN4x5x_MCAN_Interrupt_Enable mcan_ie = {0};
         mcan_ie.RF0NE = 1;
         mcan_ie.TCE = 1;
         TCAN4x5x_MCAN_ConfigureInterruptEnable (can_idx, & mcan_ie);
    When the transfer is complete, only the TSW bit is set.
  • User,

    The TC interrupt is enabled in register 1054, the TCE bit must be set to 1. It looks like this is correct in your code snippet.

    In your system, do you have another CAN node on the bus to respond to the TCAN4550 transmissions?

    Regards,

  • Yes. USB-CAN Adapter is connected and Frame is being monitored.
    TC interrupt does not occur even though TCAN4550 transmits Frame and is received by Adapter.
  • User,

    Understood, but does the USB-CAN adapter respond with the ACK bit? This is necessary for the TCAN4550 to know that the transmission has been completed.

    Can you check and see what the state of the DAR bit (bit 6, register 1018) is? 

    Regards,

  • USB-CAN adapter respons ACK bit.
    I tested with the DAR bits set to 0 and 1, but in both cases no interrupts were generated.
    Is there an example source for this interrupt?
    thankyou
  • User,

    The DAR bit would show if the message was being improperly transmitted or not. When this bit is set to 0, the TCAN4550 will continually send the message until it is transmitted correctly. If the message is not being transmitted correctly, then this would be a reason the TC flag is not getting set. 

    Whenever you had the DAR bit set to 0, was the CAN message continuously being transmitted? Or did it transmit once and then stop?

    Regards,