Application Design of MSC1210 in GPRS Wireless Communication System

introduction

This article refers to the address: http://

In recent years, the rapid development of communication technology and network technology, especially the development of wireless communication technology, has further improved the automation of power systems. After the emergence of GSM network, technicians quickly embedded the GSM module into various instruments and meters (such as Multi-function energy meter, fault recorder, meter reading system and power load monitoring, etc., so that these instruments have remote communication functions.

GPRS is a new data bearer service developed on the existing GSM system. It supports the TCP/IP protocol and can directly communicate with the packet data network (Internet, etc.). The GPRS wireless transmission system has a wide range of applications. It can cover almost all medium and low traffic and low rate data transmission, especially for bursty small traffic data transmission services.

The GPRS wireless communication module designed in this paper embeds the TCP/IP protocol and adopts the industrial-grade GPRS module. It is suitable for the case where the single-chip data acquisition and transmission system does not have a TCP/IP protocol stack, but uses serial communication.

GPRS communication principle and application characteristics

â—‡ Introduction to GPRS

GPRS is an abbreviation of General Pacpet Radio System, which is a communication technology between the second generation and the third generation, usually called 2.5G. GPRS uses the same frequency band, bandwidth, burst structure, wireless modulation standard, FM rules and the same TD-MA frame structure as GSM. Therefore, when building a GPRS system based on the GSM system, most of the components of the GSM system do not need hardware changes, only software upgrades are required. With GPRS, the call setup time of the user is greatly shortened, and almost can be achieved. always online". In addition, GPRS is billed based on the amount of data transmitted by the operator rather than the connection time, thereby making each user's service cost lower.

â—‡ Basic working principle

GPRS introduces two new network nodes on the original circuit-switched (CSD)-based GSM network: GPRS Service Support Node (SG-SN) and Gateway Support Node (GGSN). The SGSN and the MSC are at the same level, and track the storage unit of a single MS to implement security functions and access control, and connect to the base station system through frame relay. The GGSN supports interworking with the external packet switching network and passes the IP-based GPRS backbone. The network is connected to the SGSN. Figure 1 shows the block diagram of the connection between GPRS and the Internet.

11.jpg

The GPRS terminal obtains data from the client system through the interface, and the processed GPRS packet data is sent to the GSM base station. After the packet data is encapsulated by the SGSN, the SGSN communicates with the gateway support node GGSN through the GPRS backbone network, and the GGSN processes the packet data accordingly. Then send it to the destination network, such as the Internet or X.25 network.

If the packet data is sent to another GPRS terminal, the data is generally sent by the GPRS backbone network to the SGSN and then sent to the GPRS terminal via the BSS.

Hardware design of GPRS module

The embedded GPRS wireless communication module is mainly composed of a single chip embedded in TCP/IP (MSC1210Y5), GPRS module, SIM card holder, external interface and extended data memory. Figure 2 is a block diagram of its system hardware.

22.jpg

The MSC1210 is mainly used to control the information receiving and transmitting of the GPRS module, and communicates data through a standard RS232 serial port and an external controller (such as a data acquisition terminal), and implements interruption by software to complete data forwarding.

â—‡ MCU module

The MCU adopts the latest MCS1210Y5 based on 8051 core from Texas Instruments. The chip has strong data processing capability, the clock frequency is 33MHz, and the command running speed is actually equivalent to the standard 8051 core running at 99MHz clock frequency. 32KB Flash Program memory, 256B internal RAM and 1024B on-chip SRAM, 2KB boot ROM, support serial and parallel in-system programming, dual data pointers DPTR0 and DPTR1 can speed up the movement of data blocks, the main implementation process is as follows:

(1) Initialize the GPRS wireless module by the AT command, and attach it to the GPRS network to obtain the GPRS terminal IP address dynamically allocated by the network operator, and establish a connection with the destination terminal.

(2) Extend the MAX232 standard serial port to the external controller (such as the data acquisition terminal) through the serial port 0. The external controller terminal is connected to the standard serial port, and the controller of the design can be easily communicated according to the agreed protocol.

(3) Multiplexing P1.2 and P1.3, that is, serial port 1 is connected with TXD0 and RXD0 of GPRS module respectively, and the other six ports of P1 port are respectively connected to the remaining RS232 communication ports corresponding to GPRS module. The initialization of the MC35 and the transmission and reception of data by the GPRS module are completed by software setting.

â—‡ Extended data storage

The flash memory of the MSC1210 can be used as the Flash program memory, or all of them can be used as the data flash program. Because the real-time operating system and the network protocol are embedded, a certain space is required, so all of them are used as the program memory, and the 74HC573 is used as the address latch. As the external data memory, the 8264 data storage space is enough for the program to run normally. Figure 3 shows the hardware connection diagram between the MSC1210 and the data memory.

33.jpg

GPRS GPRS wireless data transmission module

As the wireless transceiver module of the terminal, the GPRS wireless module processes the packet data transferred from the IP packet or the base station sent by the single chip microcomputer and then forwards the packet data.

The GPRS module uses the MC35 module produced by the German company Simens. The MC35 module consists primarily of an RF antenna, internal Flash, SRAM, GSM baseband processor, matching power supply and a 40-pin ZIF socket. The GSM baseband processor is a core component that acts as a protocol processor for processing external systems to send AT commands through the serial port. The RF antenna portion mainly implements signal modulation and demodulation, as well as external RF signals and internal baseband processors. The signal conversion between the matching power supplies provides the required power for the processor-based RF section. The peripheral circuit of the MC35 is shown in Figure 4.

44.jpg

In the figure, the external voltage is converted to a 3.3V operating voltage by the AS2815. The start-up circuit in the system consists of a triode and a power-on reset circuit. After the module is powered up, a low-level signal of at least 100ms must be added to pin 15 for power-up. After startup, the 15-pin signal should remain high.

The MC35 has six pins reserved for the SIM card interface on the ZIF connector. It should be noted that the CCIN pin is used to detect whether the SIM card has a SIM card inserted. When the SIM card is inserted, the pin is set to When the level is high, the system can enter normal operation.

The SYNC pin has two modes of operation: one is to indicate the power increase in the transmit state, and the other is to indicate the MC35's workgroup status. The latter mode is used in this design. When the LED is off, the MC35 is turned off or Sleep state; when the LED is 600ms bright / 600ms off, it indicates that the SIM card is not inserted or the MC35 is performing network login; when the LED is 75ms bright / 3s off, it indicates that the MC35 has logged into the network and is in the standby state.

MCU communication program design

All the code in the program software is written in C language and compiled in the Keil environment. Keil is a special development tool provided by Keil Software for the 8051 and its compatible products. It supports debugging in the system. The C51 decoder in Keil is very good. The RTX multi-tasking real-time operating system is integrated. When writing a program, add "#incluede rtx51.h" to the source code header. All code is debugged and downloaded to memory via TI Downloader.

At present, most GPRS modules used in GPRS network application systems do not support the TCP/IP protocol. That is to say, in order to work at the same network level, the data transmitted internally must use the same protocol, so In addition to the functions of the GPRS module, programs written in accordance with the TCP/IP and PPP protocol standards must be embedded in the MCU system, so that the designed terminal device can conveniently apply the GPRS data packet service.

嵌入 Embedding of TCP/IP protocol

There are many ways to complete the protocol conversion. This design utilizes the migration of some IP and PPP protocols in the embedded real-time operating system RTX51 to enhance the scalability of the system and the continuity of product development.

The TCP/IP protocol is a standard protocol suite that can be described by a hierarchical model. When data is packed and processed, each layer adds its own information to a data header, and this data header is used by the protocol in the next layer. Wrapped into the data body. When the data unpacking process receives the GPRS data, it strips the corresponding data header and treats the rest of the data packet as a data body.

Considering the characteristics of the embedded system, this design uses the IIP+UDP protocol with low system overhead to implement GPRS communication. The UDP data packet sent by the host is transmitted to the GPRS communication module via the GPRS channel, and the GPRS communication module is responsible for the datagram. After parsing, the parsed data is serially transmitted to the user terminal at a certain baud rate.

â—‡ Data processing

The data packets are transmitted in the host and GPRS server group using IP-based packets, that is, all data packets are based on IP packets, but it is not acceptable to transmit IP packets in plain text. Therefore, the PPP protocol is generally used for transmission, and the PPP message sent by the module to the gateway is transmitted to the corresponding address in the Internet. The response frame transmitted from the Internet will also be transmitted to the GPRS module according to the IP address, thereby realizing the transparent transmission of the collected data and the Internet network through the GPRS module.

It should be noted that the GSM network does not have a static IP address, so other communication devices cannot make a connection request to it. The monitoring center must have a fixed IP, so that the monitoring terminal can find the monitoring center through the IP after logging in to the GSM network. This is easy to solve, just apply for the corresponding service in telecommunications.

After logging in to the GSM network, the GPRS module automatically connects to the data center, reports its IP address to the data center, and maintains and maintains the connection of the data link. The connection of the GPRS monitoring link, once an abnormality occurs, the GPRS module automatically re-establishes the chain. The data, the data center and the GPRS module can communicate bidirectionally through the UDP/IP protocol through the I address, enabling transparent and reliable data transmission.

The design of the upper computer monitoring center

The function of the monitoring center is to realize the receiving and saving of GPRS information. The design language adopts Microsoft Visual C++ programming language. The C++ language is flexible and powerful, and has strong support for network programming and database.

Since the monitoring part of the GPRS center can directly access the Internet, the monitoring part does not need to set the GPRS module. The center only needs to listen to the network through the central software, receive the IP packet of the UDP protocol transmitted by the GPRS wireless module, and send the control information of the upper computer. to achieve with an IP protocol communication GPRS terminal. To save the received information to a central database, the historical record for future reference. Access database using, prepared with VC interface window can promote the AD () to access data in Access, the network terminal may also receive information via Socket.

Socket interface is a TCP / IP network of the API, Socket interface defines a number of routines and functions, the programmer can use to develop applications on the TCPIP network, the MFC in the VC column is provided a socket CAsyncSocket class, with it is very easy to achieve Socket programming, the present design uses packet type data Socket, which is a connectionless Socket, corresponding to UDP is connectionless services.

CAsyncSocket using DoCallBack function to process MFC message, when a network event occurs, DoCallBack function according to the network time type FD_READ, FD_WRITE, FD_ACCEPT and FD_CON-NECT respectively call OnReceive, OnSend, OnAccept and OnCon-nect function to drive the respective event, Thereby completing the network data communication.

Conclusion

This paper adopts the embedded TCP/IP protocol to realize the data transmission function of GPRS service through high-speed 8-bit single-chip microcomputer. It has the advantages of fewer peripheral circuits, simple circuit and low system cost. It is connected with external controller through standard RS232 serial port. The specified protocols can communicate with each other, and the versatility is strong. The system software is written in C language. It can be implemented on various controllers with a little modification, and the portability is also strong.

The GPRS-based system has certain shortcomings. For example, the current GPRS network is not stable enough, and there is a packet loss phenomenon. The main controller needs to implement the IP protocol, which is more complicated to use. The Internet-based solution of the host computer is less confidential. Etc., the above problems can be avoided and solved after careful design, so the GPRS-based design still has unparalleled advantages.

15A 125V GFCI Receptacle with LED light indicator does not protect against circuit overload, short circuits, or shocks. For example, you can still be shocked if you touch bare wires while standing on a non-coducting surface such as a wood floor.

Automatic fault alarm, if GFCI malfunction, the LED will flash, the power will be cut off.

WR GFCI UL

GFCI WR Receptacle,GFCI 20A WR Outlet UL 2015,GFCI 20A WR Outlet Self Testing,GFI WR 15A Self Testing

Hoojet Electric Appliance Co.,Ltd , https://www.hoojetgfci.com