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.

Timestamping of SPI Slave Receive on TMS570

Hi

I need to accurately timestamp the time of receipt of an SPI message on the slave.

My thought is to use DMA to transfer the system clock to some RAM location for future interrogation. This DMA transfer would occur on either SPI slave chip select or end of receive (transfer group complete).

Is this possible? I have not been able to discover how to do this from either TRM or datasheet.

If not possible directly, I think I could also feed the SPI slave chip select into one of the interrupt capable GIO pins; however, these don't seem to have DMA capability.

Can anybody please advise of a technique I might use.

As an aside, datasheet 'SPNS141B-JUNE 2010' refers to SPI pins as MIBSPI1[0]MIBSPI1[1] etc in Table 4-3 (DMA Request Line Connection). What does this convention actually mean, how does it relate to the SPI pins themselves (CS, CLK, MISO, MOSI etc)?

Regards, Tony.

  • Hello Tony,

    have you looked at the time stamping functionality of the RTI module (spnu489 in section 21.2.1.2)? There are two connections from the VIM module (spnu489 in section 24.6) which let you capture the current counter values on a specific interrupt occurence. You could configure the transfer group complete interrupt in the MIBSPI to one interrupt level while the other interrupts (if enable) are going to the other interrupt level. This would avoid that you are getting time stamps on the other interrupts.

    The only question is if you want to read the time stamp information with the CPU or if this should be also transferred to the RAM with the DMA. You could set up a DMA request at the TG complete condition and instead of transmitting the data from the MIBSPI buffer it would just transfer the RTI capture value to the RAM.

    Regarding the MIBSPI1[x] definition in the datasheet, this basically shows the MIBSPI DMA request hooked up to the DMA controller. The MIBSPI can generate up to 16 different requests to the DMA and the x shows which request line it is.

    Regards,

    Frank

  • Hi Frank,

    I hadn't thought of using this functionality, it does sound like a useful option. I didn't understand your comment in the second paragraph refering to 'reading the timestamp information with the CPU'. Don't I naturally want to read the value with the CPU? What else would I do with it! Do you mean that I might want to store it to RAM just to have it available after being overwritten on the next interrupt timestamp?

    Thanks also for your information regarding the datasheet terminology, obvious once pointed out (a muppet moment from me I think)!

    Regards, Tony.

  • Hello Tony,

    regarding the CPU read, I was just referring to your comment that you wanted to transfer that time stamp information with the DMA to RAM for some later interrogation. You can do it either way, but in most cases the user will read it from the RTI with the CPU.

    Please let me know if you have any more questions.

    Regards

    Frank

  • Thanks Frank, this is just what I needed. Regards, Tony.