Can't slow down SPI clock speed

I am trying to slow the SPI clock speed way down. It seems like nothing I try changes the clock speed on my scope. This should result in a much slower than measured speed of 10 MHz.

SPI.beginTransaction(SPISettings(125000, MSBFIRST, SPI_MODE0));
SPI.setClockDivider(128);

Is SPI speed locked on these devices because of the WIFI communications?

I think you're using this incorrectly. As described here, try

SPI.setClockDivider(SPI_CLOCK_DIV128);

Note that from here, we have

#define SPI_CLOCK_DIV128 0x03

Thanks for the response. I was using this #define earlier. I guess with all of my trying of different things I left the wrong value in there. I will go back to this and test again.

Using:

SPI.beginTransaction(SPISettings(125000, MSBFIRST, SPI_MODE0));
SPI.setClockDivider(SPI_CLOCK_DIV128);

My measured SPI clock pulse width is about 100 ns. I am assuming a higher clock divider should result in slower clock. I have also tried different max speed settings from 10MHz down to 125 KHz. Again, nothing seems to change the SPI clock speed.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.