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.

TCAN4551-Q1: TCAN4551-Q1

Part Number: TCAN4551-Q1

Tool/software:

Hello Team,

We are working with the TCAN4551 chip. For this we have integrated example code which we have downloaded from Git hub("github.com/.../mbed-tcan455x"). We are able to receive CAN msg on interrupt and transmit CAN message.

Now, we are trying the Water mark use case. For this we have enabled "mcan_ie.RF0WE = 1;" and  given 32 value to "MRAMConfiguration.Rx0NumElements". After doing this configuration, we are not getting watermark interrupt(we have sent multiple CAN message until watermark is reached).

Could you please let us know if this is correct method for water mark usage? Kindly guide us for same.

Thank you for your help.

  • Hi Amit,

    I assume that the MRAMConfiguration.Rx0NumElements in the code you are using is setting the Rx FIFO 0 Size to 32 elements in the F0S field of register h10A0.  You will also need to set the Watermark Level in the F0WM field of this register.  By default the watermark level is set to zero which disables the interrupt even if the bit has been enabled in the Interrupt register.

    If you have not done so already, please review the following documents for more information on how to configure and use the TCAN4551.

    TCAN45xx Software User's Guide (Link)

    M_CAN User's Manual (Link)

    Regards,

    Jonathan

  • Hi Jonathan,

    We are able to get watermark interrupt now we want to read RX FIFO 0 on receiving interrupt. could you please help us how to read RX FIFO 0 ?

  • Hi Amit,

    I would recommend reviewing Section 3.4.2 of the M_CAN User's Manual (Link).

    Generally you will need to read the RX FIFO 0 Status register (0x10A4) to get the Fill Level (which is the number of new elements in the FIFO) and the Get Index (which is the index number of the first or oldest message in the FIFO).

    You will then want to calculate the MRAM address for the buffer corresponding to the Get Index number so that you can read the message from memory.

    If there are more than one message in the FIFO, you can read them all before acknowledging, or just one at a time if you would like. 

    Once you have finished reading the messages from the memory, you will need to Acknowledge the message buffers have been read so that the device can free them up for new messages.  This is done by writing the Index number of the last read message to the RX FIFO 0 Acknowledge register (0x10A8). 

    With the FIFO, you must always read them out in the order they were received so that the Get and Put index values can be maintained properly. 

    Regards,

    Jonathan