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.
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.
Instantiate the LR1121 module object based on the hardware connections.
Configure the RF switch of the nRFLR1121 board and define the pin level status of DIO5 and DIO6 under different operating modes.
1. Detailed Explanation of Transmitter Code¶
Initialize the serial port and SPI
Initialize the nRFLR1121 module
Set the callback function for packet transmission completion
Set the carrier frequency to 2400.5MHz
Set the bandwidth to 203.125kHz
Set the spreading factor to 10
Set the coding rate to 6
Set the sync word to 0x12
Set the output power to 13dBm
Set the preamble length to 16
Disable CRC checking
Apply RF switch configuration
Set the TCXO voltage
Send the first data packet
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.
2. Detailed Explanation of Receiver Code¶
Initialize the serial port, pins, and SPI
Initialize the LR1121 module
Set the callback function for packet reception completion
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
Start listening for LoRa packets
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).
Data sent successfully from the transmitter
Data printed from the receiver’s serial port
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.
(2) Use the library files we provide.
(3) Pay attention to configuration during the flashing process.