Product Overview
The Ra-01SCH-P is a LoRa series module designed and developed by Ai-Thinker. This module is used for ultra-long-distance spread spectrum communication.
Its RF chip LLCC68+ primarily uses the LoRa™ long-range modem for ultra-long-distance spread spectrum communication, with strong anti-interference capability and minimal current consumption. Leveraging Semtech's patented LoRa™ modulation technology, the module integrates a Power Amplifier (PA) and Low Noise Amplifier (LNA), achieving high sensitivity exceeding -137dBm and +29dBm transmit power for long transmission distances and high reliability.
Meanwhile, compared with traditional modulation technology, LoRa™ modulation technology also has obvious advantages in anti-blocking and selectivity, solving the problem that traditional design solutions cannot simultaneously balance distance, anti-interference, and power consumption.
Application Scenarios
It can be widely used in automatic meter reading, home and building automation, security systems, remote irrigation systems, etc.
Features
- Supports FSK, GFSK, LoRa® modulation methods;
- Supports frequency band 803MHz~930MHz;
- Maximum transmit power is optional
① Default configuration: internal PA uses 3.3V supply voltage; in this state, Tx Power can reach up to +29dBm with an operating current of 750mA;
② Optional configuration: internal PA uses 5V supply voltage; in this state, Tx Power can reach up to +31dBm with an operating current of 1A;
- High sensitivity: as low as -137dBm@SF10 125KHz;
- Extremely small size 17163.2(±0.2)MM, dual-row stamp hole patch package;
- Supports spreading factors SF5/SF6/SF7/SF8/SF9/SF10/SF11;
- Low power consumption in receiving state, with receive current as low as 16mA;
- Module uses SPI interface, half-duplex communication, with CRC, up to 256-byte packet engine;
- Supports multiple antenna installation methods, compatible with half-hole pads/through-hole pads/IPEX connector;
I. Software and Hardware Introduction
1. Code Download and Analysis
Obtain the relevant demo through the following link: https://aithinker-static.oss-cn-shenzhen.aliyuncs.com/docs/example/LLCC68-Ra-01SC-P_Ra-01SCH-P_Driver-V1.0.1.zip
The NVIC_PriorityGroupConfig() function configures the interrupt priority grouping to 4, allocating all 4 bits for preemptive priority; PB12 pin is configured as a light control pin to indicate when the program sends or receives data; the clock is configured to execute the interrupt function every 1ms, with the interrupt function content shown below.
Where the functions ExampleLLCC68ReciveDemo() and ExampleLLCC68SendDemo() are used to set the Ra-01SCH-P module to select whether to use the module for receiving or sending.
1) ExampleLLCC68ReciveDemo() Function
The content of the ExampleLLCC68ReciveDemo() function is shown below:
Five callback functions are registered:
- LLCC68OnTxDone(): Callback function executed when data transmission is completed;
- LLCC68OnRxDone(): Callback function executed when data reception is completed;
- LLCC68OnTxTimeout(): Callback function executed after data transmission timeout;
- LLCC68OnRxTimeout(): Callback function executed after data reception timeout;
- LLCC68OnRxError(): Callback function executed after data reception error;
The Radio.Init( &LLCC68RadioEvents ) function registers the above five callback functions.
The Radio.SetChannel(LORA_FRE) function is used to set the RF frequency of the Ra-01SCH-P module.
The Radio.SetTxConfig( MODEM_LORA, LORA_TX_OUTPUT_POWER, 0, LORA_BANDWIDTH, LORA_SPREADING_FACTOR, LORA_CODINGRATE, LORA_PREAMBLE_LENGTH, LORA_FIX_LENGTH_PAYLOAD_ON, true, 0, 0, LORA_IQ_INVERSION_ON, 3000 ) function is used to set the TX mode parameters of the Ra-01SCH-P module.
Function parameters:
LoRa mode, transmit power, FSK mode parameter (set to 0 for LoRa mode), bandwidth, spreading factor, error correction coding rate, preamble length, fixed-length packet (default false), CRC check, 0 means frequency hopping disabled, number of symbols between frequency hops (meaningless when frequency hopping is disabled).
OCP_Value = Radio.Read(REG_OCP) reads the current maximum value of the over-current protection setting;
The Radio.SetRxConfig( MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR, LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH, LORA_LLCC68_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON, 0, true, 0, 0, LORA_IQ_INVERSION_ON, false ) function is used to set the RX mode parameters of the Ra-01SCH-P module.
Function parameters:
LoRa mode, bandwidth, spreading factor, coding rate, automatic frequency bandwidth control, preamble length, symbol timeout time (maximum time the receiver waits for the next symbol to arrive), whether packet length is fixed, payload length, whether CRC check is enabled, whether frequency hopping is enabled, frequency hopping period (requires frequency hopping to be enabled, otherwise invalid), whether to invert I/Q components, whether to enable continuous reception;
Radio.Rx( 0 ) enters receive mode. The function implementation is shown below:
Radio.IrqProcess( ) is the event processing function that determines whether events have occurred. It can judge events: TX_DONE, RX_DONE, CRC_ERROR, CAD_DONE, RX_TX_TIMEOUT, PREAMBLE_DETECTED, SYNCWORD_VALID, HEADER_VALID, HEADER_ERROR. The function implementation is shown below:
delay_ms(1) delays 1ms to check once whether an event has occurred;
2) ExampleLLCC68SendDemo() Function
The ExampleLLCC68SendDemo() function is a timed transmission function.
The difference from the ExampleLLCC68ReciveDemo() function is inside the while() loop. Get_Systicket() is used to get the current program running time (ms).
if(0==u32_count###/span#<1000){
printf("systick=%d ,send u32 data:%d\r\n", Get_SysTick(),u32_count);
if(0==u32_count###/span#<2000){
Radio.Send((uint8_t *)&u32_count,4);
}else{
Radio.Send((uint8_t *)sendData,(strlen(sendData)+1));
}}
u32_count++;delay_ms(1);
The above code sends data every 2 seconds, sending a count value every 2 seconds. The send function implementation is shown below:
2. Hardware Introduction
The general IO pins of LLCC68+ are all available in LoRa™ mode. Their mapping relationship depends on the configuration of the RegDioMapping1 and RegDioMapping2 registers.
1) Special Pin Description
About VCCPA Pin
The internal PA of the module supports multiple supply voltages. With 3.3V supply, the module's maximum transmit power can reach +29dBm; with 5V supply, the module's maximum transmit power can reach +31dBm;
The module's default BOM configuration uses the module's 3V3 pin for PA power supply. Simply leave the module's VCCPA pin floating;
If the PA uses 5V power supply, please contact Ai-Thinker to modify the module BOM and provide 5V power supply to the module's VCCPA pin;
About RF_EN Pin
RF_EN is the enable pin for the module's built-in PA chip. When this pin is high, the module's RF is in normal transceiver state; when this pin is low, the module's RF function is turned off, which can reduce the module's power consumption.
The module's default BOM has an internal 10K pull-up resistor (i.e., default is normal transceiver state). For low-power application scenarios, please use an external MCU to control this pin to a low level. In a low-level state, the pin's default pull-up resistor may have leakage current. If the internal pull-up resistor is not needed, please contact Ai-Thinker to modify the BOM.
In summary, the module has four BOM configurations:
- Configuration 1: VCCPA floating, RF_EN with internal 1M pull-up resistor (default BOM configuration)
- Configuration 2: VCCPA floating, RF_EN without internal pull-up resistor
- Configuration 3: VCCPA connected, RF_EN with internal 1M pull-up resistor
- Configuration 4: VCCPA connected, RF_EN without internal pull-up resistor 1M
2) Typical Application Circuit
The module's VCCPA is floating by default. If you need a 5V power supply to achieve higher transmit power, please contact Ai-Thinker to modify the BOM.
It is recommended that the external MCU's IO pin control the module's RF_EN to achieve low-power application scenarios.
3) Other Notes
In addition to the SPI interface for communication with the main control MCU, BUSY/DIO1 should also be connected to the main control MCU's IO pins.
When the antenna is soldered on the main control board, it is recommended to reserve a pi-type matching circuit at the antenna interface.
3. Antenna Installation
The Ra-01SCH-P needs to be used with an external antenna. The module has half-hole pads that can be routed to the main board.
For optimal antenna performance, the antenna installation position should be kept away from metal parts.
The antenna installation structure has a significant impact on module performance. Ensure the antenna is exposed, preferably vertically upward. When the module is installed inside a housing, a high-quality antenna extension cable can be used to extend the antenna outside the housing.
The antenna must not be installed inside a metal shell, as this will greatly weaken the transmission distance.
4. Power Supply
Recommended 3.3V voltage with peak current above 1A;
If using DC-DC, it is recommended to keep ripple within 100mV.
DC-DC power supply circuit is recommended to reserve positions for dynamic response capacitors to optimize output ripple when load changes significantly.
It is recommended to add ESD devices at the 3.3V power interface.
When designing the power supply circuit for the module, it is recommended to retain more than 30% current margin, which is beneficial for long-term stable operation of the whole device.
Please pay attention to the correct connection of the power positive and negative poles. A reverse connection may cause permanent damage to the module.
5. Software Notes
The FEM chip's maximum input power must not exceed +15dBm, otherwise the FEM chip may be damaged. Users must strictly configure the LLCC68's output power, with 0dBm-3dBm recommended;
This module is LLCC68+peripheral circuits. Users can operate it completely according to the LLCC68 chip manual;
DIO1/DIO2 are general-purpose IO pins that can be configured into multiple functions;
The RF switch TX/RX control can be controlled by external MCU, or jointly controlled by external MCU and LLCC68's DIO2;
Differences between LLCC68 and SX1262/SX1268:
- SX1262/SX1268 support spreading factors SF5, SF6, SF7, SF8, SF9, SF10, SF11, SF12; SX1262/SX1268; Configurable spreading factors and receive bandwidth; LoRa@ Rx/Tx, BW = 7.8 - 500 kHz; SF5 TO SF12, BR=0.018 - 62.5 Kb/S;
- LLCC68 supports spreading factors SF5, SF6, SF7, SF8, SF9, SF10, SF11; LLCC68 configurable spreading factors and receive bandwidth; LoRa@ Rx/Tx, BW = 125 - 250 - 500 kHz; LoRa@, SF=5-6-7-8-9 for BW=125kHz; LoRa@, SF=5-6-7-8-9-10 for BW =250 kHz; LoRa@, SF=5-6-7-8-9-10-11 for BW=500 kHz;
III. Usage Introduction
1. Preparation
- Two Ra-01SCH-P modules;
- Multiple DuPont wires;
- Two USB-to-TTL tools;
- Ra-01SCH-P Demo;
- ST-Link programming tool;
- STM32F103C8T6 development board * 2;
Note: If higher transmit power is needed, use 5V to power the PA by providing 5V voltage to the VCCPA pin; (The module uses internal 3.3V for PA power supply by default)
2. Program Flashing
1) Flash Receiver Program
Then connect ST-Link to the STM32 development board, compile and flash;
2) Flash Transmitter Program
Then connect ST-Link to the STM32 development board, compile and flash;
IV. Demonstration
1. Serial Port Debugger Communication Log Information
Left side is the module in transmit mode, right side is the module in receive mode;
2. Module Communication LED Indicator During Operation
Video: LED Demonstration
Ai-Thinker