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.

C2000 - f2806x problems with CAN communication in Simulink

Other Parts Discussed in Thread: TMS320F28335

Hello All,

I have tried to send some data over the CAN interface of the C2000 f2806x but there is no activity on the TX and RX pins, pin 31 and 30, respectively.  The pin voltages are always 3.3 V. Any idea why?

The code embedded on the C2000 is programmed in Simulink and it is composed of a eCAN transmitter block with a constant U32 integer as input.

The code for reading from the CAN bus is still in Simulink and it is composed of a CAN configuration block + CAN receive + CAN unpack.

The hardware setup is a f2806x control board mounted on a development board + CAN transceiver + PEAK-CAN USB receiver connected to a computer.

Please, any suggestion will be very welcome.

rgs

Francesco

  • Please test your hardware without Simulink first. Once you have confirmed your H/W is good, you can bring Simulink into the picture.

    Download my Application report http://www.ti.com/lit/spra876. It has many tested examples. Note that the examples were written for the TMS320F28335 device. However, they can be easily adopted for any 28x device with eCAN, provided you take care of the change in SYSCLKOUT speed and the resultant changes warranted for the CANBTC register. I request you to look at the Debug tips provided. Most CAN issues can be resolved by going through this checklist.

  • Hello Hareesh,

    thank you very much for your files and suggestions. I have been able to make the CAN module work on my F29069 by using CCS.

    However, I can only achieve a max of 125 kbps for the CAN bit rate and I cannot go further than that. 

    For example, if I want 250 kbps, then the bit timing parameters I am using  are as follows (as from TI guidelines):

    BT = 15;

    CAN CLK frequency = 45 MHz;

    BRP = 12;

    Bit Rate  = 45MHz /(15*12) = 250 kHz

    For info:

    1) I am reading the CAN messages through PCAN analyzer with the same desired CAN speed.

    2) I have a set a timer to send the data package (MDL + MDH) every 100 ms. I have also tried without the timer, but no success.

    Any suggestions?

    thanks

    Francesco

  • Hi Francesco, Hareesh is out of the office and may not be able to reply until Tuesday next week.  Out of curiosity are you using the F2806x INTOSC or and external clock source such as a crystal oscillator?

  • Hello Joe, 

    I have solved the issue with the CAN bit rate by adding a 120 Ohm terminator resistor...I had the impression that the resistors where not need for short wires, but I was clearly wrong Slight smile.

    To reply to your question, I am using INTOSC.

    thank you both!

    rgs

    Francesco 

  • Fantastic!  I'm glad you were able to resolve your issue and thanks for posting the solution!

    Regards, Joe