cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the baudrate of SPI

hate_pod
Associate
Posted on November 20, 2011 at 01:50

Do I need to disable SPI before changing the SPI baudrate?

Or, would it be enough if I just wait till the end of the communication and then change the baudrate without disable/enable the peripheral?

The spec says ''These bits (Buadrate) should not be changed when communication is ongoing.'' However, it says exactly the same thing for the clock polarity, yet it is not possible to change the polarity without disabling it first.

Does anyone have a relevant experience/idea about this?

1 REPLY 1
Posted on November 20, 2011 at 16:52

You'd want to change it after data has been transmitted, otherwise you're going to slew the clock/data, slave devices may/may-not like this. If you clear the receive register full bit, it will set once the last bit has been transmitted/received. At that point it should be safe to drop the chip select, and change the data rate. You'll need to review the timing parameters for the slave device, and confirm your coding with an oscilloscope.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..