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

sd_power_pof_threshold_set Invalid Threshold

    uint32_t err_code;
    err_code = sd_power_pof_enable(POWER_POFCON_POF_Enabled << POWER_POFCON_POF_Pos);
    APP_ERROR_CHECK(err_code);

    err_code = sd_power_pof_threshold_set(POWER_POFCON_THRESHOLD_V23);
    if(err_code == NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN )
    {
        DEBUG_ERROR("Invalid Power threshold!!");
    }
    APP_ERROR_CHECK(err_code);

So using the above code I am trying to set the threshold of 2.3 volts on the power comparator. I am using sdk12.1 with Soft device 3.0.0 on an nrf52832

I keep getting NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN when I try and set the threshold.

The sd_power_pof_enable correctly sets the POFCON register to 0x01 but then fails when I try and set the threshold.

  1. What are the valid values for an nrf52832 chip? (I have tried quite a few) From the product data sheet it looks like I can use all of them but from what I have seen on the forums this might not be the case.
  2. Does this have to be called after enabling the softdevice? (I assume so but it would be good to have clarification)

Parents Reply Children
No Data
Related