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/TMS320F28069: TMS320F28069 PROBLEM WITH TRANSMITTING from ecan AND receiving on PCAN

Part Number: TMS320F28069

Tool/software: Code Composer Studio

I am using PCAN for monitoring receive messages transmitted from ECAN of TMS320f28069 but the programm keep on going between

do {ECanaShadow.CANTA.all = ECanaRegs.CANTA.all;} // Wait for TA25 bit to be set..
while(ECanaShadow.CANTA.bit.TA25 == 0 );

I am using example code given in http://www.ti.com/lit/an/spra876b/spra876b.pdf 

ECanaShadow.CANBTC.bit.BRPREG = 9;
ECanaShadow.CANBTC.bit.TSEG2REG = 1;
ECanaShadow.CANBTC.bit.TSEG1REG = 6;

MY SYSCLK is set by using

#define DSP28_DIVSEL   3 // Enable /1 for SYSCLKOUT

#define DSP28_PLLCR    2

Can someone correct me , where I am going wrong

  • What is your H/W platform? What is your i/p frequency to F28069? What is the SYSCLKOUT frequency? Did you measure the time-period of a bit with an oscilloscope? The CANBTC settings I have given in my app.note is for F28335 running @ 150 MHz. You need to change the values for F28069.
  • I am using DRV8301-TMS320f28069 kit.
    I/P Frequency I am using 10 mhz internal oscillator and after few scaling I am getting sysclkout as 30MHZ
    Scaling is as below:
    #define DSP28_DIVSEL 3 // Enable /1 for SYSCLKOUT
    #define DSP28_PLLCR 6

    So CAN CLK would be 30MHZ/2(SYSCLKOUT/2)

    As given in datasheet :
    BRP Field for Bit Rates (BT = 15, TSEG1reg = 10, TSEG2reg = 2, Sampling Point = 80%)
    CAN Bus Speed: 1 Mbps
    BRP CAN Module Clock: (15 MHz)
    BRPreg +1 = 2

    Therefore I modified BRP to 2 , TSEG1reg to 10 , TSEG2reg to 2(To get 1MBPS)

    On oscilloscope CANH and CANL just gives HIGH signal with changing freq
  • If PLLCR = 6 & DIVSEL = 3, for a 10 MHz i/p clock, SYSCLKOUT = (10 x 6) / 1 = 60 MHz. So, CAN_CLK will be 30 MHz. Your CANBTR value is correct. Probe CANTX pin (while it is transmitting data) and confirm that it is indeed transmitting at 1 Mbps.

    Do you have another node to provide the ACK? Without this, code will not exit that loop.
  • I got it worked with v120 of control suite
  • Thank you Hareesh for helping out!