Give that the Photon’s system clock (120 MHz) is almost twice as fast as the Core’s clock (72 MHz), do we need to adjust the SPI_CLOCK_DIV on the libraries that we port from the Core to the Photon?
STs documents are pretty clear on the clock structure. I don’t have the data sheets in front of me but if you look at both it should be clear if they need to be divided down differently.
There’s part of me that wants an API in the SPI class that allows you to specify the desired clock frequency rather than the clock divider. This will make it more portable between devices.
e.g.
SPI.setClockFrequency(24*MHz);
The API would choose the clock divider that results in the highest frequency not higher than the frequency specified.
Thanks guys. So the answer to my question is, yes - you need to replace the DIV4 for a DIV8 to have a similar clock frequency. Right?
@mdma, you would definitely have my vote on the frequency specific API. This is going to be even more useful when the Electron (and future processors) is/are launch.