How to set 1.5MHz clock for SPI in UNO

I am beginner for arduino. I tried to develop code for SPI. I have struggled to create 1.5MHz clock for SPI. I need to create clock of 1.5MHz, 3MHz and define clock.

Thanks in Advance for your response.

have you checked spisettings?

The AVR-based Arduinos can not generate an arbitrary clock rate for the SPI peripheral; they're limited to the CPU clock divided by a power of 2 (2 to 128, for a maximum speed of 8MHz and minimum of 125kHz.) You could do 1, 2, or 4MHz.

As a synchronous interface, the exact clock rate isn't supposed to matter much.

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