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.

Setting up CAN interrupt on TMDXRM48HDK

Other Parts Discussed in Thread: HALCOGEN

Hi!

I want to know how to work with the CAN module (i.e. reading both address of the received message as well as the data) of the subject processor when the number of messages to be received are more than 64 i..e the number of message boxes.

In particular I am interested in doing the following:

1. Mask one message box in a way that all the CAN messages are received in the same box. 

2. Write an interrupt routine such that whenever a CAN message arrives on the bus the address of the message as well as the data is stored in memory using global variables for later use.

I have successfully setup the CAN network as per instruction in the application notes. All works well until the number of messages do not exceed 64 where the message addresses are specified in HalCogen. The messages are received using canGetData etc.

Best Regards

/Tahir

  • Hi Tahir,

    I missed this post due to some message filtering set on my email. I will look into this and get back to you tomorrow.

    Regards, Sunil

  • The issue is still not resolved yet.

     

  • Tahir,

    There are 64 mailboxes on each CAN controller node on this MCU. When a message In order to allow the node to receive more than 64 messages, you will need to allow an unread mailbox to be overwritten with new messages coming in. This can be done by setting the EoB bit in the receive message object where you want to receive the messages.

    You can also create a FIFO of messages that match a desired msg id and mask. This is described in the TRM starting from page 986, section 27.7.5 "Configuration of a FIFO Buffer".

    Regards, Sunil

  • I did not understand your instruction. However, I found another thread here which was helpful to some extent.

    I used the modified canGetData within  can1HighLevelInterrupt routing generated automatically by Halcogen. 

    Now I want to know if there exist any possibility of losing messages using the method I am following i.e. during the time interrupt routine is running. 

    In addition, I would also like to get an example of the usage of FIFO buffer. 

    Best Regards

    Tahir

    PS: The page and section number for "configuration of a FIFO Buffer" are 985 and 23.7.5 respectively. 

  • Tahir,

    I checked and didn't find that we have any examples posted where it's ready to try out the FIFO mode.   I think you'd need to start with one of the basic examples and configure the adjacent mailboxes like the documentation shows.