This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI with Softdevice

Good morning.

I ´m working with nrf51-dk, sdk 9.0.0 and softdevice 110.

I have done a proyect without softdevice, only uart and master spi (mode 0) and works perfect.

Here code of the spi_init

void spi_master_inicio(void){
spi_master_config_t configuracion_SPI = SPI_MASTER_INIT_DEFAULT;

    //Configuramos SPI
	configuracion_SPI.SPI_Freq = SPI_FREQUENCY_FREQUENCY_K125;
    configuracion_SPI.SPI_Pin_SCK  = pin_clk;	    //12		
    configuracion_SPI.SPI_Pin_MISO = pin_miso;		//17
    configuracion_SPI.SPI_Pin_MOSI = pin_mosi;		//15
    configuracion_SPI.SPI_Pin_SS   = pin_ss;	    //20 

	//modo 0
	configuracion_SPI.SPI_CONFIG_CPOL = SPI_CONFIG_CPOL_ActiveHigh;			// 0
    configuracion_SPI.SPI_CONFIG_CPHA = SPI_CONFIG_CPHA_Leading;			// 0
	
	configuracion_SPI.SPI_CONFIG_ORDER = SPI_CONFIG_ORDER_MsbFirst;

    //Inicializa la comunicacion SPI
    uint32_t err_code = spi_master_open(SPI_MASTER_0, &configuracion_SPI);
    if (err_code != NRF_SUCCESS){
		printf("Error al abrir la conexion \n\r");
    }

    //Registramos el controlador de eventos relacionado con la comunicacion SPI
    spi_master_evt_handler_reg(SPI_MASTER_0, controlador_evento_SPI);
}

The problem is when I add the spi to a BLE proyect, with pins (12, 17, 15, 20) doesn´t work but if I change pins to (1, 3, 5, 6) works, but i can´t use this pins because I use the analog pins to the accelerometer.

I read this, this and lf similar posts in forum, but i don´t understand why with ones pins works and with others no. My question is if softdevice has some pins blocks, i read "S110 SoftDevice Specification v2.0" and says that application has full access.

Thank you.

Related