Hi
I used SDK v5.2, SD : s310 v1.0.0 and nRF51422 v2 (QFAA E0).
The power consumption is too high when I used GPIOTE to do interrupt.
Disable GPIOTE:
The current value:
BLE ADV and ANT open channel : ~1.3mA
Connect : 0.5uA
Enable GPIOTE:
BLE ADV and ANT open channel : ~2.3mA
Connect : 1.5uA
I saw the current is 22uA when use GPIOTE in the datasheet v2.1.
please advise.
#define INT_PIN 24
void GPIOTE_IRQHandler(void)
{
// Event causing the interrupt must be cleared.
if ((NRF_GPIOTE->EVENTS_IN[0] == 1) && (NRF_GPIOTE->INTENSET &
GPIOTE_INTENSET_IN0_Msk))
{
NRF_GPIOTE->EVENTS_IN[0] = 0;
}
}
void gpiote_init(void)
{
nrf_gpio_cfg_input(INT_PIN, BUTTON_PULL);
NVIC_ClearPendingIRQ(GPIOTE_IRQn);
NVIC_SetPriority(GPIOTE_IRQn, APP_IRQ_PRIORITY_LOW);
NVIC_EnableIRQ(GPIOTE_IRQn);
nrf_gpiote_event_config (0,INT_PIN,NRF_GPIOTE_POLARITY_HITOLO);
NRF_GPIOTE->INTENSET = 1;
}
I put gpiote_init() after buttons_init(); in main();
THanks.