NRF5340dk - nPM1300 Buck Regulators

Hello I have a few questions

In my project, the nPM1300 fuel gauge example via nrf5340dk works properly. I received information such as V - I - SOC via I2C. Currently I want to control the 1.8V output via V1 and V2 buck converter. There is no structure in the sample code where I can access the registers. How can I control Vout outputs via software? Is there an example application? I want to be able to turn on and off the 1.8 V outputs of the nPM1300 via software.

thanks

Parents
  • Hi.

    You can use regulator_enable/disable to control the bucks and ldos.
    The npm1300_one_button sample uses this to control LDO1.

    e.g.:

    static const struct device *buck1 = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_buck1));
    ...
    regulator_enable(buck1);
    regulator_disable(buck1);
    
    

    Andy

  • I tried it, but I could not turn off the Vout1 output, the code does not give an error. But I could not turn off the 1.8V output. I am reading the battery voltage value via nPM1300. But the exits are not controlled. There is a fixed 1.8V output.

    Code:

    static const struct device *charger = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_charger));
    static const struct device *ldsw = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_ldo1));
    static const struct device *buck1 = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_buck1));
    ...
            fuel_gauge_update(charger);

                    if (regulator_is_enabled(buck1)) {
                    regulator_disable(buck1);
                    printf("Disableeee\n");
                }
            k_sleep(K_SECONDS(10));
            if (!regulator_is_enabled(buck1)) {
                    regulator_enable(buck1);
                    printf("Enableee\n");
            }
    Output ::: 
  • Hi.

    Have you got a load on the output?
    If I add a load to BUCK1, this code works for me.

    Andy

Reply Children
No Data
Related