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.

TMS320F280049C: Run F280049 CAN example, CAN receiver cannot catch any message boxes

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

I use a CAN example from C2000 ware, the example project's name is can_ex3_external_transmit.

Since I only want to test CAN transmit, I removed error check and let the mailbox been sent out forever.

I use F280049C LaunchPad, set a pre-defined MACRO _LAUNCHXL_F280049C in CCS, the source file

is changed as follows:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//#############################################################################
//
// FILE: can_ex3_external_transmit.c
//
// TITLE: CAN External Transmit Example
//
//! \addtogroup driver_example_list
//! <h1> CAN-A to CAN-B External Transmit </h1>
//!
//! This example initializes CAN module A and CAN module B for external
//! communication. CAN-A module is setup to transmit incrementing data for "n"
//! number of times to the CAN-B module, where "n" is the value of TXCOUNT.
//! CAN-B module is setup to trigger an interrupt service routine (ISR) when
//! data is received. An error flag will be set if the transmitted data doesn't
//! match the received data.
//!
//! \note Both CAN modules on the device need to be connected to each other
//! via CAN transceivers.
//!
//! \b Hardware \b Required \n
//! - A C2000 board with two CAN transceivers
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

By the way, S9 on the LaunchPad is in CAN side. 

My CAN receiver works when I run a CAN communication program on F28379D LaunchPad.

Thanks,

Jiakai

  • Jiakai,

              If you run the c2000ware example “as is”, does it work? Please download my Application report http://www.ti.com/lit/SPRACE5 and look at the Debug tips provided. Most CAN issues can be resolved by going through this checklist.

  • Hi Hareesh,

    I run the original code on the LaunchPad, it doesn't work, so I add a pre-define MACRO _LAUNCHXL_F280049C to use GPIO32/33 as CAN ports.

    I run the program again, still doesn't work, I think I may have to link CANA to CANB, but the launchpad only has one set of CAN driver for CANA, I can't directly connect CANA and CANB, so I remove the error check code (check if the received data is identical to the sent data) and let the program sends message box continuously.

    I have checked SPRACE5 again and didn't find anything can help me.

    thanks,

    Jiakai

  • I think I may have to link CANA to CANB

    Correct.

    but the launchpad only has one set of CAN driver for CANA,

    True.

    so I remove the error check code (check if the received data is identical to the sent data) and let the program sends message box continuously.

    It doesn't work that way. I have explained in SPRACE5 why a 2nd node is needed.

  • Hi Hareesh,

    I don't connect CANA to CANB so CANB cannot receive any message box, I remove the error check code so the message box can be transmitted continuously by CANA.

    Can you point out anything wrong in the updated code?

    By the way, do you have an example that transmits CAM message boxes only? like can_ex4_simple_tranmit in F2837x?

    Thanks,

    Jiakai

  • I don't connect CANA to CANB so CANB cannot receive any message box, I remove the error check code so the message box can be transmitted continuously by CANA.

    Once again, CAN does NOT work that way. You need a properly configured node on the network to provide the ACK. I have explained this clearly in 3.1 Minimum Number of Nodes Required in SPRACE5.

  • I use a CAN receiver as another node on my PC, it can display every bit that CAN sent out from this program.

    By the way, I wrote a program on F28379D that does the same thing, and I can check the outputs by the CAN receiver.

    Thanks,

    Jiakai

  • Jiakai,

              I am not sure exactly what help you need from me. I have given you enough pointers to find the solution. Please go through every debug step in SPRACE5 and report what you found.

  • Thank you, Hareesh,

    As a programmer, I expect an expert who can directly point out what is wrong in my code by his knowledge or experience, I usually can be satisfied with TI Community experts.

    Thank you again,

    Jiakai