The PA/LNA module is part of the nRF IEEE 802.15.4 radio driver library provided with the stack libraries in the nRF5 SDK for Thread and Zigbee. The PA/LNA module increases the range of communication by providing APIs that act as interface for several types of external front-end modules (FEMs). Inside the radio driver library, a three-pin FEM model support is included. (To use a different FEM model, for example a two-pin model, you must recompile the radio driver.)
The FEMs are controlled by the enable signals that turn on a Power Amplifier (PA) or a Low Noise Amplifier (LNA). The third signal disables the FEM during the radio inactivity, in order to save energy.
When the FEM is enabled, the radio driver toggles the three GPIO pins, based on the radio operation. The configuration structure allows to choose the pin polarity, and time differences between the pin toggle and the intended radio operation.
You can use PCA10112 (nRF21540) to evaluate the Front End Module support for Thread and Zigbee examples.
To enable the FEM support in a Thread or a Zigbee application, build your application with the ENABLE_FEM
compile-time option.
Once the FEM support is included, you can configure it by using the parameters defined in the sdk_config.h
file:
FEM_CONTROL_DEFAULT_ENABLE
– Enables the FEM control on GPIO pins during the stack initialization.FEM_CONTROL_DEFAULT_PA_PIN
– Pin number. Controls the Power Amplifier of the FEM.FEM_CONTROL_DEFAULT_LNA_PIN
– Pin number. Controls the Low Noise Amplifier of the FEM.FEM_CONTROL_DEFAULT_PDN_PIN
– Pin number. Controls the Power Down control line of the FEM.All of these pins can be reconfigured by the application after the initialization. Use the following parameters defined in the sdk_config.h
file to configure the pin numbers:
FEM_CONTROL_DEFAULT_MODE_PIN
– Pin number. Selects the transmission power mode of the FEM (by default, set to the logic state 0).FEM_CONTROL_DEFAULT_ANTSEL_PIN
– Pin number. Selects the antenna output of the FEM (by default, set to the logic state 0).FEM_CONTROL_DEFAULT_MOSI_PIN
– Pin number. Connected to the MOSI pin of the SPI interface of the FEM (by default, set to the logic state 1).FEM_CONTROL_DEFAULT_MISO_PIN
– Pin number. Connected to the MISO pin of the SPI interface of the FEM (by default, set as a logic input).FEM_CONTROL_DEFAULT_CLK_PIN
– Pin number. Connected to the CLK pin of the SPI interface of the FEM (by default, set to the logic state 1).FEM_CONTROL_DEFAULT_CSN_PIN
– Pin number. Connected to the CSN pin of the SPI interface of the FEM (by default, set to the logic state 0).The current implementation of the FEM support does not implement the SPI interface and does not change the transmission power or antenna after the initialization.
When the FEM support is enabled and configured, there are additional peripheral requirements required by the radio driver's PA/LNA module for toggling the GPIO pins. For more details, see Thread nRF52840 peripheral requirements or Zigbee nRF52840 peripheral requirements.
For evaluation purposes, use a set of CLI commands in Zigbee CLI Reference to configure and enable the FEM support.
Additionally for Zigbee, you can provide the full FEM configuration structure by defining ZB_FEM_SETTINGS
compile-time constant inside the sdk_config.h
file.
nrf_fem_gpio_configure
weak function that configures and sets the default polarity of all GPIO pins that are connected to the FEM chip. As a result, after enabling the FEM support, you can flash the Zigbee CLI Agent example onto the nRF21540 DK and start the evaluation process.nrf_fem_gpio_configure
weak function.