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

SPI serial flash memory not working on digital pins

Hi,

I am using w25q16 serial flash spi memory with nrf52832. 

the flash memory is working fine with all analog input pins(2,3,4,5,28,29,30,31).

but due to the hardware designing point of view, I want to shift my ss, CLK, miso, and mosi pin to  5,6,7,8 respectively.

i checked that spi memory is not working on any digital pins. do digital pins support spi functions?

void spi_config(void)
{
    
    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
		spi_config.mode 	   =  NRF_DRV_SPI_MODE_0;  //NRF_DRV_SPI_MODE_0 NRF_DRV_SPI_MODE_3
		spi_config.bit_order =  NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;  //NRF_DRV_SPI_BIT_ORDER_MSB_FIRST
		spi_config.frequency =  NRF_DRV_SPI_FREQ_8M;
    spi_config.ss_pin    =  NRF_DRV_SPI_PIN_NOT_USED;
    spi_config.miso_pin  =  SPI_MISO_PIN;
    spi_config.mosi_pin  =  SPI_MOSI_PIN;
    spi_config.sck_pin   =  SPI_SCK_PIN;
		
    APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, NULL, NULL));

    //NRF_LOG_INFO("SPI example started."); 
    nrf_gpio_cfg_output(SPI_SS_PIN);
    nrf_gpio_pin_set(SPI_SS_PIN);
    
}

Parents Reply Children
No Data
Related