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.

problem in ecan_a_to_b_xmit in ezdsp TMS320F28335 example

Other Parts Discussed in Thread: TMS320F28335, SN65HVD235

Hi

I am trying to run an example program for ecan_a_to_b_xmit in ezdsp TMS320F28335.

i connect cana to canb lines in the ezdsp board

when i run the example it stay in the loop

 


for(i=0; i < TXCOUNT; i++)
   {
       ECanaShadow.CANTRS.all = 0;
       ECanaShadow.CANTRS.bit.TRS25 = 1;             // Set TRS for mailbox under test
       ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;

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


       ECanaShadow.CANTA.all = 0;
       ECanaShadow.CANTA.bit.TA25 = 1;               // Clear TA25
       ECanaRegs.CANTA.all = ECanaShadow.CANTA.all;

       loopcount ++;
    }

 

the can bus moudle is not change ECanbShadow.CANTA.bit.TA25  state to high

someone can help me ? 

 

 

  • Have you gotten it solved?

    I am getting identical issue and could not figure it out myself.

    Can someone help us? Thanks

     

    Adel said:

    Hi

    I am trying to run an example program for ecan_a_to_b_xmit in ezdsp TMS320F28335.

    i connect cana to canb lines in the ezdsp board

    when i run the example it stay in the loop

     


    for(i=0; i < TXCOUNT; i++)
       {
           ECanaShadow.CANTRS.all = 0;
           ECanaShadow.CANTRS.bit.TRS25 = 1;             // Set TRS for mailbox under test
           ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;

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


           ECanaShadow.CANTA.all = 0;
           ECanaShadow.CANTA.bit.TA25 = 1;               // Clear TA25
           ECanaRegs.CANTA.all = ECanaShadow.CANTA.all;

           loopcount ++;
        }

     

    the can bus moudle is not change ECanbShadow.CANTA.bit.TA25  state to high

    someone can help me ? 

     

  • What's exactly the problem?

    I your post you say: "the can bus moudle is not change ECanbShadow.CANTA.bit.TA25  state to high".

    Well, that wll never happen, since you transmit with CANA and not CANB.

    If the quelstion was, "why doesn't  the CANA set the bit TA25?", then it makes more sense. The TA bit is not set by the CAN communication controller in case of an unsuccessful transmission. There can be many  reasons:  How did you connect CANA anf CANB? Did you use transceivers to connect  the lines CANH and CANL between CANA and CANB? Did you enable the clock both for CANA and CANB? Are CANA and CANB initialized properly? Did you use termination resistors between CANH and CANL, especially at 1MBit/s?

    Hope this helps.

       

     

  • Hi,

    I have recently faced with a similar problem  (problem in ecan_a_to_b_xmit in ezdsp TMS320F28335 example).
    Note that "Since CAN-B is initialized in DSP2833x_ECan.c, it should acknowledge all frames transmitted by the node on which this code runs". So, this should be run properly on 28335 supporting two independent CAN module. By the way, I even have tested this code on two independent DSKs and unfortunately it was not successful too.
    Could anyone finally afford this problem?

    Meanwhile, my hardware CAN-BUS connection has been represented as attached file.

    (JP2 and JP3 are short-circuit by using jumpers)

    All other software configurations and codes are the same as  "Example_2833xEcanA_to_B_Xmit.pjt" TI example but GPIO configurations in"InitEcanGPIO()" function has been changed  to (GPIO19,18,20,21).
    I'll be really grateful if anyone could help me to solve this problem too.

    Beforehand I thank for your hints


  • hi Alireza

    check if the clock of the can bus is setting  ?

    EALLOW;

    SysCtrlRegs.PCLKCR0.bit.ECANAENCLK = 1;  // eCAN-A

    EDIS;

    Regards

    Adel

  • Thanks for your reply.

  • Hi everyone, I have tha same problem the flag ECanaShadow.CANTA.bit.TA25 does not change of state.

    Have anyone solved the problem ?

  • TI engineers still can't give us any advice for that?

  • Hi.

    I have same problem the eCan communication. and I have a question to you.

    What version of CCS do you use? I tested eCan module in CCSv 3.3, and it operates well.

    but in CCS v5 doesn't  operate because  canta.bit.tax bit is not change.

    and next loop is infinete. 

    do{
          ECanaShadow.CANTA.all = ECanaRegs.CANTA.all;
    }     while(!ECanaShadow.CANTA.bit.TA0);

    So I think this problem is CCSv5's bug...

    please help me.. 

  • hi, I found it!!

    what version of Control suite common source file and header file do you use?

    I used latest version source and header file and had problem in eCan,( problem is not to change TA bit...)

    But, it is ok in old version source and header file. (it operates well in version v121 or lower)

    exactly, i checked with v121 source and header file.

    header file has a little of changing.

    Good luck~ all!

  • Do you have solved the problem that   programme loops forever at 

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

     

  • Hi,

    the same problem i met with you. i solved the problem by the following operations:

    CANLB(3#pin in J11) should be connected to CANLA (2#pin in P11)

     CANHB(4#pin in J11) should be connected to CANHA (7#pin in P11)

    the 3# switch in SW2 should be turnned ON (that is Select GPIO8, GPIO9, GPIO10, GPIO11 as on board SCI/CAN B)

    then the code runs through.

    For more details, you can refer to "eZdspTM F28335 technical reference.pdf ".

    Sorry for my poor English.

    您好!刚才调试这个程序也没调通,后来,我将ezdsp板上CAN-A和CAN-B经过CAN驱动器SN65HVD235后的端口相连,即CANLB(3#pin in J11) 与CANLA (2#pin in P11), CANHB(4#pin in J11)与 CANHA (7#pin in P11)相连接,并且SW2开关中的第3个拨向ON状态,发现程序通过了。

  • Hi

     I have tha same problem the flag ECanaShadow.CANTA.bit.TA25 does not change of state.I send the message from DSP to USBCAN by this program,which is connected with computer.  I can see the message which is sent by DSP,  but  the flag  ECanaShadow.CANTA.bit.TA25 cannot be set 1.

    Can you help me ? Thanks! 

  • Hi,what diffrence about  V121 between V131?

    Can you help me ?

    f28335 eCAN 

     do         {           ECanbShadow.CANTA.all = ECanbRegs.CANTA.all;         } while(ECanbShadow.CANTA.bit.TA25 == 0 );  // loop is infinete. 

    thanks!

  • hi

    please send me correct code for can bus(A_to_B_Xmit) in 28335

    mb.montazeri@gmail.com

  • When a node transmits a frame on the CAN bus, it expects an ACKnowledgement from at least one other node on the network. The receiving node that provides the ACK does not need to be the intended recipient of the frame, although it could very well be. When the transmitting node does not receive an ACK, it results in ACKnowledge error and it keeps re-transmitting the frame forever. In this situation, the TA bit for the transmitting mailbox does not get set at all and code will be looping there forever. For proper operation, the CAN_H pins of all CAN nodes must be connected together and likewise the CAN_L pins. The bus also should be terminated correctly on either ends (only).