Hi Pierre,
[quote]I would like to manually "erase" the SPIDAT at some point, i.e to discard any incomplete word received. How should I proceed?[/quote]
I guess this can shed some light here:
In short, what I mean to say is try fiddling with the SPIDAT register.
[quote]Could it work using the SPICCR[SPISWRESET] bit?[/quote]
So, only the flags would be reset but the data would be unchanged as mentioned!
[quote]What about switching off the SPI clock by clearing the PCLKCR0[SPIAENCLX] bit?[/quote]
Sorry, no idea! Do check and let me know.
[quote]What is the effect of writing a new value to SPIDAT when in slave mode?[/quote]
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