Research on GPRS communication system using single chip microcomputer

Publisher:温暖微笑Latest update time:2012-01-14 Keywords:GPRS Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

内容中广告结束 0 Introduction

GPRS (General Packet Radio Service) is a wireless transmission method developed using the concept of packet switching. The GPRS network is implemented based on the existing GSM (Global System for Mobile Communications) network. Some nodes need to be added to the existing GSM network, such as GGSN (GPRS Gateway Support Node) and SGSN (GPRS Service Support Node). The main function of SGSN is to record the current location information of the mobile terminal and complete the sending and receiving of mobile packet data between the mobile terminal and GGSN. GGSN mainly acts as a gateway and can be connected to a variety of different data networks, such as ISDN (Integrated Services Digital Network), PSPDN (Packet Switched Public Data Network) and LAN (Local Area Network). GGSN can perform protocol conversion on GPRS packet data in the GSM network, thereby transmitting these packet data to the remote TCP/IP or X.25 network.

The GPRS network not only has the advantages of wide coverage, fast data transmission speed, high communication quality, always online and billing by traffic, but also is itself a packet data network that supports TCP/IP protocol and can directly communicate with the Internet. Therefore, CPRS has an unparalleled cost-effective advantage in industries such as wireless Internet access, portable environmental monitoring, traffic monitoring, and mobile office.

1 GPRS communication system hardware design

The system uses Sony Ericsson's GPRS communication module GR47 with an internal TCP/IP protocol stack and PIC18f6720 microcontroller, both of which support RS-232 communication standards.

The core design lies in the connection between the microcontroller and GR47 and the writing of software. The PIC18f6720 microcontroller has two USARTs (universal asynchronous serial interfaces), one of which is connected to the GR47 module for data and AT command transmission; the other is connected to the serial port of the terminal chip to communicate with the terminal. An antenna needs to be installed on the outside of the GR47 module. As shown in Figure 1.

The PIC18F6720 microcontroller controls the GR47 module to send and receive data, and the serial port interrupt is used in the software to realize data transmission and forwarding.

1.1 Introduction to PIC18F6720 PIC18F6720

is a high-end single-chip microcomputer produced by Microchip. It uses 3.3 V power supply, most of its instructions are single-cycle instructions, and almost all related hardware configurations are mapped into special registers, which greatly improves the running speed; it has 7 programmable I/O ports A, B, C, D, E, F, G; in addition to 3840B of RAM, it also has 1024B of EEPROM and 128 kB of Flash memory; it has 4 timers and multiple interrupt sources and 2 interrupt priorities, and 2 USARTs. It is very powerful and is a very cost-effective chip.

1.2 Introduction to GR47

GR47 is a dual-band GSM900/GSM=1800 communication module produced by Sony Ericsson. Based on this module, GPRS data transmission can be carried out, and it has functions such as supporting short message services. It is powered by 3.6 V voltage; it can provide multiple interfaces, such as antenna interface, analog audio interface, asynchronous serial interface, SIM card interface, etc., and it also supports I2C communication; it integrates TCP/IP protocol stack internally, so the use of this chip will greatly reduce the difficulty of microcontroller programming.

There are not many ports of GR47 used in this scheme, and several key connection points are explained as follows:

a) Serial port TD: connected to RX2 of the microcontroller, RD connected to TX2 of the microcontroller.

b) DSR pin: DataSetReady, indicating that the module is ready to receive data. This pin is connected to RB0 of the microcontroller through a transistor switch circuit. DSR is high to indicate that it is in data mode, and low to indicate that it is in command mode.

c) DTR pin: Data Terminal Ready, indicating that the terminal device is ready to receive data. The data state and command state of GR47 can be switched by controlling the high and low time of the level of this pin. This pin is connected to RF2 of the microcontroller through a transistor switch circuit.

2 GPRS communication system software design

The system software is written in C language and compiled in MPLAB environment. Since this system is a module of the remote management terminal, certain protocols must be followed in the programming of the program to ensure correct communication. The main body of the program is how to control the AT commands of GR47 to perform initial settings on GR47 and process information data. The program can be generally divided into the following blocks: initial settings of CPRS connection, judgment and processing of short messages, heartbeat processing when there is no data transmission, data judgment and forwarding, etc. The main program is to organically combine these program blocks together, control each other, and loop infinitely. 2.1 Establishment of connection The implementation

process of the GPRS module connecting to the Internet and GPRS network is as follows:

a) The single-chip microcomputer software controls the GR47 module to start up and wait for the module to start normally.

b) Through the serial port connected to the single-chip microcomputer and the GR47 module, write the corresponding AT setting command to the GR47 module for initialization, so that the module can successfully adhere to the GPRS network, obtain the dynamic IP address assigned by the network operator, and establish a connection with the destination terminal.

2.2 Data Processing

The transmission of data packets in the data center server and GPRS server is based on IP data packets, but it is not advisable to transmit IP packets in plain text. Therefore, PPP (point-to-point protocol) is mostly used for transmission to achieve transparent transmission of data through the GPRS module and the Internet network. GR47 has an internal integrated TCP/IP protocol stack, so users do not need to write programs related to the IP protocol, and can directly transmit data through GR47.

a) Data transmission between the module and the PC on the Internet: The PC is required to have a public network IP address and an open port as well as running software to monitor the transmission message. In this way, when the module transmits data with the Internet, the message will be displayed. After the module is successfully connected to the network, the microcontroller only needs to send the data to be sent to GR47 through the serial port, and GR47 will forward the data to the PC with the corresponding IP address.

b) Processing of short message data: GR47 has the function of GSM and can send and receive short messages with mobile phones. Short messages use the PDU format. In the program, it is necessary to determine the arrival of short messages and read the content of the short messages, and execute the corresponding functions according to the content. Finally, the results are constructed into the PDU format and returned to the corresponding sender

. c) GPRS communication heartbeat information: After the network connection is established, if there is no data communication within the set period, the GPRS module sends a heartbeat message to the data service center. After receiving the heartbeat message, the data service center responds with an answer signal.

d) Storage of important data: In the program, some important, commonly used and changeable data such as the IP address, port number, terminal address, SIM card number, etc. of the computer server are stored in the EEPROM of the microcontroller. When necessary, read out or rewrite data to the EEPROM for setting.

2.3 Main program flow

The main program consists of module functions, and module functions are composed of nested basic functions. The main program flow is as follows: first, initialize the variables of the MCU, which are usually 0; initialize the corresponding configuration units of the MCU, such as setting the port direction, setting the interrupt priority, initializing the timer, etc.; then the MCU controls the power supply of GR47 to decide whether to start the machine; after the machine is successfully started, check whether the network registration is successful; after success, the connection between the module and the PC server can be established, and data transmission and short message processing can be carried out; send heartbeat information in a certain format as needed. See Figure 2.

3 Conclusion

This paper presents an implementation scheme of an embedded wireless data transmission terminal based on a single-chip microcomputer and a GPRS module. The small GPRS communication system centered on a single-chip microcomputer application system has low cost, short design cycle, and good portability, and is particularly suitable for remote control and data transmission.
Keywords:GPRS Reference address:Research on GPRS communication system using single chip microcomputer

Previous article:Using the MCLR pin as an output on a PIC microprocessor
Next article:Servo control based on single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 19:28

Design of vehicle-mounted GPS positioning terminal based on ARM
1 Introduction Vehicle-mounted GPS positioning terminals have become the focus of the development of the automotive industry in the past decade. In Europe, the United States and Japan, vehicle-mounted GPS positioning terminals have been widely used in recent years. Vehicle-mounted GPS positioning terminals are
[Microcontroller]
Design of vehicle-mounted GPS positioning terminal based on ARM
Implementation of Smart Home System Based on ARM and GPRS
0. Introduction In recent years, with the rapid development of network communication technology, electronic technology, and computer technology, people have put forward higher requirements for the quality of life, and the modern home environment has also attracted people's attention. At present, the domestic sm
[Microcontroller]
Implementation of Smart Home System Based on ARM and GPRS
Infrared Temperature Measurement System for Transmission Lines Based on GPRS Transmission
0 Introduction In recent years, the power supply network has developed rapidly and the grid structure has become increasingly scientific. The country has become increasingly concerned about the reliability and safety of power supply in the power system. Infrared thermal imaging temperature measurement technolog
[Test Measurement]
Infrared Temperature Measurement System for Transmission Lines Based on GPRS Transmission
Nuvoton N76E003 + GPRS serial port garbled code troubleshooting notes
aim of design The microcontroller uses N76E003, the GPRS module uses AIR208, N76E003 uses USART0 to communicate with AIR208, and uses USART1 to communicate with another device. Due to the uniqueness of each device in service, each device number should be unique. The IMEI number of the GPRS module is unique, so the des
[Microcontroller]
Nuvoton N76E003 + GPRS serial port garbled code troubleshooting notes
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号