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?

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

  • You have your own custom board, right? And then you have probably made custom board files for your board (as documented here and also covered in Lesson 3 – Adding custom board support in the nRF Connect SDK Intermediate course. Then you can add a C file for your board which is then added to any projects with that board as build target. You can do that exactly as it is done in the nRF52840 dongle board files, which is why I pointed to that as a reference.

    Note that if the above is problematic for some reason, you can add the code in any other file in you rproejct as well. But do it like it is done in the file I pointed to, with SYS_INIT, so that it is execututed early on in boot. In other words, if that is easier, you can simply copy the content of the board.c file for the dongle into your main.c file, and that will also work. This code sets the voltage to 3V. If you want something else, replace UICR_REGOUT0_VOUT_3V0 with what you want.

Related