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

is spi in nrf52832 consume large current ?

i measured the current of nrf52 dk board with the spi example (examples\peripheral\spi\pca10040). the result shows that it consumed about 6 mA !!! i read the nrf52 datasheet, spi consumes up to 50 uA. below is the example code, int main(void) { LEDS_CONFIGURE(BSP_LED_0_MASK); LEDS_OFF(BSP_LED_0_MASK);

APP_ERROR_CHECK(NRF_LOG_INIT(NULL));

NRF_LOG_INFO("SPI example\r\n");

nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
spi_config.ss_pin   = SPI_SS_PIN;
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, spi_event_handler));

while (1)
{
    // Reset rx buffer and transfer done flag
    memset(m_rx_buf, 0, m_length);
    spi_xfer_done = false;

    APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length));

    while (!spi_xfer_done)
    {
        __WFE();
    }

    NRF_LOG_FLUSH();

    LEDS_INVERT(BSP_LED_0_MASK);
    nrf_delay_ms(200);
}

}

how to save the power ? could anyone give link to figure it out?

Related