Design and implementation of remote terminal hardware and software based on real-time operating system μC/OS-II

Publisher:SereneMelodyLatest update time:2018-02-14 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    introduction

    Entering the 21st century, the status of information is becoming increasingly important, and the ability to obtain and process information has become a key issue in modern information processing. In the process of informatization of human society, various communication means are the main way to achieve information exchange. Various needs have led to the rapid development of mobile communications (paging, GSM/GPRS, CDMA) and the Internet. When informatization reaches a certain level, an urgent problem is how to incorporate many scattered production units and information units into a unified informatization process, such as oil well control in large oil fields, mine control in large coal mines, and control of hydrological monitoring points.


    Traditional wireless monitoring systems mostly use radio stations. However, radio stations have poor anti-interference and confidentiality, and are not suitable for use in cities. Wireless monitoring systems that can use wireless mobile networks are bound to have incomparable advantages. At present, there are three main ways to transmit data via mobile wireless: GSM short message, GPRS and CDMA.

    GSM network uses short messages to transmit data. Since short messages are transmitted through signaling channels and adopt a store-and-forward method, the disadvantages are low data transmission rate, delay and uncertain time. GPRS uses packet switching technology and charges according to traffic flow. It can efficiently transmit data and signaling. The theoretical transmission rate of GPRS can reach 171.2 kb/s, and the actual transmission rate is about 40 kb/s. CDMA 1X network provides data services in packet form. The theoretical transmission rate of CDMA 1X can reach 300 kb/s, and the current actual transmission rate is about 100 kb/s. It can be used for Internet connection, data transmission and other applications. CDMA 1X wireless data network has become an important resource in the informatization of the above-mentioned services with its advantages of wide coverage, low cost, perfect technology, high security and reliability.

    This article will introduce the system composition of the remote monitoring system and the remote terminal based on the MG815+ wireless module and the ARM LPC2210 microcontroller.

    The emphasis is on the design and implementation of remote terminal hardware and software.

    1 System composition

    This system uses CDMA 1X mobile communication network to complete wireless data transmission, eliminating the initial construction cost of on-site networking and future network maintenance costs. Through the remote terminal, the collected on-site data is sent to the monitoring center in the form of IP packets, where data processing and storage are performed, and corresponding query, statistics and reporting functions are provided. The monitoring center can also obtain real-time data from the remote terminal by sending IP packets to the remote terminal, setting monitoring terminal configuration information or control commands.

    The outstanding feature of this system is "billing by traffic". The CDMA 1X network supports the user's "always online" working mode. The terminal adopts a dormant state during idle time. If data needs to be transmitted, the terminal will be awakened and start working, which greatly saves costs. In addition, since CDMA uses a spread spectrum communication technology of pseudo-random sequence PN for spread spectrum/despreading, it has natural confidentiality, and the probability of its information being intercepted in the air channel is almost zero, which can ensure the security of data transmission. In addition, due to the comprehensive coverage of the mobile communication network, the system's networking is very flexible and can meet complex and changeable conditions.

    The system consists of remote terminal equipment, CDMA network and monitoring center. The principle block diagram is shown in Figure 1.

    System Principle
Figure 1 System Principle

    2 Remote Monitoring Terminal Hardware Design

    The hardware structure principle of the remote monitoring terminal is shown in Figure 2. Figure 2 is mainly composed of embedded microcontroller LPC2210, acquisition unit, display unit, storage unit, communication module and power supply unit.

   Remote terminal hardware structure
Figure 2 Remote terminal hardware structure

    2.1 CDMA Module

    The CDMA module uses ZTE's MG815+ module [3]. MG815+ is an industrial-grade CDMA module based on Qualcomm's 6025 platform, supporting voice, data, SMS and other functions. It can be used in the fields of vehicle-mounted, wireless terminal, data card, data transmission, real-time monitoring, real-time image and other fields based on CDMA technology. The module integrates RF circuit and baseband, and has the characteristics of high communication quality, efficient spectrum utilization, high anti-interference, high confidentiality, low radiation, etc., and provides users with a standard AT command interface, so users can easily connect to the MG815+ module through the serial port of the ARM embedded processor, and directly use AT commands to conveniently realize data transmission and module settings. The MG815+ module provides external connections through a 40-pin and a 10-pin connector.

    2.2 Main control chip

    The main control chip uses Philips' LPC2210, which is a 16/32-bit ARM 7TDMI-S CPU microcontroller that supports real-time simulation and embedded tracking. The operating voltage is 3.3 V, and the core operating voltage is only 1.8 V; the built-in PLL phase-locked loop can set the CPU operating frequency to 60 MHz; the dual UART interface module provides asynchronous serial transmission and reception of data; due to the 144-pin package, extremely low power consumption, multiple 32-bit timers, 8-way 10-bit ADC, PWM output and up to 9 external interrupts of LPC 2210, they are particularly suitable for industrial control, medical systems, access control and POS machines; by configuring the bus, LPC 2210 can provide up to 76 GP10s; SRAM and Flash can be expanded externally, which is very convenient for transplanting embedded μC/OS-II operating system.

    In this system, after power-on reset, the working frequency and serial port of LPC 2210 must be set first, and then the MG 815+ wireless module is initialized through AT commands to attach it to the CDMA network, and a PPP connection is established through the dial-up process to obtain the IP address dynamically assigned to the wireless module by the network operator ISP, and a Socket link is established with the fixed IP of the server. Once the link is successful, data transmission can be carried out.

    3 Remote Terminal Software Design

    First, the embedded operating system μC/OS-II is transplanted in LPC 2210. Through the application interface functions it provides, people do not need to care about some working details of the hardware, and the application development can be carried out on a friendly platform, so that the operation and work can be organized more effectively, the development efficiency of the application is improved, and the system can run efficiently; the software design under μC/OS-II and the relationship with the hardware are shown in Figure 3.

    Relationship between software design and hardware
Figure 3 Relationship between software design and hardware

    3.1 Programming

    The main program mainly includes: initializing the operating system, establishing two tasks, and starting multitasking. The first task is to send data, and the second task is to receive and process data. The priority of the first task is set higher than that of the second task, but the first task is suspended when it is running, and the second task is allowed to run. The timer is used to control when to send, and the sending task is run at this time. The 6025 module has a built-in TCP/IP protocol stack. Users only need to follow the AT instructions related to data transmission in the MG815+ module AT instruction manual to establish a connection with the CDMA network  , obtain the IP address dynamically assigned to the wireless module by the network operator ISP, and establish a Socket link with the fixed IP of the server. After the link is successful, data can be sent, received and processed. The flowchart of the main program, data sending program, and data receiving and processing program is shown in Figure 4.

   Program flow chart
Figure 4 Program flow chart

    4. Monitoring Center Design

    The monitoring center is equipped with a high-performance microcomputer and applies for a real IP address. The monitoring center applies for dedicated line access from the ISP operator. The monitoring center is allocated a real IP. The remote terminal collects data information from the on-site equipment and sends it directly to the monitoring center in the form of IP packets. The monitoring center processes the IP packets sent by the remote terminal and obtains the corresponding data and stores it in the database. The database is mainly responsible for storing, managing and maintaining the sent data, providing multiple services such as querying, adding, deleting, etc., and can print data reports when necessary.

    5 Conclusion

    This system uses the ADS1.2 development environment to design and debug the monitoring terminal program. Through the serial port control MG815+ module, the computer communication of remote monitoring data is realized. After multiple field tests, it is shown that the communication data of this system is stable and reliable, and the effect is good. It can be used in occasions where there is a large amount of data transmission and wired transmission cannot meet the needs, such as oil well monitoring, hydrological monitoring, etc. Since the LPC2210 hardware has rich expandable resources and the remote terminal software is based on the embedded real-time operating system μC/OS-II, this design has great flexibility and can quickly adapt to various specific occasions.


Reference address:Design and implementation of remote terminal hardware and software based on real-time operating system μC/OS-II

Previous article:Using CPLD to implement digital filtering and anti-interference design
Next article:Typical Linux device driver code

Recommended ReadingLatest update time:2024-11-23 02:25

Implementation and design of interface circuit and program for liquid crystal display based on microcontroller C8051F020
In the design of single-chip computer systems, the design of the LCM (liquid crystal display module) human-computer interaction interface is often a very important link. LCM can be used to display setting parameters, status prompts, test results, and parameters to be input on smart instruments. This article combines t
[Microcontroller]
Implementation and design of interface circuit and program for liquid crystal display based on microcontroller C8051F020
Automatic measurement and control of LED energy-saving lighting system based on single-chip microcomputer C8051F020
In today's society where the global energy crisis is prominent, LED lighting has become one of the most promising lighting methods with its advantages of green environmental protection and high efficiency and energy saving. LED is known as the "fourth generation light source of green lighting" and has gradually been
[Power Management]
Automatic measurement and control of LED energy-saving lighting system based on single-chip microcomputer C8051F020
STM32 - C language data types
During the programming process, different CPUs have different meanings of data types, so you must pay attention to the definition and conversion of the corresponding variable data types, otherwise uncertain errors may occur in the calculation. 1. Type data in C language Integer: int short long Real type: float dou
[Microcontroller]
S3C6410 bare metal program, LED light flashes
1 /* 2 * Realize the running light, LED1 LED2 LED3 LED4 are turned on and off in turn 3  */ 4 5 .global _start 6 .section .text 7 8 _start: 9 10     /* 11      * set the CPU to SVC32 mode 12      */ 13     mrs r0,cpsr 14     bic r0,r0,#0x1f        @ cl
[Microcontroller]
C51 single chip digital tube dynamic display
As the cheapest output device, digital tubes are widely used in various automation equipment. The simplest and most common display method is dynamic refresh display, which is called pseudo-dynamic display. That is, by scanning each bit in time-sharing, it is beneficial to the visual retention phenomenon of the human e
[Microcontroller]
C51 single chip digital tube dynamic display
Detailed explanation of C51's INTRINS.H
/*-------------------------------------------------------------------------- INTRINS.H Intrinsic library functions Intrinsic functions for C51. Copyright (c) 1988-2001 Keil Elektronik GmbH and Keil Software, Inc. All rights reserved. --------------------------------------------------------------------------*/ e
[Microcontroller]
Keil C51 Data Overlaying
  Generally, compilers dynamically allocate local variables in a function to the stack, and release the space when the function ends. Because the internal memory of 8051 is very small, only 128 or 256 bytes, and the stack also shares this memory. In order to save stack space, local variables are basically statically a
[Microcontroller]
Data Acquisition Subsystem of ADμC812 and Its System Programming Technology
ADμC812 integrates 8-channel 12-bit ADC acquisition system , 2-channel 12-bit DAC, 80C52 MCU core, 8KB flash/electrically erasable program memory, 640 bytes flash/electrically erasable data memory, watchdog timer, 640 bytes flash/electrically erasable data memory, watchdog timer, power monitor, I2C compa
[Microcontroller]
Data Acquisition Subsystem of ADμC812 and Its System Programming Technology
Latest Microcontroller Articles
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号