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

SPIM over consumption problem ~400-500uA

Hello, I found that after using SPIM I have forever additional over consumption (additional 400-500uA). It was solved here in forum

And there is errata 89

[edit] I thought I was not using GPIOTE but I was using GPIOTE through another SPI workaround for clocking extra byte out.

But part of my questions are still valid:

Can you also add into errata that it also affect SPI block (because it is written that it affect TWI block)?

Also can you add to errata that you need to reinicialize SPI? For my case correct workaround seems to be:

void twi_spi_over_consumption_workaround(){
    nrf_drv_spi_uninit(&g_spi);
    *(volatile uint32_t *)0x40003FFC = 0;
    *(volatile uint32_t *)0x40003FFC = 0;
    *(volatile uint32_t *)0x40003FFC = 1;
    // SPI reconfiguration
    APP_ERROR_CHECK(nrf_drv_spi_init(&g_spi, &g_spi_config, spi_event_handler));
}
Parents
  • I have to do it before another transaction. But this is the best place to do it. Normally it there was not the bug I do init only once at the beginning of code. Since I need to do workaround I need to reinit again - so it is best to do it right after SPI power reset. Also I need to do uninit otherwise init would fail. Also note that this reset and reinit is not necessary when sending/receiving more bytes (and not using GPIOTE). In multiple bytes sending I do not do deinit,reset nor init.

Reply
  • I have to do it before another transaction. But this is the best place to do it. Normally it there was not the bug I do init only once at the beginning of code. Since I need to do workaround I need to reinit again - so it is best to do it right after SPI power reset. Also I need to do uninit otherwise init would fail. Also note that this reset and reinit is not necessary when sending/receiving more bytes (and not using GPIOTE). In multiple bytes sending I do not do deinit,reset nor init.

Children
No Data
Related