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.

TMS320F28335: ECAN使用问题

Part Number: TMS320F28335

使用官方的示例程序(ecan_a_to_b_xmit)修改can通信     程序仿真会在如图所示的位置死循环 can的中断标志无法置位

修改后程序代码如下:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//###########################################################################
// Description
//! \addtogroup f2833x_example_list
//! <h1>eCAN-A to eCAN-B Trasmit Loop (ecan_a_to_b_xmit)</h1>
//!
//! This example TRANSMITS data to another CAN module using MAILBOX5
//! This program could either loop forever or transmit "n" # of times,
//! where "n" is the TXCOUNT value. \n
//!
//! This example can be used to check CAN-A and CAN-B. Since CAN-B is
//! initialized in DSP2833x_ECan.c, it will acknowledge all frames
//! transmitted by the node on which this code runs. Both CAN ports of
//! the 2833x DSP need to be connected to each other (via CAN transceivers)
//!
//! \b External \b Connections \n
//! - ECanb is on GPIO31 (CANTXA) and GPIO30 (CANRXA)
//! - eCANB is on GPIO8 (CANTXB) and GPIO10 (CANRXB)
//! - Connect ECanb to eCANB via CAN transceivers
//
//###########################################################################
// $TI Release: F2833x/F2823x Header Files and Peripheral Examples V142 $
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 额,你好,还请明确标注一下修改的是哪些地方,否则这么一句句对照效率太低了

  • 你好  感谢回复  官方的例程仿真同样会卡在这个位置  CANTA无法置一 

    官方例程代码:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //###########################################################################
    // Description
    //! \addtogroup f2833x_example_list
    //! <h1>eCAN-A to eCAN-B Trasmit Loop (ecan_a_to_b_xmit)</h1>
    //!
    //! This example TRANSMITS data to another CAN module using MAILBOX5
    //! This program could either loop forever or transmit "n" # of times,
    //! where "n" is the TXCOUNT value. \n
    //!
    //! This example can be used to check CAN-A and CAN-B. Since CAN-B is
    //! initialized in DSP2833x_ECan.c, it will acknowledge all frames
    //! transmitted by the node on which this code runs. Both CAN ports of
    //! the 2833x DSP need to be connected to each other (via CAN transceivers)
    //!
    //! \b External \b Connections \n
    //! - eCANA is on GPIO31 (CANTXA) and GPIO30 (CANRXA)
    //! - eCANB is on GPIO8 (CANTXB) and GPIO10 (CANRXB)
    //! - Connect eCANA to eCANB via CAN transceivers
    //
    //###########################################################################
    // $TI Release: F2833x/F2823x Header Files and Peripheral Examples V142 $
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 抱歉,你上传的自己代码可能是选择的TXT格式的,所以看起来实在有点累。

    就例程而言,卡在这个位置的话说明传输不成功,不知道你这边的硬件上有没有根据例程中提示的进行连接?即通过CAN收发器连接CANA和CANB

    //! \b External \b Connections \n
    //! - eCANA is on GPIO31 (CANTXA) and GPIO30 (CANRXA)
    //! - eCANB is on GPIO8 (CANTXB) and GPIO10 (CANRXB)
    //! - Connect eCANA to eCANB via CAN transceivers

  • 感谢您   我的问题已经解决  can分析仪没配置对。。。。