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

SPI master 0 uses 300uA upon first transfer

My SPIM0 starts to use 300uA upon first usage of nrf_drv_spi_transfer. Why? Even when the transfer finishes and I uninitialize SPI or turn the MOSI, MISO and CLK pins to the "default" GPIO config, nRF52832 will still permanently use 300uA. Only in SYSTEM_OFF_MODE do I see usage of about 13uA.  

    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_config.ss_pin   = SPIM0_SS_PIN;
    spi_config.miso_pin = SPIM0_MISO_PIN;
    spi_config.mosi_pin = SPIM0_MOSI_PIN;
    spi_config.sck_pin  = SPIM0_SCK_PIN;
    spi_config.frequency = SPI_FREQUENCY_FREQUENCY_M1;
    APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, NULL, NULL));

    ret_code_t err = nrf_drv_spi_transfer(&spi, transfer.tx_data, transfer.tx_size, transfer.rx_data, transfer.rx_size);
    APP_ERROR_CHECK(err);
            

Hardware: Rigado BMD-300 Eval board, nRF52832 

Parents Reply
  • Actually, this did not completely solve the issue. I still get a average power usage of 113uA that goes away if I never use the SPI. 

    Using SPI with the "power cycle" workaround 

    Not using the SPI at all: 

     '

    I even tried pasting in all the "power cycle" workarounds simultaneously, but it did not fix the phantom 130uA power usage. 

    spi_master_uninit();
    *(volatile uint32_t *)0x40003FFC = 0;
    *(volatile uint32_t *)0x40003FFC;
    *(volatile uint32_t *)0x40003FFC = 1;
    
    *(volatile uint32_t *)0x40004FFC = 0;
    *(volatile uint32_t *)0x40004FFC;
    *(volatile uint32_t *)0x40004FFC = 1;
    
    *(volatile uint32_t *)0x40023FFC = 0;
    *(volatile uint32_t *)0x40023FFC;
    *(volatile uint32_t *)0x40023FFC = 1;
    

Children
Related