How Si4432, SX1212 wireless modules realize communication (2024)

Realization of Wireless Module Communication Based on Si4432 and SX1212

Foreword

In the process of providing technical support and RF customization for customers, we found that due to functional requirements upgrades and product upgrades, we often encounter problems that modules that need to be embedded with different wireless chips can communicate with each other. The various differences in parameters and data formats make it difficult to know where to start.


This test selects the front-end RF modules RF4432PRO (built-in Si4432 chip) and RF1212 (built-in SX1212 chip) independently developed by NiceRF, and describes the detailed experimental process, hardware interface and related sample programs, hoping to solve the problem between different wireless chips. The communication problem provides a reference method.


NiceRF is a technology, service and sales company focusing on RF and sensor module application development. It has developed a variety of application modules and solutions for different RF chips. The current products cover different power levels such as 20mW, 100mW, 500mW, 1W, 2W, 3W, 5W; SPI, UART (including TTL/RS232/RS485 and USB) and other communication interfaces; 315/ 433/470/868/915 There are hundreds of modules in different operating frequencies such as MHz and 2.4 GHz. Years of precipitation and accumulation make NiceRF have strong R&D strength and rich application experience in the software and hardware of RF applications.

1. Hardware design of experimental system

1.1 Chip performance and features

How Si4432, SX1212 wireless modules realize communication (1)

How Si4432, SX1212 wireless modules realize communication (2)

Figure 1: Block diagram of built-in modules of Si4432 and SX1212 chips

The Si4432 in the RF4432PRO RF module is a high-performance RF transceiver chip developed by Silabs in the United States with a working frequency band below 1GHz, belonging to its EzRadioPro series. It has been widely used in industry, scientific research, medical (ISM) and short-range wireless communication equipment (SRD) in China, and its output power can be as high as +20 dBm, and the receiving sensitivity can also reach -121 dBm.

The SX1212 in the RF1212 wirelessmodule is an ultra-low-power wireless chip developed and produced by Semtech in the United States. The operating frequency ranges from 300MHz to 510MHz. It has been optimized to have very low receiving power consumption. The typical receiving current is 2.6mA, and the operating voltage is 2.1~3.6V, maximum transmit power +12.5 dBm.

The specific parameters can be found in the chip manuals of Si4432 and SX1212. The RF4432PRO and RF1212 modules provide hardware support for the built-in functions of the Si4432 and SX1212 chips. Users can directly program, develop and control the modules according to the chip manual.

RF ModuleRF4432PRORF1212
Frequency Range(MHz)403, 433, 463429, 433, 440
Emission current85mA@20dBm25mA@10dBm
Receive current(mA)18.53
Static power(uA)<1<1
Transmit power range1~20dBm-8.5~12.5dBm
Receive sensitivity-121dBm@data=1.2Kbps-110dBm@data=1.2Kbps,fdev=30KHz

Table 1: Tested NiceRF RF4432 and RF1212 RF Parameters Comparison

2. System hardware design

The experimental system hardware uses NiceRF wireless modules RF4432PRO and RF1212 and their corresponding DEMO demo boards. The RF4432PRO and RF1212 modules contain industrial-grade high-performance chip application circuits that have been rigorously tested. The hardware platform is completed by connecting the modules together through pins. Through the SPI port control of the microcontroller in the DEMO demo board, the two transceiver modules communicate with each other, thereby realizing the wireless transmission of data.

The wireless module DEMO demo board (as shown in Figure 2 below) is a development board developed by NiceRF in conjunction with the front-end wireless transceiver module to facilitate customers to debug programs and test distances. The DEMO demo board has external wireless module pins, and the setting parameters can be saved after power-off. The user can modify the module's operating frequency, transmit power and communication rate and other related parameters through the key settings. The DEMO demo board has 5 working modes, as shown in Table 2.

Table 3 and Table 4 are the pin definitions of the RF1212 module and the RF4432PRO module respectively. For details, please refer to the RF4432PRO specification and RF1212 specification on the NiceRF official website.

How Si4432, SX1212 wireless modules realize communication (3)

Figure 2: NiceRF DEMO demo board and wireless module hardware connection

How Si4432, SX1212 wireless modules realize communication (4)

Figure 3: NiceRF's DEMO demo board LCD interface

Operating modeDescription
Normal launch (main mode) The data packet is transmitted periodically. After successfully transmitting a data packet, the red light is on, and the data is switched to the receiving mode. After receiving the response signal, the blue light is on, and the LCD displays the number of data packets transmitted and received.
Normal reception (slave mode) Receive the data packet, receive the correct blue light, and then transmit the correctly received data packet. After the successful transmission, the red light is on, and the LCD displays the number of received and transmitted data packets.
Often launch (emission test) The module is in the normal transmitting state, the red light is on, and the number of packets is not displayed.
Frequent reception (receiving test)The module is in the normal receiving state, and the corresponding pin outputs the received waveform in real time, and the number of received packets is not counted.
SleepThe RF module is in a sleep state and can test static power consumption in this state.

Table 2: NiceRF's DEMO demo board working mode

Pin No.Pin NameDescription
1GNDGround
2NSS_CONFIGSPI CONFIG enable
3NSS_DATASPI DATA enabling
4MISOSPI data output
5MOSISPI data input
6SCKSPI clock input
7CLKOUTClock output
8DATANRZ data input and output (Continuous mode)
9IRQ_0Interrupt output
10IRQ_1Interrupt output
11PLL_LOCKPLL Lock detect output
12VCCPositive power supply
13GNDAntenna ground
14ANTAntenna

Table 3: Pin definition of NiceRF's RF1212 module

Pin NO.Pin NameDescription
1GNDPower ground
2GPIO0The control pin of the transmitter switch is connected inside the module
3GPIO1The control pin of the transmitter switch is connected inside the module
4GPIO2Connect directly to the GPIO2 pin of the chip
5VCCPositive power supply 3.3V
6SDO0~VDD V digital output, provides serial readback function to internal control register.
7SDISerial data input.0~VDD V digital input. This pin is a 4-wire serial data serial data stream bus.
8SCLKSerial clock input.0~VDD V digital input. This pin provides a 4-wire serial data clock function.
9nSELSerial interface select input pin. 0~VDD V digital input. This pin provides select/enable function for 4-wire serial data bus. This signal is also used to indicate burst read/write mode.
10nIRQInterrupt output
11SDNChip enable pin. 0~VDD V digital input. SDN=0 in all modes except shutdown mode. When SDN=1, the chip will be completely shut down and the contents of the register will be lost.
12GNDPower ground
13GNDPower ground
14ANTConnect with 50 ohm coaxial antenna

Table 4: Pin definition of NiceRF's RF4432PRO module

3. Working principle of wireless module

The transmission and reception of wireless signals is the process of modulating and demodulating the signals. Regardless of whether the same or different wireless modules communicate, the difference in modulation parameters such as the modulation format, modulation rate and frequency, frequency offset and reception bandwidth of the transmitting and receiving parts will lead to the inability to communicate between the wireless modules.

3.1 SPI bus control timing

The communication between the RF4432PRO and RF1212 modules and the microcontroller is that the RF module transmits wireless signals according to the control commands and data written by the microcontroller through the SPI bus, and transmits the received data and its own related information to the microcontroller through the SPI bus. The SPI timing of Si4432 and SX1212 is slightly different.

How Si4432, SX1212 wireless modules realize communication (5)

Figure 4: Si4432 chip SPI write timing

How Si4432, SX1212 wireless modules realize communication (6)

Figure 5: SPI write timing of SX1212 chip

3.2 Test Mode

The DEMO demo boards of NiceRF's RF4432PRO and RF1212 wireless modules have two test modes: always-on and always-off, which are convenient for debugging programs. In the test mode, the SX1212 chip works in the Continuous mode, and the Si4432 works in the Burst write and Burst read modes. The common point of RF4432PRO and RF1212 module in DEMO demo board test mode is that data is continuously transmitted, and the received real-time waveform can be seen on the corresponding pin.

How Si4432, SX1212 wireless modules realize communication (7)

Figure 6: Si4432 burst write mode

How Si4432, SX1212 wireless modules realize communication (8)

Figure 7: SX1212 continuous mode

3.3 Normal Mode

The normal transceiver modes of the DEMO demo boards of NiceRF RF4432PRO and RF1212 wireless modules run in PH+FIFO mode of Si4432 and Packet mode of SX1212 respectively.

Both Si4432 and SX1212 are configured with 64-byte FIFO and corresponding data packet processing functions. In this mode, the chip automatically adds and detects the preamble, synchronization word, checksum, etc., and indicates the communication status through interruption, which greatly facilitates the communication process. For communication in normal mode, it must be ensured that the data packet format settings of the two communication modules are exactly the same, otherwise the chip will not be able to generate an interrupt.

How Si4432, SX1212 wireless modules realize communication (9)

Figure 8: Si4432 packet format

How Si4432, SX1212 wireless modules realize communication (10)

Figure 9: SX1212 packet format

3.4 Summary

Table 5 compares the packet format of Si4432 and SX1212 chips. It can be found that the data packet of Si4432 has two more parts, the header and the data length, and the rest are basically the same. In order to ensure that the two chips can communicate, set the test data packet format as shown in Table 6.

How Si4432, SX1212 wireless modules realize communication (11)

Table 5: Si4432 and SX1212 packet format comparison

How Si4432, SX1212 wireless modules realize communication (12)

Table 6: Test Packet Format

4. Specific debugging process

The radio frequency parameters used in system communication are set as: transceiver frequency 423.0 MHz, frequency offset 50 KHz, and RF rate: 1.2 Kbps. The sent data format is shown in Table 6 above.

To ensure that both the si4432 and sx1212 wireless modules can work properly and provide reference waveforms, first enable the same modules to communicate in the normal mode of the DEMO demo board in this setting.

4.1 Comparing the receiving and transmitting waveforms

The data packet mode is not conducive to the debugging of the program because the chip automatically processes the data and only displays the result. Therefore, we use Shenzhen Siwei Wireless Technology Co., Ltd. DEMO demo board test mode and external pins to judge the quality of communication by synchronously observing the most intuitive way of sending and receiving waveforms.

First test the communication transmitted by the RF1212 module and received by the RF4432PRO module.

Set the GPIO2 of the RF4432PRO as the Rx Data output function output, and set the RF1212 transceiver mode to the continuous mode, so that the received and transmitted data can be output from the GPIO2 and DATA pins in real time. Use a logic analyzer to simultaneously observe the waveforms transmitted and received by the RF1212 and RF4432PRO modules and make corresponding comparisons. As shown in Figure 10, it can be found that there is a corresponding receive waveform for each transmit waveform, which proves that the RF4432PRO receives the data transmitted by the RF1212.

How Si4432, SX1212 wireless modules realize communication (13)

Figure 10: RF1212 transmit and RF4432 receive test waveforms at 423MHz, 1.2Kbps, 50KHz frequency offset

Zoom in on the waveform and observe each receiving waveform, as shown in Figure 11, and find that each RF4432PRO receiving waveform has different deformation compared with the RF1212 sending waveform. The judgment may be that the difference of the chip may cause the demodulation signal to be wrong under some radio frequency parameters.

How Si4432, SX1212 wireless modules realize communication (14)

Figure 11: Two sets of waveforms sent by RF1212 and received by RF4432 at 423MHz 1.2Kbps 50KHz frequency offset

First, adjust the baud rate of the RF4432PRO and RF1212 modules to 2.4kbps. It is found that the RF1212 sending and RF4432 receiving waveforms are relatively consistent, partially distorted, as shown in Figure 12.

How Si4432, SX1212 wireless modules realize communication (15)

Figure 12: RF1212 transmit and RF4432 receive waveforms at 423MHz 2.4 Kbps 50KHz frequency offset

In order to improve the accuracy of the waveform, the baud rate of the RF4432PRO and RF1212 modules is increased to 9.6kbps, and it is found that the RF1212 sending and RF4432 receiving waveforms have been consistent.

How Si4432, SX1212 wireless modules realize communication (16)

Figure 13: RF1212 transmit and RF4432 receive waveforms at 423MHz 9.6Kbps 50KHz frequency offset

If the baud rates of the RF4432PRO and RF1212 modules cannot be adjusted to obtain consistent waveforms, you can try to adjust the RF parameters such as modulation frequency, frequency offset, and bandwidth of the RF4432PRO and RF1212 modules. For example, if the frequency offset of the RF4432PRO and RF1212 modules is adjusted to 20kHz, consistent transmit and receive waveforms can be obtained even at a 1.2k baud rate.

How Si4432, SX1212 wireless modules realize communication (17)

Figure 14 RF1212 transmit and RF4432 receive waveforms at 423MHz 1.2Kbps 20KHz frequency offset

4.2 Packet Mode Reception

The RF4432PRO module receives the same waveform as the RF1212 module sends, so keep the RF parameters and set the working mode of the NiceRF DEMO demo board to normal mode to see if the chip can be interrupted. As shown in Figure 15, the Si4432 generates a receive interrupt. Continue to send for a period of time and find that there is no packet loss.

How Si4432, SX1212 wireless modules realize communication (18)

Figure 15: 423MHz 9.6Kbps 50KHz frequency offset RF1212 continuous mode and RF4432 packet mode reception

If there is no receiving interruption, you can find out the problem by comparing the difference between the receiving waveforms of the receiving module and the same module that can communicate normally. As shown in Figure 16, comparing the received waveform transmitted by RF1212 and the waveform transmitted by RF4432PRO, it is found that the RF1212 transmission waveform is interrupted and missed a section, and it is judged that the synchronization word of the data packet is wrong.

How Si4432, SX1212 wireless modules realize communication (19)

Figure 16: 423MHz 9.6Kbps 50KHz frequency offset RF1212 transmit and RF4432 transmit waveforms

4.3 Overall flow chart

How Si4432, SX1212 wireless modules realize communication (20)

Figure 17: RF4432PRO and RF1212 communication debugging flow chart

5. Experimental results

5.1 Hardware Results

The RF1212 works in the normal transmit mode of the NiceRF DEMO demo board, and the RF4432PRO works in the normal receive mode of the DEMO demo board. The number of packets sent and received is displayed on the screen. As shown in Figure 18, there is no packet loss after sending for a period of time.

How Si4432, SX1212 wireless modules realize communication (21)

Figure 18: Physical diagram of RF4432PRO (left) and RF1212 communication

5.2 Software Results

In Figure 19, 4432_IRQ is the interrupt pin of RF4432PRO, and RF1212_IRQ0 and RF1212IRQ1 are the receive and transmit interrupt pins of RF1212, respectively. It can be seen that each transmit interrupt has a corresponding receive interrupt.

How Si4432, SX1212 wireless modules realize communication (22)

Figure 19: RF4432PRO and RF1212 Communication Interruption

6. Sample program

The key to the experiment lies in the initial setting part of the RF4432PRO and RF1212 modules, and the rest are consistent with the communication procedures between the same modules. The communication between the RF4432PRO and RF1212 modules can be realized by directly substituting the following testable RF4432PRO and RF1212 module initialization codes into the communication program. The complete test program used in this experiment can be found in the RF4432 DEMO CODE and RF1212 DEMO CODE on the NiceRF official website.

6.1 RF4432PRO initialization example

  void SI4432_init(void)

  {

  ItStatus1 = spi_rw(0x03,0x00); // clr RF interrupt factor

  ItStatus2 = spi_rw(0x04,0x00);

  SpiWriteCfg(0x06|0x80, 0x00); // Set RF interrupt

  SpiWriteCfg(0x07|0x80, SI4432_PWRSTATE_READY); // enter ready mode

  SpiWriteCfg(0x09|0x80, 0x7f); // load cap = 12P

  SpiWriteCfg(0x0a|0x80, 0x05); // output clk set

  SpiWriteCfg(0x0b|0x80,0x1f);

  SpiWriteCfg(0x0c|0x80,0x1f);

  SpiWriteCfg(0x0d|0x80, 0xf4); // GPIO 2 = rx data

  SpiWriteCfg(0x70|0x80, 0x2c);

  SpiWriteCfg(0x1d|0x80, 0x40); // enable afc

  // 9.6K bps setting

  SpiWriteCfg(0x1c|0x80,0xab); // according to Silabs's excel

  SpiWriteCfg(0x20|0x80,0x39);

  SpiWriteCfg(0x21|0x80,0x20);

  SpiWriteCfg(0x22|0x80,0x68);

  SpiWriteCfg(0x23|0x80,0xdc);

  SpiWriteCfg(0x24|0x80,0x00);

  SpiWriteCfg(0x25|0x80,0x2a);

  SpiWriteCfg(0x2a|0x80,0x24);

  SpiWriteCfg(0x72|0x80,0x50);

  SpiWriteCfg(0x6e|0x80,0x4e);

  SpiWriteCfg(0x6f|0x80,0xa5);

  //9.6K bps setting end

  SpiWriteCfg(0x30|0x80, 0x88); // enable PH+ FIFO, disable crc, msb

  SpiWriteCfg(0x32|0x80,0x00);

  SpiWriteCfg(0x33|0x80,0x02); // packet length is not included

  SpiWriteCfg(0x34|0x80, 16); // preamble = 16 nibbles

  SpiWriteCfg(0x35|0x80, 0x2a); // preamble detection = 2a bit

  SpiWriteCfg(0x36|0x80,'s'); // sync word = 0x7377

  SpiWriteCfg(0x37|0x80,'w');

  SpiWriteCfg(0x3e|0x80, 10); // length of payload = 10

  SpiWriteCfg(0x43|0x80,0x00);

  SpiWriteCfg(0x44|0x80,0x00);

  SpiWriteCfg(0x45|0x80,0x00);

  SpiWriteCfg(0x46|0x80,0x00); // disable Header 3 2 1 0

  SpiWriteCfg(0x6d|0x80, 0x07); // maximum ouput power

  SpiWriteCfg(0x79|0x80, 0x0); // non hop

  SpiWriteCfg(0x7a|0x80, 0x0); // non hop

  SpiWriteCfg(0x71|0x80, 0x22); // FiFo, FSK , not need clk

  SpiWriteCfg(0x72|0x80, 0x50); // deviation: 50KHz

  SpiWriteCfg(0x73|0x80, 0x0); // no frequency offset

  SpiWriteCfg(0x74|0x80, 0x0); // no frequency offset

  SpiWriteCfg(0x75|0x80,0x52);

  SpiWriteCfg(0x76|0x80,0x4b);

  SpiWriteCfg(0x77|0x80,0x00); // frequency:423 MHz

}

6.2 RF1212 initialization example

  void sx1212_init (void)

  {

  SPI_nss_cfg=1; //spi init

  SPI_nss_dat=1;

  SPI_mosi=1;

  SPI_sck=0;

  SetRFMode(RF_SLEEP);

  SpiWriteCfg(((0x00<<1)&0x3E),0x0c); // Frequency band between 400MHz and 440MHz

  SpiWriteCfg(((0x01<<1)&0x3E),0xa0); // FSK, packet mode

  SpiWriteCfg(((0x02<<1)&0x3E),0x07); // Fdev=50kHz

  SpiWriteCfg(((0x03<<1)&0x3E),0x16);

  SpiWriteCfg(((0x04<<1)&0x3E),0x1c); // bit rate=9.6kbps

  SpiWriteCfg(((0x06<<1)&0x3E),0x77); // Frequency=423.0MHz

  SpiWriteCfg(((0x07<<1)&0x3E),0x2e);

  SpiWriteCfg(((0x08<<1)&0x3E),0x00);

  SpiWriteCfg(((0x0c<<1)&0x3E),0xc5); // FIFO size = 64 bytes

  SpiWriteCfg(((0x10<<1)&0x3E),0xa3); // RX passivefilter=378kHZ

  SpiWriteCfg(((0x11<<1)&0x3E),0x38); // Central frequency of the polyphase filter=100kHz

  SpiWriteCfg(((0x12<<1)&0x3E),0x28); // SyncByte = 2 Bytes

  SpiWriteCfg(((0x16<<1)&0x3E),0x73); // SyncByte1= 0x73

  SpiWriteCfg(((0x17<<1)&0x3E),0x77); // SyncByte2= 0x77

  SpiWriteCfg(((0x1a<<1)&0x3E),0x72); // Tx Interpolation filter cut off frequency = 200kHz, TX power = 9.5 dBm

  SpiWriteCfg(((0x1b<<1)&0x3E),0x00); // disable CLK out

  SpiWriteCfg(((0x1c<<1)&0x3E),0x0b); // packet size = 11 bytes

  SpiWriteCfg(((0x1e<<1)&0x3E),0x60); // no CRC

}

7. Summary

This paper describes the detailed implementation process, hardware interface and sample program of the communication between NiceRF's wireless modules RF4432PRO and RF1212, which are verified by experiments. The basic method to realize communication is to set the same RF parameters and data format to RF4432PRO and RF1212. This method can also be extended to the communication of other different wireless modules and wireless chips. If you encounter different experimental phenomena from the text, have questions about the experimental process or other ideas, please feel free to communicate with us.

How Si4432, SX1212 wireless modules realize communication (2024)

References

Top Articles
Latest Posts
Article information

Author: Margart Wisoky

Last Updated:

Views: 6006

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Margart Wisoky

Birthday: 1993-05-13

Address: 2113 Abernathy Knoll, New Tamerafurt, CT 66893-2169

Phone: +25815234346805

Job: Central Developer

Hobby: Machining, Pottery, Rafting, Cosplaying, Jogging, Taekwondo, Scouting

Introduction: My name is Margart Wisoky, I am a gorgeous, shiny, successful, beautiful, adventurous, excited, pleasant person who loves writing and wants to share my knowledge and understanding with you.