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: how to generate interruption mcan_ir.TC/mcan_ir.TFE when finished sending data

Part Number: TCAN4550

Hello,

One customer asked the question about TCAN4550:

The interruption is RF0NE and tested it could generate interrupt. And he also tested the CAN sent information. He need to set one interrupt when finished sending  or send empty interrupt TCE or TFEE, but his setting has no effect.  It is seen via the upper computer  that it has received a message from the TCAN, but the TCAN4550 has not generated an interrupt. Why is it? 

The position setting interruption

/* Set the interrupts we want to enable for MCAN */
  TCAN4x5x_MCAN_Interrupt_Enable mcan_ie = {0};       // Remember to initialize to 0, or you'll get random garbage!
  mcan_ie.RF0NE = 1;                      // RX FIFO 0 new message interrupt enable
  mcan_ie.TCE = 1;    
  //mcan_ie.TFEE = 1;
  TCAN4x5x_MCAN_ConfigureInterruptEnable(&mcan_ie);     // Enable the appropriate registers
Run the sender several times and the data sent here has been received by the upper computer:
TCAN4x5x_MCAN_TX_Header canheader = Conheader;  
  canheader.ID = CanID;
   。。。。。。。
  canheader.DLC = CanDlcCaculate(len);
  TCAN4x5x_MCAN_WriteTXBuffer(Index&canheaderpdata);  
  TCAN4x5x_MCAN_TransmitBufferContents(Index);
Processing Interrupts at: 
if (mcan_ir.RF0N)                  // If a new message in RX FIFO 0
{
。。。。。。。。                                                             -----------  At this position, it could receive data when upper computer send CAN data
}
if(mcan_ir.TC) //TFE  TC  TCAN4550                           ------------------Here didn't generate interrupt when finished sending data
 {
       platform_printf("\ntransmit Over \n ");     
       TCAN4x5x_MCAN_ClearInterrupts(&mcan_ir);
}
Best regards
Kailyn
  • Hi Kailyn,

    I have a couple of questions.  There are two separate Interrupt Lines that can have different interrupts assigned to them  Perhaps there is a configuration issue between which line the RF0N and the TC/TFEE are assigned to.  Also, with the TX Buffer Transmission Interrupt, there is a separate bit for each TX Buffer element that must be set in order to generate an interrupt.

    What are the values of the following registers?

    0x1054 - Interrupt Enable

    0x1058 - Interrupt Line Select

    0x105C - Interrupt Line Enable

    0x10E0 - TX Buffer Transmission Interrupt Enable

    I assume that the most likely reason is that register 0x10E0 is not getting set for the TX Buffers being used to transmit the messages.

    If all of the above registers are set correctly and you still don't see an interrupt, can you then confirm the value of the following registers after the message should have been transmitted?

    0x10D0 -TX Buffer Add Request

    0x10CC - TX Buffer Request Pending

    0x10D8 - TX Buffer Add Request Transmission Occurred

    Regards,

    Jonathan