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
  • Hello,

    There is not automatic handling simply because you are using the radio no. I suggest that you look at the ESB source code on how it is configuring MPSL when enabling the radio, and for instance to transmit and receive data.

    \v2.6.0\nrf\subsys\esb\esb.c
    \v2.6.0\nrf\subsys\esb\esb_dppi.c

    Kenneth

  • Hi Kenneth, it seems like I was not able to get my point accross. I am not asking for the ways I can use MPSL and radio (I already know how to do that). The entire question is about a front end module (FEM) being chained to the nRF chip and how that thing is actually controlled by the nRF chip during radio operation. I know for the fact that MPSL has FEM support, please see: [MPSL FEM]

  • I think the ESB files I point to show what you want to know, because the ESB source code show how to use the radio along with MPSL to use the FEM. The MPSL don't expose directly the pins that control the fem, instead you configure MPSL with the events that it should use in turn to control the TX/RX pins, then MPSL will ensure the RX/TX pins to the FEM toggle as expected based on the events provided. 

    Looking at the implemention of ESB I can find that both mpsl_fem_pa_configuration_set() and mpsl_fem_lna_configuration_set() is never enabled at the same time. The ESB don't call TXENABLE or RXENABLE when it want to start the radio, instead it will setup ppi channels from the EGU to the start radio task and a start timer task. When ESB want to transmit or receive it will instead trigger an EGU event by calling radio_start(), see implementation here:

    static void radio_start(void)
    {
    	/* Event generator unit is used to start radio and protocol timer if needed. */
    	nrf_egu_task_trigger(ESB_EGU, ESB_EGU_TASK);
    }

    So the radio will startup (this takes for instance 150us if it's BLE or 130us if its proprietary) before radio is actively transmitting or receiving, the MPSL will use the timer compare event to set the RX/TX pin after for instance TX_RAMP_UP_TIME_US (129us).

    So you are right, ESB is using for instance a timer compare event to time when the RX/TX pins are set.

    Hope it helps,
    Kenneth

Reply
  • I think the ESB files I point to show what you want to know, because the ESB source code show how to use the radio along with MPSL to use the FEM. The MPSL don't expose directly the pins that control the fem, instead you configure MPSL with the events that it should use in turn to control the TX/RX pins, then MPSL will ensure the RX/TX pins to the FEM toggle as expected based on the events provided. 

    Looking at the implemention of ESB I can find that both mpsl_fem_pa_configuration_set() and mpsl_fem_lna_configuration_set() is never enabled at the same time. The ESB don't call TXENABLE or RXENABLE when it want to start the radio, instead it will setup ppi channels from the EGU to the start radio task and a start timer task. When ESB want to transmit or receive it will instead trigger an EGU event by calling radio_start(), see implementation here:

    static void radio_start(void)
    {
    	/* Event generator unit is used to start radio and protocol timer if needed. */
    	nrf_egu_task_trigger(ESB_EGU, ESB_EGU_TASK);
    }

    So the radio will startup (this takes for instance 150us if it's BLE or 130us if its proprietary) before radio is actively transmitting or receiving, the MPSL will use the timer compare event to set the RX/TX pin after for instance TX_RAMP_UP_TIME_US (129us).

    So you are right, ESB is using for instance a timer compare event to time when the RX/TX pins are set.

    Hope it helps,
    Kenneth

Children
Related