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.

f28035 eCAN interface

Other Parts Discussed in Thread: CONTROLSUITE

I require to use CAN communication, my setup is a custom f28035 board with a IXXAT USB-to-CAN device and monitoring in the PC.

So was trying to use the sample code, ecan_back2back available in Controlsuite. I am not receiving any packets though there is a clock in both pins.

Verified the connection up to the CAN transceiver by setting GPIO30 & GPOI31 as output, toggled, all fine.

I need 250KBPS, but now trying 1MBPS as available in the sample.

1. The sample program, does it transmit anything out to the pin or (as the name suggests back2back,) internal only?

2. How to change the baudrate to 250KBPS? 

/* The following block is only for 60 MHz SYSCLKOUT. (30 MHz CAN module clock Bit rate = 1 Mbps See Note at end of file. */

ECanaShadow.CANBTC.bit.BRPREG = 1;
ECanaShadow.CANBTC.bit.TSEG2REG = 2;
ECanaShadow.CANBTC.bit.TSEG1REG = 10;

ECanaShadow.CANBTC.bit.BRPREG = 7; // (1+1)*4 -1 for 250kBPS?

Tried STM = 0 and 1,

ECanaShadow.CANMC.bit.STM = 0;//1;

Still nothing on transmit.

Please help me to make it working.

Thanks

Joy

  • Both changes are correct, Count for 250KBPS baudrate is 7 only.

    The same project worked for me, definitely you should re-check the setup/ test method.

    regards

  • Thanks, it is transmitting at 250KBPS now, there was a problem in the CAN transceiver to connector, the common mode filter pins.

    How to configure it for standard ID? Now it is extended ID.

    Cheers

    Joy

  • I am also trying to get the F28035 CAN to work with an IXXAT USB-to-CAN. I used the example code Example_2803xECanBack2Back and modified the following code lines:

    InitGpio(); //was disabled by comment
    InitECanGpio(); //was disabled by comment

    ECanaShadow.CANBTC.bit.BRPREG = 7; //11
    ECanaShadow.CANBTC.bit.TSEG1REG = 10; //6 should also work for 250kbps
    ECanaShadow.CANBTC.bit.TSEG2REG = 2; //1

    EALLOW;
    ECanaShadow.CANMC.all = ECanaRegs.CANMC.all;
    ECanaShadow.CANMC.bit.STM = 0; //was 1 for self-test mode
    ECanaRegs.CANMC.all = ECanaShadow.CANMC.all;
    EDIS;

    Is that all I have to do? Or do I have to connect the mailboxes to GPIO30/31 (RXA and TXA)?

    Thank you very much,

    Felix
  • You don't have to "connect the mailboxes" to GPIO30 /GPIO31. In a certain sense, all the mailboxes are already "connected" to those pins. Any time data has to be transmitted from (or received into ) a mailbox, those pins will be automatically used.