How to change the DC/DC REGOUT0 voltage in Zephyr project?

I only learned today that the REGOUT0 voltage is changeable, which could be perfect for us, because our power needs changed dramatically.

Our circuit was originally designed to take a 3.7V lithium-ion battery via VDDH, and with DCCH hooked up to VDD via a 10uH inductor, our goal was to get ~3V-3.3V from VDD to power our sensors in the circuit. However, we changed sensors, and they now use 1.8V instead of 3-3.3V.

What we didn't realize when building the circuit was that the VDD output was changeable. According to the datasheet, the REGOUT0 register dictates the power delivery anywhere from 1.8V to 3.3V, however, we NEVER changed this, I supposed we were just lucky that it happened to be the right voltage for us.

Here are our questions:

1. When hooked up in our configuration, is changing the VDD output voltage a hardware thing, or a software thing?

2. If the answer to question 1 is a software thing, can it be done easily in Zephyr project?

3. If the answer to question 2 is no, then how is it done?

4. Although we are using VDDH, VDD, DCCH and the DC/DC converter, I noticed that there's a DC/DC toggle in the nRF Kconfig menu, but it is forced off, although we are definitely using DC/DC. Why is this?

Parents
  • Hi,

    1. When hooked up in our configuration, is changing the VDD output voltage a hardware thing, or a software thing?

    It is a litle bith of both. The hardware determines if using high voltage mode or normal voltage mode (see Reference circuitry for details). REGOUT0 is only relevant in high-voltage mode. And the default configuration is 1.8 V. To get another voltage, you need to program REGOUT0 which is a presistent register in the UICR.

    2. If the answer to question 1 is a software thing, can it be done easily in Zephyr project?

    I suggest you do this in the same way that we do for the nRF52840 dongle in the hardware files for your board. What we do there, is include this board.c file, which is also added to the CMakeLists.txt for that board. here you have the board_nrf52840dongle_nrf52840_init() function that runs early in boot, and configures the REGOUT0 when it is not programmed before (on first boot).

    4. Although we are using VDDH, VDD, DCCH and the DC/DC converter, I noticed that there's a DC/DC toggle in the nRF Kconfig menu, but it is forced off, although we are definitely using DC/DC. Why is this?

    If you search for "DC/DC" you will find configs for other boards (Zephyr includes sopport for many non-nrf Boards). If you search for "DCDC" you should see the relevant configs for nRF devices which are CONFIG_BOARD_ENABLE_DCDC and CONFIG_BOARD_ENABLE_DCDC_HV.

Reply
  • Hi,

    1. When hooked up in our configuration, is changing the VDD output voltage a hardware thing, or a software thing?

    It is a litle bith of both. The hardware determines if using high voltage mode or normal voltage mode (see Reference circuitry for details). REGOUT0 is only relevant in high-voltage mode. And the default configuration is 1.8 V. To get another voltage, you need to program REGOUT0 which is a presistent register in the UICR.

    2. If the answer to question 1 is a software thing, can it be done easily in Zephyr project?

    I suggest you do this in the same way that we do for the nRF52840 dongle in the hardware files for your board. What we do there, is include this board.c file, which is also added to the CMakeLists.txt for that board. here you have the board_nrf52840dongle_nrf52840_init() function that runs early in boot, and configures the REGOUT0 when it is not programmed before (on first boot).

    4. Although we are using VDDH, VDD, DCCH and the DC/DC converter, I noticed that there's a DC/DC toggle in the nRF Kconfig menu, but it is forced off, although we are definitely using DC/DC. Why is this?

    If you search for "DC/DC" you will find configs for other boards (Zephyr includes sopport for many non-nrf Boards). If you search for "DCDC" you should see the relevant configs for nRF devices which are CONFIG_BOARD_ENABLE_DCDC and CONFIG_BOARD_ENABLE_DCDC_HV.

Children
  • Thanks for the reply Einar!

    When you said

    I suggest you do this in the same way that we do for the nRF52840 dongle in the hardware files for your board. What we do there, is include this board.c file, which is also added to the CMakeLists.txt for that board. here you have the board_nrf52840dongle_nrf52840_init() function that runs early in boot, and configures the REGOUT0 when it is not programmed before (on first boot).

    Can you expand on what you mean by this? "Include" a file is quite vague because of the context, it could mean a few things here. Are you including the board.c file in the main program code (like a library), are you including that file in the project folder somewhere, are you adding it to the CMakeLists.txt file?

    The board file you said you include for that board seems to be the normal board file for that board, what is special about this? How is this different from NOT including it?

    Thanks!

  • Hi,

    I am sorry for not being clear. I ment adding a file similar (or identical) to the board.c file for the nrf52840 dongle, and adding that to the CMakeLists.txt file for that board (look at how it is done in zephyr/boards/arm/nrf52840dongle_nrf52840/). This does exactly wha tyou want to do, so you just need to do it the same way.

    Bk37 said:
    The board file you said you include for that board seems to be the normal board file for that board, what is special about this?

    The "special" thing about this file for the nRF452840 dongle is that it writes to REGOUT0 to configure the VDD voltage.

  • Thanks for the quick response! I think I understand now.

    Since I'm building for a very specific board, could I just copy the code from 'nrf52840dongle / board.c', and paste it in my own specific board file (nrf52840)?

    Or is there something intrinsically simple/necessary with the nrf52840dongle board file?

  • Hi,

    Yes, that is corect. The reason I described board.c and Kconfig specifically is that for most of our DK board we do not have  a board.c (or a .c file of any form) in the board files. But if you allready have that, just copy-paste the content from the nRF52840 dongle file into your. If nott, add a board.c file just as it is done for nRF52840.

    There is nothing special about this board.c file, other than that it is a .c file that is included in all builds that are for this board.

  • I thought I understood, but after testing, I'm still just as confused as the start.

    I'm not understanding where this board.c file is supposed to go??

    Does it go in the SDK? does it go in the project files? Where in the project files does it go?

    Because the link you shared is the SDK files, correct? But I get the impression I shouldn't be changing SDK files, but rather, project specific files, of which, there are no board.c files, so I wouldn't know where to place one.

Related