Si4432 wireless chip debugging experience sharing

Publisher:神秘行者Latest update time:2012-08-16 Source: 51heiKeywords:Si4432 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Some time ago, I mainly collected some information about si4432, including chip manuals, schematics, official codes, etc. I debugged the purchased module to see if it can receive data. I am not very clear about the specific configuration and working mode. Now I summarize it as follows:

Silicon Labs EZRadioPRO series ISM band wireless chip SI4432 can work in the 240-960MHZ frequency band. The maximum output power can reach +20DBm. A power amplifier circuit can be added to the periphery to increase the transmission power.

Si4432 mainly consists of shutdown mode, hang-up mode, transmission mode and reception mode. The shutdown state can reduce power consumption. Each mode switch must first enter the hang-up state and then switch. Among them, the hang-up mode assigns different values ​​to the SPI register address 07h, and is divided into five different sub-modes. Standby mode, sleep mode, sensor mode, preparation mode, tuning mode. After power-on reset, or when the chip exits the power-off state, it will enter the preparation mode by default.

There are three main data transmission modes of Si4432, FIFO mode, direct mode, and PN9 mode. In FIFO mode, the on-chip first-in first-out stack area is used to send and receive data. The operation of FIFO is performed by continuous reading or writing of 07H register through SPI. In FIFO mode, Si4432 automatically exits the sending or receiving state when the relevant interrupt signal is generated, and automatically processes the header and CRC check code. When receiving data, the header and CRC check code are automatically removed. When sending data, the header and CRC check code are automatically added. In direct transceiver mode, Si4432 works like a traditional RF transceiver. PN9 mode, in this mode, the Tx data is internally generated using a pseudo-random (PN9 sequence) bit generator. The purpose of this mode is to use it as a test mode to continuously observe the modulation spectrum without having to load/provide data.

The Si4432 module is configured through SPI, which can be configured as FIFO mode and direct mode. It is recommended that Si4432 work in FIFO transceiver mode. In this working mode, the system programming will be simpler and the stability will be higher. However, online comments say that this mode is not as far as the direct mode transmission distance. The configuration of Si4432 mainly includes carrier frequency, modulation mode, data transmission rate, CRC check, preamble, synchronization word, data header, address, etc. For details, please refer to the Si4432 (IA4432) RegisterSettings_RevV-v16 register configuration tool.

As for whether si4432 has remote wireless wake-up, I couldn't find it after reading the manual for a long time. However, a netizen said: "The previous product used CC1100, and there was indeed a problem of abnormal short-distance communication. In open areas, it was <150M (FSK, 9.6k/s, 433M, WOR sleep listening communication mode), and the distance was not enough; then I changed to CC1101+PA, but the instantaneous transmission current was >300mA. Since we are battery-powered, the power consumption is too high. Later, the merchant introduced SI4432. A few days ago, I simply tested the communication distance >330M (433M, 40K/S, GFSK). It may be OK for a longer distance, so I didn't test it. I will do a detailed test next week. In terms of current usage, I think they each have their own advantages. CC1101 has the feature of automatic wireless listening and can realize electromagnetic wave wake-up function, but the communication distance is not enough; while SI4432 has a good communication distance and has its own built-in PA, which can reach +18dB and the transmission current is about 60mA. However, it does not have the function of wireless wake-up and can only rely on its own timer and cooperate with the microcontroller to realize the electromagnetic wave wake-up function, which requires a very high stability of the MCU. "

Si4432 register operation:

Si4432 has a total of 128 registers (0-127), which control the operation of the chip and record the status of the chip. They can be accessed through SPI. The SPI it order is configurable, and its default configuration (MSB first) is the same as the order of the MCU. The command format is a 2-byte structure: read/write flag (1 bit, 0-read, 1-write), register address (7 bits) + data to be written (for read operations, this value must also be present, but it can be any value). Each time, 1/multiple (burst) bytes can be read and written, which are determined by the clock signal. After reading and writing a byte, if the clock continues to be valid, the address will automatically increase by 1, and the next operation will be to read and write the next register. These registers can be accessed and the corresponding initialization code can be generated through the WDS (Wireless Event Suit) provided by Silicon Labs. Registers can only be initialized in the idle state, otherwise, unexpected results may occur. In order to improve the quality of transmission signals, increase the transmission distance and ensure the reliable transmission of data, the system enables data whitening, Manchester encoding, CRC check and GFSK modulation.

State Machine:

The shutdown and idle states are called low-power states, and the idle state can be further divided into five different sub-states, which complete various operations unrelated to wireless data transmission and reception under low power consumption. The transmit (Tx) and receive (RX) states are called active states, which complete the transmission and reception of wireless data. Except for the shutdown state (which can only be set through the I/O pin of the MCU), the remaining states can be set and read through the SPI interface El. The state switching can be achieved through register 07h, and this switching is manifested in two aspects: 1) When one of the bits is set, the state switches immediately; 2) After completing the transmission and reception task, decide which sub-state of the idle state to return to (in this system, it is the sleep state, that is, set enwt=1). The current state can be obtained through register 02h. The normal state of the chip is idle. In order to ensure that no data is missed, the wake-up timer can be used to periodically wake up the chip and enter the melting state (at this time, set the enldm bit in register 08h to 1, and set the values ​​in timing constant registers 14h and 19h). After confirming that there is no data/the data has been received, it returns to the original idle sub-state.

Use ordinary 51 microcontroller IO port to simulate SPI:

SPI read operation function:

unsigned char SPI_Read(void)

{

 

     unsigned char i,rxdata;

     rxdata = 0x00;

     for (i = 0;i < 8;i++)

     {

           rxdata = rxdata<<1;

           RF4432_SCLK=0;

           if (RF4432_SDO==1) //Read the highest bit, save it to the end, and complete the entire byte by left shifting

           {

                rxdata |= 0x01;

           }

           delay_10us(2);  

           RF4432_SCLK=1;

           delay_10us(2);  

      }

      return rxdata;

 

}

SPI write operation function:

void SPI_Write(unsigned char txdata)

{

     unsigned char i;

     for (i = 0;i < 8;i++)

     {

           RF4432_SCLK=0;

           if ((txdata&0x80)==0x80) //Always send the highest bit

           {

           RF4432_SDI=1;

           }

           else

           {

         RF4432_SDI=0;

           }

           txdata = txdata<<1;

           delay_10us(2);  

           RF4432_SCLK=1;

           delay_10us(2);  

     }

}

RF4432 register read operation function:

unsigned char RF4432_ReadReg(unsigned char addr)

{

     unsigned char value;

     RF4432_SEL=0;                 

     SPI_Write(addr|RR);     

     value = SPI_Read();         

     RF4432_SEL=1;        

     return value;

}

RF4432 register write operation function:

void RF4432_WriteReg(unsigned char addr, unsigned char value)

{

     RF4432_SEL=0;                 

     SPI_Write(addr|WR);     

     SPI_Write(value);         

     RF4432_SEL=1;                

}

SI4432 register definition:

#define DEVICE_TYPE 0x00

#define DEVICE_VERSION 0x01 //Version number

…

Refer to attachment.


RF4432

RF chip initialization function, RF4432 receiving mode setting function, RF4432 data packet receiving function, RF4432 data packet sending function, etc. Reference document: si4432 module user manual.pdf. I have compiled these attachments into a compressed package http://www.51hei.com/f/452de.rar You can download it.

The program codes found online and the official codes are mostly based on Silicon Labs' c8051f microcontroller. Although they all have 51 cores, the programming environment and running speed are different. They cannot be directly used to run on ordinary 51s and need to be slightly modified. At present, three code modifications based on ordinary 51 microcontrollers have been completed. One is official, one is given when the module is purchased, and one is found online. There is also a source code based on the pic microcontroller on the Internet, but after reading it, it feels similar to the official one, so I didn't modify it. After the modification, it can run on the 51 development board. However, one of the modules does not work and the effect cannot be seen. It is not certain whether it can be received. Therefore, it stays at this place. Some information can be observed through the serial port, such as the low-level NIRQ interrupt generated after the initialization is completed, and the low-level NIRQ interrupt is also generated after the sending is completed. The program snippet

RF4432_Init()

{

while (RF4432_IRQ== 1); //Wait for soft reset to complete. When soft reset is completed, an interrupt occurs.

…….

}

UART_Send_Str("RF chip si4432 initialization completed....\n"); //Serial port sends debugging information

After normal initialization, you will see the statement "RF chip si4432 initialization completed..." through the serial port. Otherwise, it will stay at while (RF4432_IRQ== 1); and you will not see the information output by the serial port. However, only one module sends and one module receives. Only when you observe that the receiving module receives the data can you prove that the debugging is OK.

Keywords:Si4432 Reference address:Si4432 wireless chip debugging experience sharing

Previous article:ICL7135 (4-bit half-double integral AD) driver backup
Next article:Loop move function of user function library

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号