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.

How to trigger spi interrupt

I am setting the spi in slave mode with F28027. F28027 is connected to a SPI converter which is attached to PC with USB. The SPI converter is set in master mode. My purpose is to fetch result from F28027 when needed. Could you tell me a way how to trigger the spi interrupt in which the data can be sent out?

  • Hi,

    I am not sure if I got your question right. Are you asking how to configure SPI interrupt on data receive on the slave side?

    Regards,

    Veena

  • Hi Veena,

    Thank you for your reply. I am not asking for how to configure SPI interrupt.

    My MCU is connected to a SPI converter, and the SPI is also connected to computer's USB port. I use F28027 to sample a signal, perform some computation and store the result into a variable. the SPI on F28027 is set in slave mode, and the SPI converter is set in master mode. I need output the computation result only when the SPI converter has request. In this case, the F28027 won't receive any data from master side. My question is how to detect the request from master side and send out the result immediately.

    Looking forward to your reply. Thank you too much.

    regards,

    Hongtao 

  • Hi Hongtao,

    How I have seen in other SPI devices is, the master sends out a command to the slave (at this point slave does not send any data). Master then sends a dummy data to enable slave send back the data requested for.

    This needs 2 SPI transactions - one for requesting the data and the other for receiving the data.

    Are you actually looking for having the data available in the initial SPI transfer itself? In that case, you could use some GPIO pins to trigger an interrupt to slave before sending the request via SPI. Slave, on receiving the GPIO interrupt, can compute the data required and be ready for the SPI transfer.

    Regards,

    Veena