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.

eCAN question

Other Parts Discussed in Thread: TMS320F28335

hello, everybody!

i have a strange question. for example, i use ecan mailbox to receive message, and this mailbox can be overwritten by new message.

the question occurs: i am reading this mailbox, and a new message comes for this mailbox. does the mailbox will be overwrittened though i am reading the mailbox message?

thanks a lot.

  • there are no one to answer this question. hoho.

     

  • Well, you're talking about something that is possible, but very unlikely, as reading the mailbox could take as little as a few CPU cycles, which is at least 20x faster that the fastest bit time for the CAN bus (1us).

    I think the answer depends on how your code is written. If the RMP bit for that mailbox is set and OPC is set, the mailbox will not accept a new message. Your program is in charge of clearing RMP. So... Yes, the new message would be lost, if we assume you clear RMP after you read the mailbox.

     

  • yes, it depends my code written. in my code, i set CANOPC = 0, thus the mailbox can be written now.

    so, if i reading the mailbox, and new message comes for this mailbox.

    in this extreme situation, whether i will get wrong data ? i guess the data may be corrupted in this situation.

    Thanks. 

  • Hi,

       I try eCAN bus Mailboxes transmit and Receive on eZdsp  TMS320F28335 . I configure eCANa for transmit and eCANb for Receive on F28335 .

       Then I use i-7565 to monitor CAN bus , It can get my transmit packet for eCANa . But  the eCANb can't get data to MailBox , It halt on ECanbShadow.CANRMP.bit.RMP3 == 0.

       I don't known can  the F8335 configure eCANa as transmit and eCANb as receive  worked together ??? 

      Could you give me some information ???

    Regards,

    Jimmy

  • Answering to your question.

    While you are redaing the mailbox and a new message comes for this mailbox, then the mail boax will be overwritten by the new message and your read will be corrupted if the CANOPC bit for that mailboax is set to '0'. If you want to get protected your message from overwritten the set the bit in CANOPC register for that mailbox.

  • also TI recomamnds (as per user guide) ro clear the RMP bit before reading the mailbox which I think is not a good idea and the RMP bit should be clear after the mainbox is completely read so at that time you can receive a new message into that mailbox. I am watining conformation from TI on my proposal.

  • Thanks, Yes, I think so. It isn't so easy to do that eCANa transmit data to eCANb . If we used CAN bus monitor to transmit data to DSP CAN bus reciver ,it is easier .

    Regards,

    Jimmy