How to get a pointer to the structure of the registers, for setting VREQCTRL?

Hi all,

I'm trying to turn on the increased voltage for the +3 dBm transmit power.  I understand that to do that, I need to set the VREQCTRL register, or associated bit in a register.

I'm using nRF Connect 1.7.1 with VS Code 1.71.2 (Windows 10) and developing for the nRF5340.

I've seen several posts about doing this on DevZone, and really my question is not so much about the VREQCTRL register itself as much as how to get the pointer required to set it. This doesn't seem to be really addressed on the posts I've seen.

I think I need to call this function: nrf_vreqctrl_radio_high_voltage_set(NRF_VREQCTRL_Type *p_regbool enable), where the first argument is a pointer to the structure of the register. What is the best way to get or create that pointer?

Scott

 

  • Scott,

    That was indeed the case before nRF Connect SDK v1.6.0. 

    From changelog:

    • Increased the maximum supported radio output power on nRF53 Series devices from 0 dBm to 3 dBm. If the output power is above 0 dBm, NRF_VREQCTRL->VREGRADIO.VREQH is set (DRGN-15476).

    Which means that the HCI driver should automatically set the VREQCTRL register if you chose an output power over 0 dBm. In the latest NCS version you can use CONFIG_BT_CTLR_TX_PWR to set the default TX power. Do you get any errors if you try to set the TX power to +3 dBm? 

    regards

    Jared 

  • Hi Jared,

    Thanks for the info. This helped clear up some confusion on my side and it's working now.

    So the key things I needed to realize were:

    • The VREQCTRL register gets automatically set if a power level above 0 dBm is requested, so it doesn't need to be manually set.
    • Transmit power parameter is specified as a number in dBm that is the actual power level desired. So if I want +3, I pass in 3 as a parameter, and if I want -12, I pass in -12, and so forth.

    Previously I had been under the impression that there was a set of parameters mapped to different values, like  0 = 0 dBm, 1 = -4 dBm, 2 = -8 dBm, etc.  So, I misunderstood how the power needs to be set as well, and that added to my confusion.

    Thanks for your help, Jared.

    Scott

Related