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: CAN数据发送完毕后,如何产生中断 mcan_ir.TC/mcan_ir.TFE

Part Number: TCAN4550

例程中 中断为RF0NE,测试确实能够触发中断。CAN 发送信息我也测试过。但我需要设置一个can发送完毕的中断或者发送缓冲为空的中断(TCE)或(TFEE),我设置后却一直无法产生作用。通过上位机能看到上位机已经接收到TCAN发出的信息,但TCAN4550并没有产生中断。请问为什么?

设置的中断的位置

/* 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
多次运行发送程序,上位机已经接收到这里发送的数据:
TCAN4x5x_MCAN_TX_Header canheader = Conheader;  
  canheader.ID = CanID;
   。。。。。。。
  canheader.DLC = CanDlcCaculate(len);
  TCAN4x5x_MCAN_WriteTXBuffer(Index, &canheader, pdata);  
  TCAN4x5x_MCAN_TransmitBufferContents(Index);
处理中断的位置:
if (mcan_ir.RF0N)                  // If a new message in RX FIFO 0
{
。。。。。。。。    例程的程序,当上位机发送CAN数据这里可以正常收到
}
if(mcan_ir.TC) //TFE  TC  TCAN4550 发送完数据,这里一直没产生这个中断
 {
       platform_printf("\ntransmit Over \n ");     
       TCAN4x5x_MCAN_ClearInterrupts(&mcan_ir);
}