Meaning of: REGULATORS_VREGRADIO_DCDCEN_DCDCEN_Enabled ?

For power optimization on our nrf5340 project, we followed the recommendations here:

We originally did that with SDK v1.9.1. Recently we upgraded to SDK v2.3.0.

As per that article, the first three code lines in our "void main()" are:
NRF_REGULATORS_S->VREGH.DCDCEN = REGULATORS_VREGH_DCDCEN_DCDCEN_Enabled;
NRF_REGULATORS_S->VREGRADIO.DCDCEN = REGULATORS_VREGRADIO_DCDCEN_DCDCEN_Enabled;
NRF_REGULATORS_S->VREGMAIN.DCDCEN = REGULATORS_VREGMAIN_DCDCEN_DCDCEN_Enabled;
Although everything seems to work well, I would appreciate it if you could explain the exact purpose and meaning of the 2nd last line above, ie: 
"...
= REGULATORS_VREGRADIO_DCDCEN_DCDCEN_Enabled;"
Questions:
1. What exactly does that line do?
2. Is it still necessary in SDK v2.3.0?
3. How (or why) does this "save/optimize power"?
Thanks!

Gerard
  • Those registers are described in the PS. Read that document for details - it should also cover the restrictions. The DCDC requires certain hardware components to be populated.

  • Thanks for NOT answering my questions..... :(

    Guess you either don't know of are too busy?

  • Hello Gerard,

    NRF_REGULATORS_S->VREGRADIO.DCDCEN = REGULATORS_VREGRADIO_DCDCEN_DCDCEN_Enabled;
    1. What exactly does that line do?

    This line enables the DCDC for the radio regulator, i.e. the voltage regulator for the network core. Note that for DCDC to work, the board needs an external LC filter. This is included on the nRF5340 DK. Flashing firmware which enables DCDC without the inductor being present will make the chip unresponsive.

    The documentation for the VREGRADIO.DCDCEN register is found from the info page for nRF5340 here. The relevant section is found with via these link titles: nRF5340 Product Specification -> Power and clock management -> REGULATORS -- Regulator control. Alternatively the same section can be found in section 4.7 of the PDF of the PS.

    2. Is it still necessary in SDK v2.3.0?

    For a custom board, it is necessary if you want to enable DCDC on the network core on an nRF5340 custom board with the required external LC filter.

    When using the nRF5340-DK, you can enable the DCDC by including these configs in proj.conf:
    CONFIG_BOARD_ENABLE_DCDC_APP=y
    CONFIG_BOARD_ENABLE_DCDC_NET=y

    You don't need to directly set the registers in that case.

    If you define the configs in your board file, you don't have to use the register method for a custom board either.

    3. How (or why) does this "save/optimize power"?

    This helps to optimize power by enabling the DCDC regulator. Both DCDC and LDO will still be used, but the most efficient one of them is chosen automatically. resulting in a lower current consumption.

    Best regards,

    Maria

  • Hi Maria

    Thanks for your great response - MUCH appreciated!

    That is exactly what I was trying to understand better. 

    As we have those two CONFIG_BOARD_ENABLE_DCDC... lines in our prj.conf file,
    we can remove the following 3 lines:

    NRF_REGULATORS_S->VREGH.DCDCEN = REGULATORS_VREGH_DCDCEN_DCDCEN_Enabled;
    NRF_REGULATORS_S->VREGRADIO.DCDCEN = REGULATORS_VREGRADIO_DCDCEN_DCDCEN_Enabled;
    NRF_REGULATORS_S->VREGMAIN.DCDCEN = REGULATORS_VREGMAIN_DCDCEN_DCDCEN_Enabled;


    from our "main.c" code without effecting power consumption (or anything else) as the DCDC functionality is pre-defined to be set (for all 3 regulators) via the prj.conf file.

    Can you confirm that my understanding is correct!?

    Best Regards

    Gerard

  • Hi Gerard,

    You understand correctly.

    Keep in mind my notes on the nRF5340-DK vs a custom nRF5340 board:

    Maria Gilje said:
    2. Is it still necessary in SDK v2.3.0?

    For a custom board, it is necessary if you want to enable DCDC on the network core on an nRF5340 custom board with the required external LC filter.

    Maria Gilje said:
    If you define the configs in your board file, you don't have to use the register method for a custom board either.

    Best regards,

    Maria

Related