TMDSCNCD280039C: CAN initialization Issue

Part Number: TMDSCNCD280039C
Other Parts Discussed in Thread: SN65HVD230, C2000WARE

 

Hi,

I am trying to establish communication on the CAN module (CANA), but I am facing issues during initialization.

The CAN_CTL.Init = 1 bit remains set continuously. I am using an external CAN transceiver (SN65HVD230). My intention is to transmit CAN messages from the board to CANoe, but I am unable to do so due to the initialization issue.

Could you please guide me on the necessary steps required to initialize the CAN module?

image.png

Also, please confirm whether the following hardware connections are correct:

  • CAN db connectors CANH and CANL connected through 120ohm register
  • Can transceiver’s CANH and CANL connected through120ohm register, CAN TX and RX pin of transceiver is connected with Docking stations pin 80 and 82, CAN transceiver’s CANH and CANL are connected with CAN db connectors CANH and CANL and
  •  GND of board, breadboard and CAN db connector’s GND are common connected

image.pngimage.pngimage.pngimage.png

image.png

I am looking forward to your response.

 

 

Thank you

PD.

 

  • Hi PD,

    So i can get more information, are you running a custom code or are you running any example from C2000Ware?  Also, do you have access to any CAN Analyzer (PeakCAN) or scope with CAN capability?  These tools will make debugging easier.

    Regards,

    Joseph

  • Hi Joseph,

    I am using custom code, not inbuild example.

    No, using CANoe to test.

    Regards,

    PD

  • Hi PD,

    Can you run the example in C2000Ware (can_ex5_transmit_receive) then?  This is a basic test that checks that the device and CAN module is configured properly and will give us a clue on what could be going on on your setup.  You can revert back to your custom code once we resolve the setup issues.  If you can run that example and check if CAN_initModule function goes through with no issues.  Don't worry about CAN channel assignment for now, just wanted to see that initialization runs without issues.

    Regards,

    Joseph

  • Hi Joseph,

    As per your suggestion, I tested the can_ex5_transmit_receive project.

    I am sharing the register details below for your reference. Kindly review them and guide me on the next steps or any required changes.

    Looking forward to your guidance.

    Thank you

    PD.

  • Hi PD,

    Ok, thanks for checking it out.  What I can tell is that the CAN module initialized correctly.  It attempted to transmit frames but since the CAN channels are not set up correctly per your hardware design, then transmission errors occurred and accumulated to the point that bus off is triggered.  This is expected.  Now you have two options:

          1.) Make can_ex5 example work on your setup by:

                        - Changing the channels to match your hardware by changing the definitions for DEVICE_GPIO_CFG_CANRXA and DEVICE_GPIO_CANTXA to GPIO33 and GPIO32 respectively.

                        - Changing the CANOE to match the example 5 baud rate which is currently set to 500kbps

                        - Run example 5 and CANOE should be able to receive transmitted frames sent at 500kbps from the f28003x and transceiver

    or

         2.) Load your original code and step through to see what settings might have been missed that prevented proper initialization.  You can use example 5 as your basis.

    I suggest to pursue #1 since it will prove if your HW setup is working correctly then we can go back with your original code and continue debugging it.

    Regards,

    Joseph

  • Hi Joseph,

    I tested the setup according to Option #1, as suggested. However, I am still not able to receive the CAN frame.

    Could you please also confirm whether my hardware connections with the CAN transceiver are correct?

    Thanks,

    PD

  • Hi PD,

    HW configuration seems to be correct.  Can you dump the CAN register contents on the f28003x side after running the example?  If you get the same register contents as you have shared before (where it shows the same busoff error), it may mean that CANOE has not received any frame and did not issue an acknowledgement resulting to transmission errors and eventually turning the bus off.

    Regards,

    Joseph