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/LAUNCHXL-F280049C: CAN Communication

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Dear TI community, 

I have just started my journey with LAUNCHXL-F280049C and my question is regarding CAN interface or any other external or internal method, which can help me do the following:

what I need to do is to generate PWM signals and being able to change the frequency and duty cycle of these PWMs during the time that the test is running. whithout any external hardware (resistors,capacitors, ...)
my idea was that I take CANape as the user interface and send CAN messages to the LAUNCHXL-F280049C through CANL and CANH pins. but I do not know how to implement and interpret these CAN messages in Code Composer. is there any example of using CAN messages?

that would be so nice if you could help me with this problem. 

looking forward to hearing from you soon :)
Mohammad

  • Hi Mohammad,

    You certainly can pass those attributes for PWM to the CAN bus and let the CAN in the F280049C device receive it and use the CAN message for the PWM variables.

    There is an example that you can follow in C2000Ware.  The example is can_ex3_external_transmit.c.  In this example, it makes use of CANA to transmit data and CANB to receive the data using the CAN bus through the on board transceiver.  Since you only need to receive the data, you only need to use one CAN module.  You can choose to use CANA instead to receive the data since the Launchpad connection for the on-board transceiver is wired for GPIO32  (CANATX) and GPIO33 (CANARX).

    In the example, first remove all instances of CANA so you will just be left with instances of CANB.  This way all the CAN receive routines will be retained.   Next, replace instances of CANB with CANA.  Next, you need to ensure that the statements GPIO_setPinConfig(DEVICE_GPIO_CFG_CANTXA) and GPIO_setPinConfig(DEVICE_GPIO_CFG_CANRXA) correctly map to GPIO32 and GPIO33 respectively.

    There are typically 8 bytes of data that can be sent in a CAN frame so configure this too in your CANape interface and set the baud rate to 500kbps as this is what the example code is configured to.  In the receiving routine, function CAN_readMessage() reads the data and message is passed on the argument rxMsgData.   rxMsgData should hold the message received that is transmitted over the CAN.

    Sorry, I cannot give you the step-by-step procedure in writing the complete CAN code but the guidelines above should be good starting points for interfacing to CAN bus and receiving CAN messages.

    Regards,

    Joseph

  • Mohammed,

    I'm assuming that you have started using the CAN example codes and the pointers above to start your project, so i'm closing this thread.  If you still have questions, please post it in the forum.

    Regards,

    Joseph

  • I am wondering if it is possible to communicate with this board with CAN over XCP. 

    I have asked another question about required microcontroller files for CANape, but the experts told me they do not know CANape and I should contact Vector and ask them. I did so and Vector answered me:  " Vector does not provide A2L or MAP files to controllers. This must be provided by the manufacturer of the control units." 

    I am confused. I want to use CAN option provided on this board and I simply cannot.

    please help me, there should be a solution to that.

    regards,

    Mohammad

  • Hi Mohammad,

    Sorry, like Chris's replay in the other post, i also am not familiar with CANape, but looking at Vector's website, it looks like CANape is a CAN interface that sends measurement data over the CAN bus.  My assumption is that utility takes some measurements, processes the measured data and converts it into some standard format and transmits that into groups into bytes of data over the CAN bus.  CANape probably has another layer of SW that does the manipulation and translation of data, but over CAN, transmission and reception of data is the same regardless of the utility/interface that is sending or receiving over the bus.

    For the basics, let us start with a CAN frame: it has a start of frame, ID field, control field, data field (8 bytes max), CRC field, acknowledge and end of frame.  As long as there is CAN frame in the CAN bus, the F280049 CAN should be able to receive that, provided that the CAN baud rate configured for the launchpad matches the baud rate of the sent frame. 

    If you already have the CANape interface available, just connect the CAN bus directly on J14 (output of the transceiver) of the launcpad and start sending data, as a start.  There are several examples in C2000Ware that you can use to program the CAN to receive data.  Maybe that is the first step, then if you get the receive working, check for received data in the mailbox.  Unfortunately, the routines in C2000Ware deal with low level CAN data frames so it would be up to you to translate that into usable format for your application.

    Hope you can start with this.  Let me know if you have questions.

    Regards,

    Joseph

  • Hi Mohammad,

              Any progress on this experiment?  Did you try to pursue the suggestions?

    Thanks and regards,

    joseph

  • Hi Mohammad,

    Have not heard back from you on this topic so i assume you have resolved your CAN issues, hence marking this thread closed.  It you still have issues on how to use the CAN module on the F280049, please post it in the forum.

    Regards,

    Joseph