TMS320F28384D: Issue with CAN Peripheral Interrupt on 28384D

Part Number: TMS320F28384D
Other Parts Discussed in Thread: SYSCONFIG
I hope this email finds you well.
I am currently working on a project involving the CAN peripheral on the 28384D microcontroller. I have encountered an issue where I am unable to use the CAN interrupt functionality. However, the CAN peripheral works fine when I use polling.
To help diagnose the problem, I am providing the relevant configuration details from SysConfig and the runtime register values below:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//#############################################################################
//
// FILE: can_ex1_loopback.c
//
// TITLE: CAN External Loopback Example
//
//! \addtogroup driver_example_list
//! <h1> CAN External Loopback </h1>
//!
//! This example shows the basic setup of CAN in order to transmit and receive
//! messages on the CAN bus. The CAN peripheral is configured to transmit
//! messages with a specific CAN ID. A message is then transmitted once per
//! second, using a simple delay loop for timing. The message that is sent is
//! a 2 byte message that contains an incrementing pattern.
//!
//! This example sets up the CAN controller in External Loopback test mode.
//! Data transmitted is visible on the CANTXA pin and is received internally
//! back to the CAN Core. Please refer to details of the External Loopback
//! Test Mode in the CAN Chapter in the Technical Reference Manual. Refer
//! to [Programming Examples and Debug Strategies for
//! the DCAN Module](www.ti.com/lit/SPRACE5) for useful information about
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • 已经收到了您的案例,调查需要些时间,感谢您的耐心等待。

  • 您好

    似乎在 PIE 中注册和启用了 ISR INT_myCAN0_0_ISR。 如果使用了 SysConfig 来配置,中断注册和启用通常在 Board_init ()函数中完成。 您能否检查 board.c 文件中是否生成了中断函数?

  • board.c中没有生成中断函数,以下是board.c中关于can的配置

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void myCAN0_init(){
    CAN_initModule(myCAN0_BASE);
    //
    // Refer to the Driver Library User Guide for information on how to set
    // tighter timing control. Additionally, consult the device data sheet
    // for more information about the CAN module clocking.
    //
    CAN_setBitTiming(myCAN0_BASE, 15, 0, 15, 7, 3);
    //
    // Enable CAN Interrupts
    //
    CAN_enableInterrupt(myCAN0_BASE, CAN_INT_ERROR|CAN_INT_IE0|CAN_INT_STATUS);
    CAN_enableGlobalInterrupt(myCAN0_BASE, CAN_GLOBAL_INT_CANINT0);
    //
    // Initialize the transmit message object used for sending CAN messages.
    // Message Object Parameters:
    // Message Object ID Number: 1
    // Message Identifier: 2
    // Message Frame: CAN_MSG_FRAME_STD
    // Message Type: CAN_MSG_OBJ_TYPE_TX
    // Message ID Mask: 0
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    另外,INT_myCAN0_0_ISR()函数在board.h中进行了声明。“extern __interrupt void INT_myCAN0_0_ISR(void);”

  • 您好

    您是否尝试过改用示例 can_ex2_loopback_interrupts? 此示例测试用例具有正确的中断设置。

  • 我尝试了一下can_ex2_loopback_interrupts,更改后可以使用的。但是这个示例没有使用sysconfig,是直接调用的driverlib进行的初始化。在我自己的程序中,我使用sysconfig进行外设初始化,就会出现不进入中断的现象

  • 您好

    Sysconfig only is intended to do module initialization and setup.  For other functions like adding interrupts and ISR routines, these have to be added manually by the user.  In the interrupt example, the interrupt routines have been manually added.

x 出现错误。请重试或与管理员联系。