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
  • Hi,

    After you uninit the SAADC, you can control the pins using GPIO HAL functions. Use GPIO pin number corresponding to the analog input, i.e. AIN0 = P0.02 (see nRF52840 Pin assignments):

    nrf_gpio_cfg_input(2, NRF_GPIO_PIN_PULLUP)

    Best regards,
    Jørgen

  • Is it the nRF or external devices that draw this high current? The nRF will not draw this much current if it is in System OFF mode, so either it is not in this state, or there are external devices that draw current. All clock sources are stopped when the chip is put in System OFF mode.

  • 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.

Reply
  • 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.

Children
No Data
Related