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.

TMS320F28035 ECAN problem.



Hi.

I'm trying to use the Can-bus module. "ecan_back2back" I compile and install the program. At a rate of 1Mbit worked perfectly. However, I failed to change the speed. According to the 67 numbered pages of technical documents written in the need to adjust the speed using the following formula.

Example programs in;

BRP ==> 2
TSEG1 ==> 6
TSEG2 ==> 1

written. If we were to calculate the bitrate according to these values​​;

SYSCLOCKOUT ==> 60.000mhz.
BRP ==> 2
Bit Time ==> (TSEG1 + 1) + (TSEG2 + 1) + 1 = (6 + 1) + (1 + 1) + 1 = 10

Bit Rate = (60/2) / (2 * 10)
                = 30/20
                = 1.5 Mbit must be.

However, with 1 Mbit Based on this formula is working and I reduce speed 125 kbit not.

Can you explain this situation?

  • Can someone confirm the calculation above? I need to use a baudrate of 250kbps, so do I just need to increase TSEG1 and/or TSEG2 appropriatly?
  • Ahmet Selamunaleyküm;

    In example program;

    BRP is NOT 2
    BRPREG is 2

    So BRP = BRPREG + 1
    BRP = 2 + 1
    BRP = 3;

    Let's calculate again;

    BRP ==> 3
    TSEG1 ==> 6
    TSEG2 ==> 1

    SYSCLOCKOUT ==> 60.000mhz.

    Bit Time ==> (TSEG1 + 1) + (TSEG2 + 1) + 1 = (6 + 1) + (1 + 1) + 1 = 10

    Bit Rate = (60/2) / (3 * 10)
    = 30/30
    = 1 Mbit



    I hope it is also usefull for you Felix Gerste.

    Best regards from Türkiye.
  • If you choose BRPREG = 11

    So BRP = BRPREG + 1 
    BRP = 11 + 1 
    BRP = 12;

    Let's calculate again;

    BRP ==> 12 
    TSEG1 ==> 6 
    TSEG2 ==> 1

    SYSCLOCKOUT ==> 60.000mhz. 

    Bit Time ==> (TSEG1 + 1) + (TSEG2 + 1) + 1 = (6 + 1) + (1 + 1) + 1 = 10

    Bit Rate = (60/2) / (12 * 10) 
    = 30/120 
    = 250kbps


    TSEG1 and TSEG2 also can change baudrate, but i think changing BRPREG (So BREP) more sensible.

  • Thank you very much