AnsweredAssumed Answered

NHS3152 sleep mode

Question asked by Till Ostermann on Sep 29, 2018
Latest reply on Oct 1, 2018 by Till Ostermann
Hi,
I'm trying to get a NHS3152 demo board to work in low power mode and toggle the onboard led (0.2Hz). Specifically, when the LED is of, I expect a low current.

#include "board.h"

int main(void)
{
    Board_Init();
 

    // Initialize RTC
    Chip_RTC_Init(NSS_RTC);
    Chip_RTC_Wakeup_SetControl(NSS_RTC, (RTC_WAKEUPCTRL_T)(RTC_WAKEUPCTRL_ENABLE | RTC_WAKEUPCTRL_AUTO));
    Chip_RTC_Int_SetEnabledMask(NSS_RTC, RTC_INT_WAKEUP);
    NVIC_EnableIRQ(RTC_IRQn);
    Chip_RTC_Wakeup_SetReload(NSS_RTC, 5);

 

    while (1) {
        // Toggle led
        LED_Toggle(LED_RED);

 

        // Go to sleep
        Chip_PMU_PowerMode_EnterSleep();
    }

 

    return 0;
}

 

// RTC interrupt
void RTC_IRQHandler(void)
{
    if (Chip_RTC_Int_GetRawStatus(NSS_RTC) & RTC_INT_WAKEUP) {
        Chip_RTC_Int_ClearRawStatus(NSS_RTC, RTC_INT_WAKEUP);
    }
    Chip_RTC_Wakeup_SetReload(NSS_RTC, 5);
}

I've used the firmware documentation to compose this code. Unfortunately, when the LED is off, the NHS3152 still comsumes ~300µA, the same as without sleep mode. What am I missing?

 

BR

Till

Outcomes