Point-to-multipoint multi-task wireless communication

Abstract: Introduce the application of wireless communication in various communication systems in detail, the hardware interface design of single chip MCU and wireless transceiver module, the preparation of point-to-multipoint wireless communication protocol, and the software design of point-to-multipoint wireless communication system package . Provides a reliable solution for the hardware and software design of wireless communication systems

introduction

The modern world is a world of high-speed automation. In addition to being able to connect with computers, various devices can also be interconnected. The simplest way to connect automatically is to use serial communication. With the progress of the times, it has not been replaced, but it has gradually been widely used. Nowadays, the wired connection in many occasions can no longer meet the rapid development of technology. Wireless technology is entering many products at a fast speed. Compared with wire, it mainly has low cost, easy to carry, and saves the trouble of wired wiring; it is especially suitable for communication of handheld devices, battery-powered equipment, remote control, telemetry, small Wireless network, wireless meter reading, access control system, community paging, industrial data collection system, wireless tag identification, non-contact RF smart card, small wireless data terminal, security fire prevention system, wireless remote control system, biological signal collection, hydrological and meteorological monitoring, robot Control, wireless 232 data communication, wireless 485/422 data communication, wireless digital voice, digital image transmission, intelligent community non-stop charging, bank smart receipt system, etc. In so many wireless system applications, the protocol of wireless communication is naturally very important. The quality of the wireless communication protocol is directly related to the security, bit error rate and speed of the system. This article takes the STR-2 wireless transceiver module of Shanghai Sangbo Technology Co., Ltd. as an example to introduce in detail the hardware interface design of the wireless transceiver module and various microcontrollers, the digital packaging format, unpacking program and related software of the point-to-multipoint wireless communication protocol. design.

1 System Overview

1.1 Chain point-to-multipoint system

The system shown in Figure 1 is a point-to-multipoint multitasking wireless communication system composed of a central monitoring device (CMS) and multiple remote terminal devices (MRTU (MulTIple Remote Termial Unit)). Between the central monitoring equipment CMS and the remote terminal RTU (Remote Termial Unit), multiple relay equipment Tran is used as a relay station, so as to temporarily store data and extend the distance. Between the transfer stations, data is transferred in one-way communication.

(1) Scope of application

* Multi-point multi-task data collection with long transmission distance;

* Poor conditions, large interference, multi-point multi-task data collection;

* Various complex wireless data transmission with low time requirement;

* Intelligent community water, electricity, coal, heating gas centralized meter reading system, all kinds of remote centralized alarm system, etc.

(2) Protocol data packet format

The first thing of the agreement is to be able to identify noise and valid data. Noise appears in random bytes, and there is no obvious combination; the noise source can produce any combination of bytes. In the process of wireless communication, it is best to effectively suppress the generation of noise through a protocol.

Through tests and experiments, it is found that 0xFF followed by 0xAA and 0x55 are not easy to occur in noise. The transmission protocol should add a start byte before the data packet, 0xFF followed by 0xAA, 0x55 The start of the transmission protocol should be a byte of arbitrary content (this is because the data of the first byte is easily lost when sending), and then 0xFF It is followed by a 0xAA, 0x55; the receiving protocol stipulates that only packets starting with 0xFF followed by 0xAA, 0x55 are received, so the data packet format of the above system can be conveniently set as:

Lead1 Lead2 Lead2 Header Length HosTID Loca DesTInaTIon
Unit Data1 Data2 … Datan Checksum

Lead is the leading byte

Leader1 = 0xFF;

Leader2 = 0xAA;

Leader2 = 0x55;

Header is the command byte of the data packet, thereby determining the type of the data packet;

Length is the length of all bytes after the Length byte contained in the data packet;

HostID is the host address;

Local is the local machine address;

Destination is the target address;

Unit is the RTU address byte;

Data is the data packet byte;

Checksum is a check byte.

1.2 Star-to-multipoint communication

The system in Fig. 2 is a point-to-multipoint multi-task wireless communication system composed of a central monitoring device CMS and multiple remote terminal devices MRTU. The central monitoring equipment CMS and each remote terminal RTU transfer data in two-way communication mode; especially suitable for occasions with large data volume and high time requirements.

(1) Scope of application

* Places with short transmission distance;

* Places with bad conditions and large interference;

* For occasions with high time requirements and large data volume;

* Intelligent community water, electricity, coal, heating gas centralized meter reading system, various remote centralized security alarm systems, etc .;

* Smart home centralized control system;

* Industrial measurement and control, industrial data collection;

* Medical equipment, fitness equipment;

* Data warehouse, smart shopping mall supermarket shopping guide;

* Wireless food ordering system;

* PDA wireless data transmission;

* Water ripple weather monitoring;

* Biological signal acquisition;

* Oil field environment monitoring;

* Bank smart receipt system, etc.

(2) Protocol data packet format

According to Figure 2, the system's data packet format can be defined as:

Lead1 Lead2 Lead2 Header Length Unit
Data1 Data2 … Datan Checksum

Lead is the leading byte

Leader1 = 0xFF;

Leader2 = 0xAA;

Leader2 = 0x55;

Header is the command byte of the data packet, thereby determining the type of the data packet;

Length is the length of all bytes after the Length byte contained in the data packet;

Unit is the RTU address byte;

Data is the data packet byte;

Checksum is a check byte.

2 Hardware design

The core part of the STR-2 RF module of Shanghai Sangbo Electronic Technology Co., Ltd. is nRF401, plus a well-designed internal antenna, which has the characteristics of small size (37mm × 47mm) and low power consumption; the transmission distance is 200m and the maximum transmission rate is 20kb / s; The peripheral interface circuit is simple and can be directly connected to the universal serial port (UART) port of the single-chip microcomputer. Figure 3 shows the hardware block diagram.

The STR-2 RF pin functions are as follows:

VCC——Positive power supply, connect 2.7 ~ 5.25V;

CS——channel selection, CS = 0 is to select working channel 1 (ie 433.92MHz), CS = 1 is to select working channel 2 (ie 433.33MHz);

DOUT——Data output, connect to MCU serial port RXD;

DIN——Data input, connect to MCU serial port TXD;

GND——power ground;

PWR——Energy saving control, PWR = 1 is normal working state, PWR = 0 is low power consumption state;

TXN——Transmit and receive control, when TXN = 1, the module is in transmitting state, and when TXN = 0, the module is in receiving state;

3 Software design

In the system, all STR-2 RF modules use 433.92MHz as the system operating frequency. Taking the star-point-to-multipoint communication system as an example, the software design of the system is introduced in detail.

(1) Main program design

In order to avoid the problem of co-frequency interference, the system adopts Time Division Multiple Access (TDMA) technology, which separates the communication between the system CMS and any RTU in a time-division manner. The CMS scans each RTU device by scanning. Station communication, so that the communication method between CMS and RTU in the system becomes a point-to-point communication method. The communication of the entire point-to-multipoint system becomes a combination of several point-to-point communications. The program is written in C51 microcontroller language, and its main control program flow is shown in Figure 4 and Figure 5.

(2) Packing and unpacking

The protocol divides the main data into data of a certain format and adds some additional information (for error correction). This process is called packaging; at the receiving end, the protocol removes these additional information and leaves only the initial information. This process is called unpacking.

For packaged programs such as unpacking programs, see the supplementary online version (http: //).

The unpacking subroutine flow is shown in Figure 6.

Conclusion

The wireless hardware design and software design solutions in this article have been applied to many products and systems many times. At present, various products and systems operate stably, with low bit error rate, high reliability, and good security. The software and hardware design schemes in this article can be applied to various single-chip computers, and have important reference value for the promotion and wide application of wireless communication technology in China.

Wireless Gaming Keyboard

Wireless Gaming Keyboard is a keyboard disk with no direct physical connection to the computer, through infrared or radio waves to send input information to a special receiver. Bluetooth devices, to be precise. The so-called Bluetooth technology, in fact, is a short-range radio technology, the use of "Bluetooth" technology, can effectively simplify the communication between mobile communication terminal devices such as palm computers, laptops and mobile phones.The so-called Bluetooth technology, in fact, is a short-range radio technology, the use of "Bluetooth" technology, can effectively simplify the communication between handheld computers, laptops, mobile phones and other mobile communication terminal devices, also can successfully simplify the above devices and the Internet communication between the Internet, Thus, the data transmission between these modern communication devices and the Internet becomes more rapid and efficient, which broadens the way for wireless communication. Bluetooth supports point-to-point and point-to-multipoint communication using a decentralized network structure, fast frequency hopping and short packet technology, and works in the 2.4ghz ISM (industrial, scientific, and medical) band used worldwide. Its data rate is 1Mbps. Time division duplex transmission scheme is used to realize full duplex transmission.


Now there is the latest technology 2.4G wireless keyboard and Wireless Gaming Mouse, what is 2.4G, it is actually a wireless transmission technology, 2.4G is on behalf of a data transmission rate, now on the market 2.4G wireless keyboard and mouse is a USB receiver, mini, general plugged in the computer, can be used directly.Bluetooth devices of any brand can be charged in up to three hours. You can usually power off by seeing the indicator on the keyboard change color or turn off. Charging a product for a long time can cause serious damage to it. If you're not using a wireless keyboard for a long time, it's best to charge your device once a month or so. In case its built-in battery goes dormant and cannot be recharged.



04

Wireless Gaming Keyboard,Gaming Mini Keyboard,Wireless Rgb Gaming Keyboard,Wireless Mechanical Gaming Keyboard

Henan Yijiao Trading Co., Ltd , https://www.yjusbcable.com