Would MPSL automatically set some gpio pins to be used to control CTX and RTX pins of the SKY66112-11 FEM for TX/RX operations?

Hello my friends,

we have a custom board which includes an nRF52832 being chained to SKY66112-11 FEM.

Investigating the radio.c file in the radio-test example, I realized that we can configure the FEM in the application code, for example:

int fem_tx_configure(uint32_t ramp_up_time)
{
	int32_t err;

	fem_activate_event.event.timer.counter_period.end = ramp_up_time;

	err = mpsl_fem_pa_configuration_set(&fem_activate_event, &fem_deactivate_evt);
	if (err) {
		printk("PA configuration set failed (err %d)\n", err);
		return -EFAULT;
	}

	return 0;
}

However, for the FEM to work correctly, we need to set/clear CTX or RTX pins of the FEM via the nRF chip's GPIO pins that are connected to the FEM.

I am wondering how this control signal is generated automatically as we do NRF_RADIO->TXENABLE=1U or NRF_RADIO->RXENABLE=1U.

I already checked the radio.c fem_configure API and all I could conclude was that, it basically configure a timer. For instance, mpsl_fem_pa_configuration_set() API for the TX events.

However,  there is not a clear path to follow to understand how a radio event like TXENABLE=1 would translate into a GPIO pin high on a pin that can be connected to the FEM's CTX pin. Or how this timer configuration relates to the FEM control through the GPIO pins.

I am using MPSL for my proprietary communication protocol.

Does MPSL automatically set/clear some GPIO pins for every TX/RX radio events? If not, then how one can configure the FEM to be functional when using MPSL?
Is there any PPI channel that automatically sets some GPIO pins high and low for every TX/RX radio events? 
Is there a way to configure the MPSL to automatically send the control signal to FEM through specific GPIO pins and with appropriate timing?

Parents Reply Children
  • The problem with the SDK is that it lowers the SOCs power to an unpredictable level which I guess it is supposed to be equal to whatever is given to NRF_RADIO->TXPOWER.

    The real issue arises when you want to have both the SOC and the FEM at their Max amplification. That can only happen if you set "tx-gain-db=<0>" at the device tree which does not make any sense from the high-level coding-style perspective. There are two issues: first, the gain simply means amplification not anything else, and when you set a gain to something, it should do amplification to the specified level. second: there are many FEM products that offer fixed gains, i.e., non adjustable gain, and requiring a gain of zero specification in the DT of the FEM for proper performance of the SOC does not make sense at all. (At least not to me!)

    From your comment, it seems like an EGU is needed. So, any MPSL-based application which does not use EGU, won't trigger the GPIO pins for TX and RX enables, right? For example, my application which does not use any EGU and runs only on MPSL and HAL.

    Having said that, with hard gpio_pin_set and totally removing the Device Tree configuration from our driver, I could get the +14 dBm output out of the FEM for my MPSL based application which is almost near the specification of the SKY FEM for VCC of 1.8 Volt considering 1.6dB cable loss. Also, for the BLE-stack the only way that FEM would amplify is to do: tx-gain-db=<x> where x is a small number, otherwise you will get a highly attenuated signal out of FEM which is due to SOC's lowered power.

    I am looking forward to testing the SDK2.6 for this scenario.

  • Hello again,

    I have read through your comments, and I do believe your understanding is correct. I would like to mention a bit why it is the way it is, please see:
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_fem.html 

    You can find that we provide a power model for the nRF21540, which ensure that the set output power remain constant over the following conditions:

    - Temperature
    - FEM supply voltage
    - Carrier frequency
    - FEM input power

    So doing it like you want it to be done is more intuitive correct, but that is in an ideal world. You are running into a risk that you may for instance exceed regulative requirements and/or you experience reduced performance if you don't have a power model such that we provide for the nRF21540. Hope that explains a bit why it is the way it is, and why this also impact other FEMs that may be used.

    Kenneth

  • Thank Keneth,  I see your point.

    just one more question, do you mean my conclusion on the necessity of the EGU in the MPSL application was also right?

  • Omid said:
    just one more question, do you mean my conclusion on the necessity of the EGU in the MPSL application was also right?

    Not necessarily, it should be possible to use a timer without EGU, where compare0 event trigger start task of radio, and compare1 event trigger the txen/rxen pin. Though, you might need to use MPSL_FEM_EVENT_TYPE_GENERIC instead of MPSL_FEM_EVENT_TYPE_TIMER in that case, since you will be controlling the timer in the application (not through MPSL).

    Kenneth

  • I see, thanks, but what do you mean by using either of MPSL_FEM_EVENT_TYPE_GENERIC or MPSL_FEM_EVENT_TYPE_TIMER?

    How one can use them? 

Related