You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mpsl/doc/fem.rst
+41-43Lines changed: 41 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,30 +32,31 @@ Simple GPIO
32
32
All currently supported implementations use the PA and LNA pins for controlling the FEM.
33
33
Additionally, the nRF21540 implementations use the PDN pin for powering down the FEM internal circuits, to reduce energy consumption.
34
34
35
-
TX power split
35
+
Tx power split
36
36
**************
37
37
38
38
When an application requests a given transmission power, it wants to achieve that power at the antenna.
39
39
Usually, the application does not know all hardware components, such as RF front-end modules, on the radio signal path.
40
40
To achieve a specific value of transmission power at the antenna, every FEM implementation provides a dedicated API that calculates the PA gain and SoC output power combination that results in the requested power at the antenna.
41
-
It also calculates a private setting value applied to the FEM that is needed to achieve the calculated PA gain.
41
+
It also calculates a private setting value that is applied to the FEM which is needed to achieve the calculated PA gain.
42
42
The meaning of this private setting is specific to each FEM implementation.
43
43
44
44
FEM implementations with multiple PA gains available (for example, nRF21540 with MODE pin support) choose which gain to use based on hardware limitations and the requested power value.
45
45
Alternatively, an external model can be used to determine the gain.
46
46
47
-
TX power split using models
47
+
Tx power split using models
48
48
===========================
49
49
50
-
You can achieve the TX power split using a model, to compensate, for example, for external conditions.
51
-
The model can be either external (passed to MPSL) or built-in.
50
+
The Tx power split can be done using a model.
51
+
This can be done to allow, for example, compensation of external conditions.
52
+
The model can be an external model passed to MPSL or a built-in model.
52
53
53
-
A built-in model is currently provided only for the nRF21540 GPIO SPI FEM implementation and it is in an :ref:`experimental<nrf:software_maturity>` stage.
54
+
A built-in model is currently provided only for the nRF21540 GPIO SPI FEM implementation and it is in an experimental stage.
54
55
The provided model allows for temperature, voltage, and frequency compensation.
55
56
56
-
The model is passed to MPSL before the FEM configuration, and contains two callbacks: ``fetch`` and ``init``.
57
-
After it completes the configuration, MPSL calls ``init`` to pass all the calibration and configuration data required by the specific FEM implementation to the model and to initialize the model.
58
-
Each time a TX power split is needed, MPSL calls the ``fetch`` function and passes the frequency and the requested output power to the model.
57
+
The model is passed to MPSL before FEM configuration, and contains two callbacks: ``fetch`` and ``init``.
58
+
After it has finished configuration, MPSL calls ``init`` to pass all the calibration and configuration data required by the specific FEM implementation to the model and to initialize the model.
59
+
Each time a Tx power split is needed, MPSL calls the ``fetch`` function and passes the frequency and the requested output power to the model.
59
60
The model then decides how to split this power into components, and calculates both the private setting for the specific FEM implementation and the actually achieved output power.
60
61
61
62
Configurable timings
@@ -74,20 +75,20 @@ For the nRF21540, two additional timings can also be configured:
74
75
General usage
75
76
*************
76
77
77
-
The Power Amplifier and the Low-Noise Amplifier are responsible for, respectively, transmission and reception, and are configured and activated independently.
78
+
The Power Amplifier and the Low-Noise Amplifier are responsible for, respectively, transmission and reception and are configured and activated independently.
78
79
The two functionalities cannot be configured and set to operate simultaneously, because they share some resources.
79
80
As such, after operating with a Power Amplifier, the PA configuration must be cleared to be able to configure and use a Low-Noise Amplifier afterward, and vice versa.
80
81
81
82
Both amplifiers are controlled through activation and deactivation events.
82
83
Two types of events are supported:
83
84
84
85
* A *timer event*.
85
-
It is the ``COMPARE`` event of a hardware timer and it can be used for both PA and LNA activation and deactivation.
86
+
It is the ``COMPARE`` event of a hardware timer and it can be used for both PA/LNA activation and deactivation.
86
87
* A *generic event*.
87
-
It is any other event type and it can only be used for PA and LNA deactivation.
88
+
It is any other event type and it can only be used for PA/LNA deactivation.
88
89
89
-
To prepare a generic event, the application must provide the event register.
90
-
To prepare a timer event, the application must provide the following:
90
+
To prepare a generic event, it is required that the application provides the event register.
91
+
To prepare a timer event, it is required that the application provides the following:
91
92
92
93
* The instance of the timer, which the protocol has to start by itself.
93
94
* The *Compare Channels* mask, which tells the front-end module which Compare Channels of the provided Timer are free to use.
@@ -96,7 +97,7 @@ To prepare a timer event, the application must provide the following:
96
97
97
98
Then, the module can configure the timer to activate or deactivate the FEM accordingly, taking also into account the FEM settle time.
98
99
99
-
The following example activates the LNA for an RX operation, using the following parameters:
100
+
See below for an example of activating the LNA for Rx operation, using the following parameters:
100
101
101
102
* RX ramp-up time - 40 us
102
103
* LNA settle time - 13 us
@@ -105,20 +106,20 @@ The following example activates the LNA for an RX operation, using the following
105
106
106
107
The *RX ramp-up time* is the total time scheduled by the application.
107
108
108
-
The steps needed to properly configure LNA in this example are the following:
109
+
See below for the steps needed to properly configure LNA in this example:
109
110
110
-
1. The application configures the LNA to be activated by the timer event, with the start time set to 0 us and the end time set to 40 us.
111
-
#. The application provides the ``rx_end`` event as the LNA deactivation event.
112
-
#. The FEM module reads the scheduled time and sets the ``TIMER0`` compare channel to 27 us, as a result of the RX ramp-up time (40 us) minus the LNA settle time (13 us).
113
-
#. The application starts the RX operation.
114
-
#. The application starts ``TIMER0``.
111
+
1 The application configures the LNA to be activated by the timer event, with the start time set to 0 us and the end time set to 40 us.
112
+
# The application provides the ``rx_end`` event as the LNA deactivation event.
113
+
# The FEM module reads the scheduled time and sets the ``TIMER0`` compare channel to 27 us, as a result of the RX ramp-up time (40 us) minus the LNA settle time (13 us).
114
+
# The application starts the RX operation.
115
+
# The application starts ``TIMER0``.
115
116
116
117
The following picture illustrates the timings in this scenario:
117
118
118
119
.. figure:: pic/FEM_timing_simple.svg
119
120
:alt:Timing of LNA pin for reception
120
121
121
-
Timing of the LNA pin for reception
122
+
Timing of LNA pin for reception
122
123
123
124
The following picture illustrates the calls between the application, the FEM module, and the hardware in this scenario:
124
125
@@ -134,7 +135,7 @@ In the nRF21540 implementation, the PDN pin is used to power down the FEM intern
134
135
The FEM can be powered down on an explicit application request.
135
136
The FEM is powered back up automatically before PA or LNA are activated.
136
137
137
-
The following example controls LNA and PDN during an RX operation, using the following parameters:
138
+
See below for an example of controlling LNA and PDN during Rx operation, using the following parameters:
138
139
139
140
* RX ramp-up time - 40 us
140
141
* LNA settle time - 13 us
@@ -145,23 +146,23 @@ The following example controls LNA and PDN during an RX operation, using the fol
145
146
146
147
The *RX ramp-up time* is the total time scheduled by the application.
147
148
148
-
The steps needed to properly configure LNA and PDN in this example are the following:
149
+
See below for the steps needed to properly configure LNA and PDN in this example:
149
150
150
-
1. The application configures the power-down passing ``rx_end`` as the activation event.
151
-
#. The application configures LNA to be activated by the timer event, with the start time set to 0 us and the end time set to 40 us.
152
-
#. The application provides the ``rx_end`` event as the LNA deactivation event.
153
-
#. The FEM module reads the scheduled time and sets ``TIMER1`` compare channels to 27 us (40-13) and 9 us (27-18).
154
-
#. The application starts the RX operation.
155
-
#. The application starts ``TIMER1``.
151
+
* The application configures the power-down passing ``rx_end`` as the activation event.
152
+
* The application configures LNA to be activated by the timer event, with the start time set to 0 us and the end time set to 40 us.
153
+
* The application provides the ``rx_end`` event as the LNA deactivation event.
154
+
* The FEM module reads the scheduled time and sets ``TIMER1`` compare channels to 27 us (40-13) and 9 us (27-18).
155
+
* The application starts Rx operation.
156
+
* The application starts ``TIMER1``.
156
157
157
158
The following picture illustrates the timing in this scenario:
158
159
159
160
.. figure:: pic/FEM_timing_nRF21540.svg
160
-
:alt:Timing of the LNA and PDN pins for reception
161
+
:alt:Timing of LNA and PDN pins for reception
161
162
162
-
Timing of the LNA and PDN pins for reception
163
+
Timing of LNA and PDN pins for reception
163
164
164
-
The following picture illustrates the calls between the application, the FEM module, and the hardware in this scenario:
165
+
The following picture presents the calls between the application, the FEM module, and the hardware in this scenario:
165
166
166
167
.. figure:: pic/FEM_sequence_nRF21540.svg
167
168
:alt:Sequence diagram of LNA and PDN control for reception
@@ -171,22 +172,19 @@ The following picture illustrates the calls between the application, the FEM mod
171
172
PA gain control
172
173
===============
173
174
174
-
FEM implementations with multiple PA gains available can choose which gain to use.
175
-
176
175
PA switched gain
177
176
----------------
178
177
179
-
Both nRF21540 implementations can control the FEM to select one of two available PA gains without the need to provide any model.
180
-
To do so, the nRF21540 GPIO implementation uses MODE pin switching, while the nRF21540 GPIO SPI implementation performs the appropriate SPI transfers.
178
+
Optionally, both nRF21540 implementations can control the FEM to select one of two available PA gains without the need to provide any model.
179
+
To do so, the nRF21540 GPIO implementation uses MODE pin switching, while the nRF21540 GPIO SPI implementation performs appropriate SPI transfers.
181
180
182
181
To enable this feature for the nRF21540 GPIO implementation, the MODE pin must be enabled in the interface configuration that the application passes on initialization.
183
-
To enable this feature for the nRF21540 GPIO SPI implementation, runtime gain control must be enabled in the interface configuration that the application passes on initialization.
182
+
For the nRF21540 GPIO SPI implementation, runtime gain control must be enabled in the interface configuration that the application passes on initialization.
184
183
185
184
PA Gain control using a built-in compensation model
The nRF21540 GPIO SPI implementation can be used with the built-in model.
189
-
Using this model allows for the compensation of external conditions like temperature, supply voltage and frequency.
190
-
191
-
The model is currently in an :ref:`experimental <nrf:software_maturity>` stage.
192
-
To use this model, MPSL's getter function must acquire the structure containing the model callbacks and then must pass it to MPSL just like all the other models.
187
+
The nRF21540 GPIO SPI implementation can be used with a built-in model.
188
+
Using this model allows for compensation of external conditions like temperature, supply voltage and frequency.
189
+
The model is currently in an experimental stage.
190
+
To use this model, the structure containing the model callbacks needs to be acquired from MPSL by its getter function and then passed to MPSL just like all other models.
0 commit comments