LR1121
User Manual Rev 1.1
UM.LR1121.W.APP Mar 2023
60 of 130
Semtech
Proprietary & Confidential
www.semtech.com
Gain Tune and Gain Offset values can be determined using an RF generator with the LR1121 hardware implementation as
follows:
1. Setup the device in Gfsk mode and set the desired RF frequency.
2. Setup the device in manual gain mode (disable the AGC (Auto Gain Control)).
3. Use SetRssiCalibration API to set all tunes and offsets to 0.
4. Loop through all the different gains, including LNA boost mode (high power mode):
a. Use the generator to emit a continuous tone at a specific output power gen_pwr (gain dependant), and account
for all cable losses. A direct connection is recommended.
b. Read the instantaneous RSSI (rssi_inst).
c. Calculate the rssi_error = rssi_inst - gen_pwr.
d. Log the rssi_error in a file.
5. Find the common offset between all errors, and use it as the new global offset.
6. Find the individual errors (relative to the new global offset) and use them as the tunes.
7. Call SetRssiCalibration(), and go though the main loop again to check that the instantaneous RSSI is now
calibrated.
Some pseudo-code can be found hereafter:
uint8_t gain[] = { 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
// NB: for the 2G4 path, the max gain is 16 - 17-20 can be ignored.
float power[] = { -35.0, -41.0, -45.0, -50.0, -53.5, -60.0, -65.0, -69.5, -75.0,
-81.0, -82.5, -83.5, -84.0, -85.0, -86.0, -86.5, -87.0 };
/* Configure the chip at the system level */
lr11xx_system_reset( context );
lr11xx_system_set_reg_mode( context, reg_mode );
lr11xx_system_set_dio_as_rf_switch( context, rf_switch_cfg );
lr11xx_system_set_tcxo_mode( context, tune, timeout ); // Optional - only if there is a
TCXO
lr11xx_system_clear_errors( context );
lr11xx_system_calibrate( context, 0x3F ); // 0x3F to enable all fields
/* Configure the chip at the modem level */
lr11xx_radio_set_pkt_type( context, LR11XX_RADIO_PKT_TYPE_GFSK );
lr11xx_radio_set_rf_freq( context, freq_in_hz );
lr11xx_system_calibrate_image_in_mhz( context, freq1_in_mhz, freq2_in_mhz );
lr11xx_radio_set_gfsk_mod_params( context, mod_params ); // Rx BW has to be set to
LR11XX_RADIO_GFSK_BW_234300 - other modulation parameters can be anything
lr11xx_radio_set_gfsk_pkt_params( context, pkt_params ); // Packet parameters can be
anything
/* Configure the chip to be controlled manually */
lr11xx_regmem_write_regmem32_mask( context, 0x00F20214, 0x00080000, 0x00080000 );
lr11xx_regmem_write_regmem32_mask( context, 0x00F20230, 0x71110000, 0x71100000 );