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

nRF52840 SPI question

Hi,

Can someone help me with question on SPI?

What is the difference between SPIM and SPI? They seem to have different clocks Also in the SPIM section, the frequency is said to be 32MHz in a number of places but then in one table again it is listed as 8Mbps. (which might be a typo) what do you make of this?

image description

image description

Parents
  • SPIM is where the MCU is the SPI Master (this is what you'd use to connect to a SPI peripheral e.g. a sensor.

    Re: SPI Frequency

    Normally you configure the frequency as part of the SPI driver initialisation

    e.g.

    	uint8_t error;
    
    	nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;	
    
    
    	spi_config.frequency    = NRF_DRV_SPI_FREQ_8M;   
    	spi_config.ss_pin   = 4;
    	spi_config.sck_pin  = 5;
    	spi_config.miso_pin = 6;
    	spi_config.mosi_pin = 7;
    
    
    	error = nrf_drv_spi_init(&spiBMP280, &spi_config, NULL);
    
Reply
  • SPIM is where the MCU is the SPI Master (this is what you'd use to connect to a SPI peripheral e.g. a sensor.

    Re: SPI Frequency

    Normally you configure the frequency as part of the SPI driver initialisation

    e.g.

    	uint8_t error;
    
    	nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;	
    
    
    	spi_config.frequency    = NRF_DRV_SPI_FREQ_8M;   
    	spi_config.ss_pin   = 4;
    	spi_config.sck_pin  = 5;
    	spi_config.miso_pin = 6;
    	spi_config.mosi_pin = 7;
    
    
    	error = nrf_drv_spi_init(&spiBMP280, &spi_config, NULL);
    
Children
Related