How to use VDDH, DCCH and VDD

Hello, 

I would like to know how to output 2.1V from VDD while supplying power to VDDH.

I coded as follows and supplied power to the PCA10095 via USB, but both VDDH and VDD were 3.0V.

	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
	while(NRF_NVMC->READY == NVMC_READY_READY_Busy);
	NRF_UICR->VREGHVOUT = UICR_VREGHVOUT_VREGHVOUT_2V1;
	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
	while(NRF_NVMC->READY == NVMC_READY_READY_Busy);
	NRF_REGULATORS->VREGH.DCDCEN = REGULATORS_VREGH_DCDCEN_DCDCEN_Enabled;
	NRF_REGULATORS->VREGMAIN.DCDCEN = REGULATORS_VREGMAIN_DCDCEN_DCDCEN_Enabled;
	NRF_REGULATORS->VREGRADIO.DCDCEN = REGULATORS_VREGRADIO_DCDCEN_DCDCEN_Enabled;

Are there any other registers that need to be considered?

Regards, 

Gotoda

Parents
  • Hi,

    If you are running the chip in high voltage configuration, and you see 3.0V on the GPIOs, the UICR->VREGHVOUT register could have already been written to UICR_VREGHVOUT_VREGHVOUT_3V0 (4). Note that UICR works like flash, and bits can only be flipped from 1 to 0 by writing. Changing a bit in UICR from 0 to 1 requires you to erase the full UICR page. If the register is set to 4, you will not be able to change it to 2 without erasing the UICR. Can you read out the value of VREGHVOUT?

    Did you power the nRF5340 DK through the nRF_USB port, or through the interface MCU USB port? The board have an on-board regulator, which will supply the board in normal voltage mode at 3.0V if powered through the interface MCU USB port. High voltage mode can be used by powering through nRF_USB or the Li-Po supply pins. See Power supply for more details.

    Best regards,
    Jørgen

  • Hi, 

    After writing the program from the MCU USB port, I supplied power from the nRF_USB port and checked the operation, but both VDDH and VDD are still 3.0V (I checked by measuring C21 and L3 with a tester).

    I tried implementing the code below to erase the UICR, but the process stopped at NRF_NVMC->ERASEALL = 1 and the program could not be rewritten without recover.

    Is there something wrong with the erasing method?

    Regards, 

    Gotoda

Reply
  • Hi, 

    After writing the program from the MCU USB port, I supplied power from the nRF_USB port and checked the operation, but both VDDH and VDD are still 3.0V (I checked by measuring C21 and L3 with a tester).

    I tried implementing the code below to erase the UICR, but the process stopped at NRF_NVMC->ERASEALL = 1 and the program could not be rewritten without recover.

    Is there something wrong with the erasing method?

    Regards, 

    Gotoda

Children
  • After writing the program from the MCU USB port, I supplied power from the nRF_USB port and checked the operation, but both VDDH and VDD are still 3.0V (I checked by measuring C21 and L3 with a tester).

    Did you also change the NRF POWER SWITCH from VDD to USB?

    I tried implementing the code below to erase the UICR, but the process stopped at NRF_NVMC->ERASEALL = 1 and the program could not be rewritten without recover.

    Is there something wrong with the erasing method?

    Erasing the UICR will set APPROTECT/SECUREAPPROTECT registers to a different value than the "Unprotected" value, which may explain the behavior you are seeing. Could you try erasing the UICR before flashing the application, for instance using "nrfjprog --eraseuicr" or "nrfjprog --eraseall" commands?

    Did you try reading out the value from NRF_UICR->VREGHVOUT, to make sure it is in fact set to 4?

  • First, I connected to the MCU USB port (J2), set the nRF power source switch (SW9) to VDD, performed ERASEALL, and confirmed that the value of VREGHVOUT(0x00FF8010) was DEFAULT.

    >nrfjprog --eraseall
    Erasing user available code and UICR flash areas.
    Applying system reset.
    
    >nrfjprog --memrd 0x00FF8010
    0x00FF8010: FFFFFFFF                              |....|

    Next, I implemented the following code in VS Code and programmed it on the board.

    NRF_REGULATORS->VREGH.DCDCEN = REGULATORS_VREGH_DCDCEN_DCDCEN_Enabled;
    NRF_REGULATORS->VREGMAIN.DCDCEN = REGULATORS_VREGMAIN_DCDCEN_DCDCEN_Enabled;
    NRF_REGULATORS->VREGRADIO.DCDCEN = REGULATORS_VREGRADIO_DCDCEN_DCDCEN_Enabled;
    
    if(NRF_UICR->VREGHVOUT != UICR_VREGHVOUT_VREGHVOUT_2V1)
    {
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    	while(NRF_NVMC->READY == NVMC_READY_READY_Busy);
    	NRF_UICR->VREGHVOUT = UICR_VREGHVOUT_VREGHVOUT_2V1;
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    	while(NRF_NVMC->READY == NVMC_READY_READY_Busy);
    }
    
    while(NRF_UICR->VREGHVOUT != UICR_VREGHVOUT_VREGHVOUT_2V1);

    When I read the value of VREGHVOUT (0x00FF8010) again after completing the program, it was set to 2.1V.

    >nrfjprog --memrd 0x00FF8010
    0x00FF8010: 00000001                              |....|

    Finally, when I connected it to the nRF USB port (J3) and set the nRF power source switch (SW9) to USB, the software did not work and I measured VDDH (C21) with a tester and it was 1.66 V.

  • Looks like your configuration should be correct. Note that you need to perform a rest after writing FICR for the changes to take effect.

    Can you provide a picture of the DK and your measurement test points, for me to exactly replicate your setup?

  • After doing "recover" to both the application core and the network core and writing again, it worked as expected.

    I don't know what caused it, but the problem is solved.

Related