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

About implementing Errata 89

Hello,

I am using the SPIM module to communicate the NRF52832 with a sensor, every time it generates an interrupt - which is generated with a frequency of 25Hz. For the interruption I am using the GPIOTE. Between the sensor readings, when an interrupt is generated, I put the microcontroller in sleep mode with sd_app_evt_wait. The problem is that I have a much higher consumption than expected, since there are consumption peaks of around 400uA. I have already checked the pull of the MISO pin and disabled everything that was possible possible to isolate the problem.

So, I figured it would probably be related to Errata 89, but I had doubts when implementing the workarround.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define SPI_INSTANCE 2
static const nrf_drv_spi_t hspi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);
static volatile bool spi_xfer_done = 0;
void spi_event_handler(nrf_drv_spi_evt_t const * p_event,
void * p_context)
{
spi_xfer_done = true;
}
void spi_init(void)
{
nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
APP_ERROR_CHECK(nrf_drv_spi_init(&hspi, &spi_config, spi_event_handler, NULL));
nrf_drv_spi_uninit(&hspi);
*(volatile uint32_t *)0x40023FFC = 0;
*(volatile uint32_t *)0x40023FFC;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is initializing SPI this way enough for the workarround to work?

Beside that, I tried to use just the SPI, without the DMA. But it also didn't reduce the consume.  Is it expected?