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.

CCS/TMS320F28075: ecan receive doesn't work in 28075

Part Number: TMS320F28075
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hello,

I am trying to communicate with PC using ecan module in 28075 and I use the 'can_external_transmit' example code for test. I changed the programme a little bit(set the CANTXD and CANRXD pin to GPIO 18 19 respectively and modify the relative interrupt setup to CANAINT0). My problem is:

For reception:When I transmit a frame from PC to the MCU through the transceiver, the interrupt can be successfully triggered, however, the INT0ID in CAN_INT register is always 0x8000 which should be somthing like 0x0001 or sth instead. So in ISR, no data is receiced even if my PC tells me a frame has been successfully sent.

Another stranger thing is : if I comment out this line 'CANMessageSet(CANA_BASE, RX_MSG_OBJ_ID, &sRXCANMessage,MSG_OBJ_TYPE_RX)', interrupt still works.Part of the programmed is attached below:

I am pretty sure the transceiver works because the transmit process from PC to MCU is ok.

I also tried the loop back example, which seems good.

I am very glad if someome can help me out.

thanks

  • ADD: the RXOK is set in CAN_ES register, normally, a pending interrupt will be triggered after the programme first exits the ISR, but nothing happens. 

  • Are you able to successfully transmit from the MCU to the PC? This would indicate that the H/W is OK. 

    There is the following comment in can_ex3_external_transmit.c. This is what you are seeing:

     

       // If the cause is a controller status interrupt, then get the status.
    
       // During first iteration of every ISR execution, status = 0x8000,
    
       // which simply means CAN_ES != 0x07.

     

    Did you review the debug tips in my app.report SPRACE5 (https://www.ti.com/lit/an/sprace5/sprace5.pdf)? 

    It appears you tried to embed images in the post. They did not come through. 

    On a different note, the CAN module on this device is the DCAN module, not eCAN.

  • Thanks for your reply.

    It seems that the transmitting process works perfectly (rules out the HW problem) While as you say, when receiving, if it works , the Can _INT register may be 0x8000 first and then turn to the number of mailbox after finishing the first  ISR iteration. But my case is: CAN_INT is 0 and NewDat bit  is never set.

    It is also weird that I set a breakpoint on the first line of my ISR code and every time an interrupt is triggered, RxOk is 1. Clearly something is received, but how to get that message? Also note that your ‘loopback interrupt ‘ program works . So where do you think maybe wrong?

    Sure I follow your tips in the file, still things is not good

  • RXOK will be set if a frame is successfully acknowledged by the node, even if it was not actually received. 

    ISR will be executed twice for every frame received, first time for the status change and the second time for the MBX interrupt. 

    Can_ex3_external_tranmsit clearly shows how to handle the receive interrupt. Please compare your ISR with this code and see where the differences are. This is a tested code.

  • Thanks but could you send me a link of this test code?

  • By the way, I wonder what may cause a success acknowledgment while a failure in reception? Does it mean that the MCU doesn’t even store the data?

  • Thanks but could you send me a link of this test code?

    It is part of C2000ware that you can download from the TI website. This is clearly mentioned in the first page of my app.report: "The project files and examples described in this document are available for download as part of C2000Ware."

     

    By the way, I wonder what may cause a success acknowledgment while a failure in reception? Does it mean that the MCU doesn’t even store the data?

    It is not a "failure in reception". Please read section 3.1 of my app.note carefully. MCU will store data if the frame is received.

  • Thanks for you explanation!

    I think my problem is caused by the Mask bit and the disagreement with the frame ID:

    My assumption is : if we don't use acceptance filtering for mailbox(disable Umask bit in MCtrl register), we still need to transmit a frame with the same ID from another node to get received.

  • My assumption is : if we don't use acceptance filtering for mailbox(disable Umask bit in MCtrl register), we still need to transmit a frame with the same ID from another node to get received.

    Correct. If acceptance filtering is not used, the transmitted MSGID must match bit-for-bit with the MSGID of the mailbox configured for reception. That is, the frame IDs must match exactly.