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.

Is it possible to reset the SPIDAT register?

Hi everyone,

I have a program running on an F28035, acting as an SPI slave (the word length is 16 bits).

I would like to erase the SPIDAT register every time the chipselect signal goes high. I thought it could be done automatically but it doesn't seem to be the case.

I would like to manually "erase" the SPIDAT at some point, i.e to discard any incomplete word received. How should I proceed?

  • Could it work using the SPICCR[SPISWRESET] bit?
  • What about switching off the SPI clock by clearing the PCLKCR0[SPIAENCLX] bit?
  • What is the effect of writing a new value to SPIDAT when in slave mode?

--

Best regards,

Pierre

  • Hi Pierre,

    I would like to manually "erase" the SPIDAT at some point, i.e to discard any incomplete word received. How should I proceed?

    I guess this can shed some light here:

    In short, what I mean to say is try fiddling with the SPIDAT register.

    Could it work using the SPICCR[SPISWRESET] bit?

    So, only the flags would be reset but the data would be unchanged as mentioned!

    What about switching off the SPI clock by clearing the PCLKCR0[SPIAENCLX] bit?

    Sorry, no idea! Do check and let me know.

    What is the effect of writing a new value to SPIDAT when in slave mode?

    The most important thing one should remember while editing the SPIDAT value is to set/clear the flags (whichever applicable) such that when a Tx/Rx interrupt occurs the SPIDAT is updatable.

    Regards,

    Gautam