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.

TCAN4550: How to use RX FIFO0 and RX FIFO1 together to receive the CAN data.

Part Number: TCAN4550

Hi,

I am using TCAN4550 to receive and transmit the CAN data.by default it is using RX FIFO0 only to stanks ore the received CAN messages.when i receive the CAN messages at 1ms frequency there is huge data loss.hence i want to use RX FIFO1 also along with RX FIFO0. How can i use both FIFO's simultaneously?what are the required configurations fr that?Please guide me.

Thanks in Advance,

Bipin

  • Hi Bipin,

    You can do this by filtering the received messages into the two different RX FIFOs. You will need to decide how you want to separate the messages, but an example would be to setup a range filter to direct message ID’s that are within the range to RX FIFO 0, and messages that are outside the range to RX FIFO 1.

    In your configuration, you will need to allocate space in the Memory RAM (MRAM) space for both the RX FIFO 0 and RX FIFO 1 message elements. Configuring space for the RX FIFO 1 is the same as it is for RX FIFO 0 which you are already familiar with.

    You will also need to allocate space to hold the Message ID filter Elements that you will use to filter messages into the two different RX FIFOs. Then place your Standard and/or Extended Message ID Filter Elements into the memory. The Standard ID Filter Configuration (SIDFC) and Extended ID Filter Configuration (XIDFC) registers 0x1084 and 0x1088 should be configured with the MRAM allocation for the size, type, number of filter elements, and the start address of the filter elements you have created.

    When a new message is received, the device will first compare the message ID against the filters you have created. When it finds a matching filter, it will store the message according to the filter. If it doesn’t find a filter that matches the ID, then it will use the instructions setup in the Global Filter Configuration (GFC) register 0x1080 to either accept or reject the message.

    I would refer you to the TCAN45xx Software User’s Guide and also the M_CAN User’s Manual written by Bosch for the CAN FD Controller IP that is integrated into the TCAN4550 for additional information and examples of how to configure the RX FIFOs, MRAM, and the MRAM Filter Elements.

    Regards,

    Jonathan

  • Hi Jonathan,

    Thanks for the quick response.

    I understood the filtering now.but my main problem is whenever i am receiving CAN message at 1ms frequency,there is huge data loss(if i am sending 20000 messages from simulator,i am receiving only 300-400 messages) .how can i solve this issue?is TCAN4550 capable of receiving CAN message at 1ms frequency?if so how can i avoid data loss?Please guide.

    Thanks in advance,

    Bipin

  • Hi Bipin,

    The TCAN4550 can receive the messages, but the question appears to be in how fast can the MCU read and clear the message out of the MRAM through the SPI interface.  If you are going to require a very high message count with a very small message interval you will need to optimize this process in your MCU as much as possible because the SPI bus will ultimately dictate the maximum message count and frequency that can be supported.

    You will need to use the fastest SPI frequency that you can support.  The TCAN4550 Maximum frequency is 18Mbps, and your MCU may or may not be able to support this.  But the faster you can make the SPI rate, the less time the transaction will take to read a message.

    You will also want to use burst or block reads as much as possible to reduce the overhead of sending the start address of the memory location to read.  The TCAN4550 supports multi-word reads, and since the FIFOs are stored in a consecutive block of memory (except where it wraps around to the beginning again) it is possible to read multiple messages out of memory with a single SPI address location.  Reducing the number of address writes will maximize the time for the data and allow a higher message count and frequency.

    Finally, you will want to ensure that there is as little overhead in the MCU between receiving the new message notifications and reading/clearing the message.  A slow main loop or other processes running in the MCU can delay the messages being read and cleared that can lead to the FIFOs being overrun.

    While the SPI interface is a unique and nice feature to the TCAN4550, it is also a limiting factor in the maximum message count and frequency that can be supported.  Once you have optimized the MCU procedures and SPI interface, that maximum supported message count and frequency can be determined.

    Regards,

    Jonathan