This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unable to change VDD to 1.8V

Dear all

I am currently working with a nRF52840 Dongle, the ble_app_blinky_s140 example. 

To power some external circuits i have to set VDD to 1.8V.

Until now i tried the following approaches.

https://devzone.nordicsemi.com/f/nordic-q-a/20528/why-data-can-not-be-wrote-into-the-registers-of-nrf52840/80038#80038

by adding this two lines to the uicr_config.h

const uint32_t UICR_ADDR_EXTSUPPLY __attribute__((at(0x10001300))) __attribute__((used)) = 0xFFFFFFFF;//Enabled
const uint32_t UICR_ADDR_REGOUT0 __attribute__((at(0x10001304))) __attribute__((used)) = 0xFFFFFFF5;//3.3V

The second approach was to change the GPIO_OUTPUT_VOLTAGE_SETUP Function to 1.8V

None of these changed the Output Voltage.

Any idea why this doesn't work?

Regards

Marcel

Parents
  • Hi,

    I have found a solution for this problem by adding the following functions to the main of the blinky example.

    /**
     * @brief Function to erase UICR Registers.
     */
    
    
    void nvmcErase(void)       
      if (NRF_UICR->REGOUT0 != UICR_REGOUT0_VOUT_1V8) 
      {
          NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Een << NVMC_CONFIG_WEN_Pos;        //erase enable
          while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
          NRF_NVMC->ERASEUICR = NVMC_ERASEUICR_ERASEUICR_Erase << NVMC_ERASEUICR_ERASEUICR_Pos;   //erase UICR
          while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
          NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;  //read only enable
          while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
      }
    }
    
    
    /**
     * @brief Function for configuration of REGOUT0 register.
     */
    void vddInit(void)
    {
      if (NRF_UICR->REGOUT0 != UICR_REGOUT0_VOUT_1V8) 
      {
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;    //write enable
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    	NRF_UICR->REGOUT0 = UICR_REGOUT0_VOUT_1V8;                        //configurate REGOUT0
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
            NVIC_SystemReset();                                               // Reset device
      } 
    }

    The first function is to clear the UICR Registers. The second one then writes the UICR with the new values.

    Keep in mind to delete or uncomment the bsp_board_leds_init function in the boards.c file if you use a dongle.

    Also the LEDs will not work properly if you use the dongle with 1.8V.

    Regards,

    Michel

Reply
  • Hi,

    I have found a solution for this problem by adding the following functions to the main of the blinky example.

    /**
     * @brief Function to erase UICR Registers.
     */
    
    
    void nvmcErase(void)       
      if (NRF_UICR->REGOUT0 != UICR_REGOUT0_VOUT_1V8) 
      {
          NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Een << NVMC_CONFIG_WEN_Pos;        //erase enable
          while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
          NRF_NVMC->ERASEUICR = NVMC_ERASEUICR_ERASEUICR_Erase << NVMC_ERASEUICR_ERASEUICR_Pos;   //erase UICR
          while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
          NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;  //read only enable
          while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
      }
    }
    
    
    /**
     * @brief Function for configuration of REGOUT0 register.
     */
    void vddInit(void)
    {
      if (NRF_UICR->REGOUT0 != UICR_REGOUT0_VOUT_1V8) 
      {
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;    //write enable
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    	NRF_UICR->REGOUT0 = UICR_REGOUT0_VOUT_1V8;                        //configurate REGOUT0
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
            NVIC_SystemReset();                                               // Reset device
      } 
    }

    The first function is to clear the UICR Registers. The second one then writes the UICR with the new values.

    Keep in mind to delete or uncomment the bsp_board_leds_init function in the boards.c file if you use a dongle.

    Also the LEDs will not work properly if you use the dongle with 1.8V.

    Regards,

    Michel

Children
Related