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.

CCS/TMS570LS0432: Setting up CAN with BQ76PL455A-Q1 example code

Part Number: TMS570LS0432
Other Parts Discussed in Thread: BQ76PL455A-Q1, HALCOGEN, BQ76PL455A

Tool/software: Code Composer Studio

Hi, Im currently using the BQ76PL455A-Q1 and programming it using the TMS570LS0432, this is all going well and I now want to enable the CAN interface on the TMS570 in order to transmit Fault messages, I couldn't find this in the example code provided so Ive used HalCoGen to generate a blank piece of code with Can enabled following this tutorial,   I generated the CCS files as demonstrated and then copied the can.c and can.h files into the BQ76Pl455A-Q1 example code, I've then followed the example through as on the video but I get an error message when building my project on the canTransmit line that

"identifier "CANMESSAGE_BOX1" is undefined" do you know how to fix this?

Thanks,

Alex

  • Hi Alex,

    The canMESSAGE_BOX1 is defined in can.h. The HALCoGen generates 2 header files and 1 source file for CAN module:
    1. can.c
    2. reg_can.h
    3. can.h
  • Hi QJ,

    Thanks for clarifying this, I've now followed the steps in the below link to send a CAN Message however when probing the CAN1TX lines of the microcontroller I cannot see any signals being sent, instead the TX output is constantly at 1.8V. Do you know why this could be?

      

    Cheers,

    Alex

  • Hello,

    Who is the CAN message receiver? I remember that BQ76PL455A doesn't support CAN. My understanding is that TMS570LS0432 sends CAN message to another MCU or your PC.

    Are there terminations (120ohms) on your CAN bus on both node sides? Is there a CAN transceiver between MCU and CAN bus?

    You can use internal loopback mode to check the CAN module.
  • The CAN receiver is yet to be determined however I am trying to simply output a message and view this in the form of signals on an oscilloscope (the contents of the message are not important I am just looking to view some form of signal on the output). It is indeed the TMS570LS0432 that will be sending the CAN signal, I am also using the ISO1050DUB CAN Transceiver. There is a 120ohm termination on this side of the BUS with the other side open at the moment as no receiver has been decided upon.

    How do I use the loopback mode to check that it is working?

    Thanks,
    Alex
  • Hello Alex,

    The HAlCogen generated CAN driver has a function: canEnableloopback(). It can be used to loopback the TX data to RX messagebox.

    There are several loopback types.
    1. Internal loopback
    2. external loopback
    3. Internal silent loopback

    Please check the chapter 21.3 of the TRM