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

nRF5340 SPI frequency setting

Hi, 

I'm working on a code using SPI. 

I've changed the SPI configuration from this thread: https://devzone.nordicsemi.com/f/nordic-q-a/65072/nrf5430-spi-sample-code

I've changed SPI1 to SPI4 (in nrf5340pdk_nrf5340_cpuapp.overlay, prj.conf and main.c).

It's working, but if I want to set frequency higher than 8MHz it won't let me. 

Code builds and is run but the frequency stays on 8MHz (checked with Saleae Logic Pro 8). I'm changing the frequency in this bit of code:

static const struct spi_config spi_cfg = {
.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB |
SPI_MODE_CPOL | SPI_MODE_CPHA,
.frequency = 10000000,
.slave = 0,
};

As far as I know it should let me change it up to 35 MHz. Am I right?

Thanks, 

Marta

Related