Skip to content

Elecrow nRFLR1121 Wireless Transceiver Module - Integrates Nordic nRF52840 and Semtech SX1121 2.4G Band Transceiver Application Document

This document provides a detailed introduction on how to use the ''RadioLib'' library to implement 2.4G band LoRa packet transmission and reception functionality based on the nRFLR1121 module. The solution includes example code for both transmission and reception. The transmitter periodically sends data packets, while the receiver listens in real-time and processes the received packets. By configuring the module parameters appropriately, data can be transmitted stably and accurately over the 2.4G band.

As shown in the figure below, prepare two nRFLR1121 modules and connect them to the computer respectively. After uploading the code, you can view the data sent by the transmitter on the receiver.

1

First, open the code files.


The GitHub download link for the code of this lesson is https://github.com/Elecrow-RD/Elecrow-nRFLR1121-Wireless-Transceiver-Module. Please find the corresponding code in the "example" folder within the link.

The "nRFLR1121_Transmit_Interrupt" file is used for sending data.

The "nRFLR1121_Receive_Interrupt" file is used for receiving data.

img

Instantiate the LR1121 module object based on the hardware connections.

img

Configure the RF switch of the nRFLR1121 board and define the pin level status of DIO5 and DIO6 under different operating modes.

img

1. Detailed Explanation of Transmitter Code

Initialize the serial port and SPI

img

Initialize the nRFLR1121 module

img

Set the callback function for packet transmission completion

img

Set the carrier frequency to 2400.5MHz

img

Set the bandwidth to 203.125kHz

img

Set the spreading factor to 10

img

Set the coding rate to 6

img

Set the sync word to 0x12

img

Set the output power to 13dBm

img

Set the preamble length to 16

img

Disable CRC checking

img

Apply RF switch configuration

img

Set the TCXO voltage

img

Send the first data packet

img

In the ''loop'' function, check if the data packet has been sent. If completed, output the information according to the sending status, clear the transmission operation, and send the next data packet after a delay.

img

2. Detailed Explanation of Receiver Code

Initialize the serial port, pins, and SPI

img

Initialize the LR1121 module

img

Set the callback function for packet reception completion

img

Note: The configuration parameters are the same as the transmitter, including carrier frequency, bandwidth, spreading factor, coding rate, sync word, output power, preamble length, and CRC checking.

Apply RF switch configuration and set the TCXO voltage

img

Start listening for LoRa packets

img

In the "loop" function, check if a packet has been received. If so, read the data and output information according to the reception status, including packet content, received signal strength (RSSI), and signal-to-noise ratio (SNR).

img

img

Data sent successfully from the transmitter

img

Data printed from the receiver’s serial port

img

Finally, there are some important notes during actual operation:


(1) Since the nRFLR1121 uses the nRF52840 as the main control chip, you need to install the nrf52 development board.

img

(2) Use the library files we provide.

img

(3) Pay attention to configuration during the flashing process.

img