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

SPI master 0 uses 100uA after first transfer even after workaround

This is a duplicate of https://devzone.nordicsemi.com/f/nordic-q-a/35127/spi-master-0-uses-300ua-upon-first-transfer but I wanted to be safe because I pre-maturely verified the other answer. 

The errata gives a workaround that reduces the current usage from 406uA to about 144uA, but if I don't use the SPI at all, the current usage is 23uA average in SYSTEM_ON mode. 

 Why am I still getting 144uA usage? 

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);
        
nrf_drv_spi_uninit(&spi);
*(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;

Using SPI with the "power cycle" workaround. 164uA+ power usage

Not using the SPI at all. 25uA+ power usage.

Parents Reply Children
Related