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.

RTOS/TCAN4550: SAE1939 & DMA

Part Number: TCAN4550

Tool/software: TI-RTOS

Hi,

We're implementing TCAN4550 to our new measuring device to, at this moment, just to receive traditional 8byte payload SAE1939 or equal messages. It would be optimal for us to fetch all message related data, header payload etc, with a single SPI-DMA sequence. After a brief study of the data sheet and example code downloaded from TI, I wonder if that "single DMA" is possible?  Was FIFO in use or buffer, you seem to read RXF0S or RXBC first in ReadNextFIFO() and ReadRXBuffer() and then header and data. So are messages in both cases stored into FIFO, which actually looks like a 'circular buffer' to me and thus code needs to fetch the address of 'TAIL' to read the message, while new messages are stored to 'HEAD'?

Best Regards,

risto

  • Hello Risto,

    Thank you for your inquiry.

    I've conferred with the digital designer on our TCAN4550-Q1 device. You should be able to read both header and payload information for a single or multiple received messages with one SPI transaction. However, there is a caveat. Currently the register space does not support automatic wraparound function in the FIFOs. Therefore, if you would like to read multiple messages at once, and their address location pointers wraparound from end to beginning of the register space that you configured for the FIFO, then you will need to send two SPI transactions to read all of the desired data (one transaction for the addresses at the end of the FIFO space, and one transaction for the messages that have wrapped around to the beginning of the FIFO space).

    Does that make sense? Jonathan Valdez, the systems engineer who wrote the example code that you are following, is out of office today. I will run this question by him next week in order to confirm the above information. Since Monday is a US holiday, please expect further feedback from me on Tuesday morning.

    Best Regards,
    Max Megee
    TI Transceiver Interface
  • Hello Max,

    Thank you for your answer.

    While waiting for Jonathan's comment we prepare to initialize a SYS/BIOS thread in our firmware for CAN- use only. Our current 'main thread' is dedicated to main sampling/measuring/analysis -purposes and we do not want to risk that CAN- operations could slow/block it. My current understanding is that in the code for TCAN4550  we need to do a number of register and data reads/writes  to fetch a CAN- message. Studying example code more together with your comment about 'wrapping around' did strengthen my feeling that my original idea of single-DMA-only-read was dreaming.

    Best Regards,

    risto