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

System off mode still drawing 200uA. how to switch off the saadc and pull high the saadc pins?

Hi, 

I'm using 3 AIN pins to read analog readings. However, when I go to sleep mode, I want the current to be as low as possible. 

I notice that the AIN pins (saadc) is floating or disconnected and I need it to pull high to switch off my optical sensor (collector and emitter. I'm using an optical sensor QRE1113). 

I have tried 

nrfx_saadc_uninit();
// Go to system-off mode (this function will not return; wakeup will cause a reset).
err_code = sd_power_system_off();

But I need the pins to be high. 

Please help. 

Thank you 

Best regards,

Chong 

Parents Reply Children
  • Hi Jorgen

    Will the BSP events prevent the chip to go into system OFF mode ? 

    Are there any checks to verify if the chip is in system OFF mode ? 

    I have done the following to shut down to system OFF mode. 

    uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
        APP_ERROR_CHECK(err_code);
    
        // Prepare wakeup buttons.
        err_code = bsp_btn_ble_sleep_mode_prepare();
        APP_ERROR_CHECK(err_code);
        nrfx_saadc_uninit();
        app_timer_stop(peroid_adc_timer_id);
         err_code = sd_power_system_off();
        APP_ERROR_CHECK(err_code);

    Thank you 

    Best regards,

    Chong 

  • ctchong said:
    Will the BSP events prevent the chip to go into system OFF mode ?

    No, they should not. Entering System OFF mode will turn off all clock sources and only GPIO/NFC/LPCOMP/RESET can wake the chip. If  bsp_btn_ble_sleep_mode_prepare() configures a floating pin as wake-up source (BSP buttons have not been initialized), this could cause the chip to wake right away. This will trigger a chip reset.

    ctchong said:
    Are there any checks to verify if the chip is in system OFF mode ? 

    Only by measuring the current consumption of the chip. This should be ~300 nA. The function call will not return.

  • ctchong said:
    Will the BSP events prevent the chip to go into system OFF mode ? 

    No, they should not. Entering System OFF mode will turn off all clock sources and only GPIO/NFC/LPCOMP/RESET can wake the chip. If  bsp_btn_ble_sleep_mode_prepare() configures a floating pin as wakeup source (BSP buttons have not been initialized), this could cause the chip to wake right away. This will trigger a chip reset.

    ctchong said:
    Are there any checks to verify if the chip is in system OFF mode ? 

    Only by measuring the current consumption of the chip. This should be ~300 nA. The function call will not return.

  • ctchong said:
    Will the BSP events prevent the chip to go into system OFF mode ? 

    No, they should not. Entering System OFF mode will turn off all clock sources and only GPIO/NFC/LPCOMP/RESET can wake the chip. If  bsp_btn_ble_sleep_mode_prepare() configures a floating pin as wakeup source (BSP buttons have not been initialized), this could cause the chip to wake right away. This will trigger a chip reset.

    ctchong said:
    Are there any checks to verify if the chip is in system OFF mode ? 

    Only by measuring the current consumption of the chip. This should be ~300 nA. The function call will not return.

  • Hi Jorgen,

    Thank you for your reply. Do I need to configure/set the SWDCLK and SWDIO as well ? 

    It seems like my chip is not going to system off mode. It resets when I plug in the swd. 

    Thank you

    Best regards 

    Chong 

Related