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.

TMS320F280049: Migrating form eCAN to DCAN

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE

HI:

My project is migrating from 28035 to 280049.

At 28035, we use obj/mailbox 1 to receive the data of two protocol numbers through ID filter. Obj/mailbox 4 and obj/mailbox 5 send their respective protocol data.
In the original project, the first reply frame is triggered by receiving data, and the rest is saved in the buffer. In the main loop, the first frame transmission is judged to be completed by judging ECanaRegs. Canta. Bit. TA5 = 1. After judging that the transmission is completed, the bit is cleared first, and the data in the buffer is sent until the data in the buffer is sent complete.
In the register of DCan,found CAN_ES.TxOk, but think this bit is impossible to distinguish between two obj's.  Bit TxRqst ,indicative The transmission of this message object is requested and is not yet done.So I would like to ask whether there is a corresponding flag bit in DCan equal ECanaRegs.CANTA.bit.TA5 in eCAN ?


In the original project,  ECanaRegs.CANRMP.bit.RMP1 = 1 is used to judge whether there is data reception. After data is received, the flag bit is cleared first, and then the data in the register is read. Currently, it is planned to use (HWREG_BP(CANA_BASE + CAN_O_NDAT_21))  == 0x00000001 to judge data reception. I think the significance of these two judgments is the same, but  NewDat is reset by CPU read.In Table 4-2 ECAN DCan registers and bit equivalence, these two marks are not found.  So I would like to ask whether these two data are equivalent except RMP1 is reset user code and NewDat is reset by CPU read. Thank you

  • Tobby,

    Please note that July 5th is US holiday.  You should expect a reply no later than end of day tomm, July 6th.  Appreciate your patience.

    Best,

    Matthew 

  • There is not an exact equivalent to TA bit. However, TxRqst bit can be used to ascertain completion of transmission. From the TRM: 

    After a successful transmission and if no new data was written to the message object (NewDat = '0') since the start of the transmission, the TxRqst bit will be reset. 

    NewDat is not reset by a CPU read. From the TRM:

    The NewDat bit is set to indicate that new data (not yet seen by the CPU) has been received. The CPU should reset the NewDat bit when it reads the message object

  • It is likely you will use interrupts in your application. You could enable the interrupt for transmission completion. In this case, INT0ID or INT1ID bit-field in CAN_INT register will alert you when the transmission is complete. If you are polling, you could poll the bit corresponding to your message object in CAN_TXRQ_21 Register.


  • 0 No transmission has been requested for this message object.
    1 The transmission of this message object is requested and is not yet done.

    If the value of the TxRqst bit is zero, how i  identify this means:1,  a successful transmission,the TxRqst bit be reset.

                                                                                                                    2, No transmission has been requested for this message object.

  • Tobby,

        I wonder if there is some issue on e2e. I just answered your question and closed the post, but received the same question again from you.

  • Thanks for you reply, but i want to know : is poll the bit corresponding to my message object in CAN_TXRQ_21 Register feasible in my project? 

    If no feasible , I will try use interrupts.

  • Yes, it is possible to poll the bit corresponding to your message object in CAN_TXRQ_21 Register to determine completion of transmission. As to whether it is feasible in your project is a question I cannot answer.

  • How to poll?  Could you give some suggestion?

    If the value of the TxRqst bit is zero, how i  identify this means:1,  a successful transmission,the TxRqst bit be reset.

                                                                                                                    2, No transmission has been requested for this message object.

  • How to poll: Please review the C2000ware examples. Below is an example from can_ex4_simple_transmit.c

            //
            // Poll TxOk bit in CAN_ES register to check completion of transmission
            //
            while(((HWREGH(CANA_BASE + CAN_O_ES) & CAN_ES_TXOK)) !=  CAN_ES_TXOK)
    		{
    		}
    

    You initiate the transmission for a message object. If you read the TxRqst bit to be 0 after you have initiated the transmission, that means transmission is complete. You are only going to check this bit for a message object in which you initiated the transmission. Hope it is clear.

  • I get it.

    Thanks for you patience.