Hi Nordic Team,
I am using the nRF52840 for a project, and I am interfacing with an LCD using the SPIM3 peripheral. I know there have been past posts on the Devzone which say that it is not recommended to use any other frequency for the SPI peripheral besides the ones provided (such as SPIM_FREQUENCY_FREQUENCY_M16), so I was wondering if there was any way to source the SPI peripheral from an external clock source instead? My LCD can use a 15MHz max clock, and I would prefer to run the LCD off 15MHz if possible for better performance, but the 16MHz frequency option is too fast and the 8MHz is too slow. If not, is my only option to use either 8MHz or 16MHz, or would there be any other way to adjust the clock speed closer to 15MHz?
We have not tested anything other than the frequencies specified in the documentation for the FREQUENCY register. The supported frequencies can be exactly generated from the HF clock, so that you will have a stable clock signal with 50 % duty cycle.
You can try to tweak the FREQUENCY register, but as you can see by checking the CLK signal on a logic analyzer it will not be very clean. It might not be OK for the internal timing of your slave device, and it might not be OK for the nRF SPIM peripheral itself. Moreover, even if it does work it might be that it is only just, so that it might fail in some occasions on some devices.
Thanks for the quick reply. Do you have more information on how I can tweak the frequency register? I tried several various settings for the frequency register, but when it wasn't recognized as one of the preset frequencies, it seemed to always default to 32MHz. Thanks!
Yes, you are right. I was not aware, but this does not work with the higher clock frequencies supported by SPIM3. Then you are unfortunately stuck with either 8 MHz or 16 MHz.
Great, thanks for the quick responses and help!