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

nRF5340 VREQCTRL for Additional 3 dB TX Power

Hi team,

I am working with the nRF5340 PDK v0.8.0 and I am trying to request the additional voltage for the VREGRADIO to support the additional 3 dB TX power on the RADIO. I am using the radio_test example in the SDK (nrf\samples\peripheral\radio_test) for this. To facilitate this, the only changes I made were to the main.c file as seen below. Is this the correct way to request the higher voltage? When debugging I am not seeing the bit value in the register change but I am printing out the correct value of the register (see screenshot below).

Unfortunately, I do not have the proper RF equipment to measure the extra 3 dB change in output power. I only have the RSSI Viewer with the nRF52840 Dongle which doesn't look to be changing from having this to not having this.

Added:

#include <nrfx/hal/nrf_vreqctrl.h>

nrf_vreqctrl_radio_high_voltage_set(NRF_VREQCTRL_NS, true); 

while(!nrf_vreqctrl_radio_high_voltage_check(NRF_VREQCTRL_NS));

Also some printk statements. Here is my final main.c file:

/*
 * Copyright (c) 2020 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
 */

#include <sys/printk.h>
#include <drivers/clock_control.h>
#include <drivers/clock_control/nrf_clock_control.h>
#include <nrfx/hal/nrf_vreqctrl.h>

static void clock_init(void)
{
	int err;
	struct device *clock;
	enum clock_control_status clock_status;

	clock = device_get_binding(DT_INST_0_NORDIC_NRF_CLOCK_LABEL);
	if (!clock) {
		printk("Unable to find clock device binding\n");
		return;
	}

	err = clock_control_on(clock, CLOCK_CONTROL_NRF_SUBSYS_HF);
	if (err) {
		printk("Unable to turn on the clock: %d", err);
	}

	do {
		clock_status = clock_control_get_status(clock,
			CLOCK_CONTROL_NRF_SUBSYS_HF);
	} while (clock_status != CLOCK_CONTROL_STATUS_ON);

	printk("Clock has started\n");
}

void main(void)
{
	printk("Starting Radio Test example\n");

	clock_init();

    nrf_vreqctrl_radio_high_voltage_set(NRF_VREQCTRL_NS, true); 

    while(!nrf_vreqctrl_radio_high_voltage_check(NRF_VREQCTRL_NS));

//        NRF_VREQCTRL->VREGRADIO.VREQH = 1;

//        while (!VREGRADIO.VREQHREADY);

    printk("Register value is %d\n", NRF_VREQCTRL->VREGRADIO.VREQHREADY);
    printk("RADIO is ready to operate on high voltage\n");

}

Regards,

Akash Patel

Related