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

SPI current workaround works only once

Dear All

We have implemented the the workaround because of the anomaly 195 for spim3 and it works as expected, but only once! After the following init

nrfx_spim_config_t spiM_config = NRFX_SPIM_DEFAULT_CONFIG;
spiM_config.frequency      = NRF_SPIM_FREQ_4M;
spiM_config.ss_pin         = EPD_SS_PIN;
//spiM_config.miso_pin       = EPD_MISO_PIN;
spiM_config.mosi_pin       = EPD_MOSI_PIN;
spiM_config.sck_pin        = EPD_SCK_PIN;
spiM_config.dcx_pin        = EPD_DC_PIN;
spiM_config.use_hw_ss      = true;
spiM_config.ss_active_high = false;

spiM_config.irq_priority = 6;//   APP_IRQ_PRIORITY_LOW;
spiM_config.mode         = NRF_SPIM_MODE_0;

APP_ERROR_CHECK(nrfx_spim_init(&spiM, &spiM_config, spiM_event_handler, NULL));

we can use spi communication and then utilize the following in order to uninitialize

nrfx_spim_uninit(&spiM);

*(volatile uint32_t *)0x4002F004 = 0;
*(volatile uint32_t *)0x4002F004 = 1;


nrf_gpio_cfg_default(EPD_SS_PIN);
nrf_gpio_cfg_default(EPD_MOSI_PIN);
nrf_gpio_cfg_default(EPD_SCK_PIN);
nrf_gpio_cfg_default(EPD_DC_PIN);
nrf_gpio_cfg_default(EPD_RST_PIN);
nrf_gpio_cfg_default(EPD_BSY_PIN);

In this case, the power consumption is minimal, as expected. Then we init the spi again and use it once more (for a communication with a screen), exactly in the same manner as before. But this time uninitializing, workaround, making the pins high impedance configuration (as written above) fails to result in the low power consumption (approximately 1mA is the current in the idle state, most likely the anomaly 195 is the problem).

Any ideas, what can be the reason for this behavior?

We have tried several combinations: with/without workaround, not using uninit and so on. We could not find a stable solution. The same is on the custom pcb (NRF840 Q1AAC0) as well as on the devkit.

Related