This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[Bug Report] SPI frequency not more then 8 MHz

I have used NRF52840 and SDK 13.0.0. Module SPIM.

Nrf driver does not support frequency more then 8 MHz(enum does not have constants for 16MHz and for 32MHz). But I have found constants for mode 16MHz/32MHz in datasheet.

I try modify just write to Frequency register. It works for all frequencys excepts 16MHz/32MHz mode.

Hardware module generate for 16MHz clock 625KHz. Just calculate:

(constants for 16 MHz)0x0A000000 = 0x02000000 + 0x08000000      ->      625KHz = 125KHz + 500KHz

image description

I try modify this line(nrf_spim.h):

__STATIC_INLINE void nrf_spim_frequency_set(NRF_SPIM_Type * p_reg,
                                        nrf_spim_frequency_t frequency)

{p_reg->FREQUENCY = frequency;}
Related