Design of Remote Monitoring System Based on ARM Embedded

The design and application of embedded system based on ARM core in remote monitoring alarm system. The core part mainly includes the ARM embedded platform design and μC-OS embedded real-time operating system transplantation; the design and implementation of the human-computer interaction interface μCGUI; remote communication and automatic alarm, etc.; Other monitoring equipment seamless connection and other issues.

Abstract: The design, implementation and application of an embedded system based on the ARM core in a remote monitoring and alarm system. The core part mainly includes the ARM embedded platform design and μC-OS embedded real-time operating system transplantation; the design and implementation of the human-computer interaction interface μCGUI; remote communication and automatic alarm, etc.; Other monitoring equipment seamless connection and other issues.

1 Introduction

The monitoring system has now become an indispensable part of modern production and life. At present, there are many types of surveillance products, most of which are widely used in transportation, hospitals, banks, homes, schools and other security fields.

With the emergence of embedded systems, especially the emergence of embedded systems based on ARM core chips, the application fields of monitoring systems have become more extensive. In addition to the security function, the remote monitoring and alarm system designed in this paper can also be used in the following fields: communication field: remote communication, video conferencing and video on demand, securities, distance education, etc. Medical field: ward monitoring, remote diagnosis, etc. Industrial field: remote equipment diagnosis, maintenance, repair, remote production monitoring, etc. Household field: remote maintenance of household appliances; automatic alarm for major accidents such as electricity, gas, fire, etc.

2 System design

2.1 System composition

The remote monitoring system designed in this paper is mainly composed of a central controller, a data terminal, a sensor module, a communication module, and an interface module. System composition diagram (Figure 1).

2.2 Central Controller

The core of the system is responsible for data collection, judgment and processing. In order to improve the efficiency of the system, Samsung’s S3C2410 chip is used as the processor. The S3C2410 chip is a cost-effective ARM chip, which is very suitable for mobile phones, PDAs and other handheld devices. The main features include: ARM920T core, the highest operating frequency is 203MHz, LCD controller: can directly drive true color LCD screen, up to 2048×1024 true color LCD screen, 2 USB Host ports, 1 USB Device port, support Nand flash boot Mode, SD card interface, UART, IIC, SPI, IIS and other types of serial interfaces, 4-channel DMA.

The CPU core part of the monitoring system in this article uses the standard SO-DIMM200 golden finger interface, which is convenient for later maintenance and upgrades. If the use environment of the monitoring system is more demanding, you can replace the CPU with the S3C2440 chip. S3C2440 is fully compatible with all features of S3C2410 (note: chip pins are not fully compatible). Compared with the S3C2410 chip, the S3C2440 has superior performance: the highest operating frequency can reach 500MHz, and the internal integrated CMOS camera interface, but the price is more expensive.

Design of Remote Monitoring System Based on ARM Embedded
Figure 1 Block diagram of the monitoring system

2.3 Data terminal

The main function of the data terminal is to analyze and process the monitoring data, and report the data to the monitoring personnel in time. At the same time, the monitoring personnel can use the data terminal to remotely control the monitored equipment according to the on-site situation. The biggest advantage of the data terminal is that it is safe, reliable, and easy to carry. In general, in order to save costs, mobile communication devices such as mobile phones and PDAs can be used as data terminals. But if it is used as a monitoring system for high-risk environments or precision instruments, the data terminal needs to be professionally customized. What is used here is the central controller as a data terminal, that is, the central controller can be used as a data collection and transmission center as well as a data receiving and processing center.

2.4 Communication module

The communication module is mainly responsible for remote data communication. With one or more communication methods such as RS232/485, GPRS, CDMA, etc. Need to be customized according to the on-site environment and user needs. The communication module and the controller are connected through the interface bus, and the connection mode is TTL/RS232/RS485, etc.

2.5 Sensor module

The main function of the sensor module is to perceive the external environment and to monitor the external environment in real time. It is composed of one or more sensors such as a human body infrared sensor, a vibration sensor, an ultrasonic sensor, a combustible gas sensor, a temperature sensor, and a humidity sensor. It can be customized according to different on-site monitoring environments.

2.6 Interface module

The interface module is mainly used as a system expansion function, which externally expands the controller’s A/D conversion, I2C, SPI and other interfaces. The interface module has no specific function, but it can be connected to other equipment as needed, for example, it can be connected to industrial instruments or equipment to monitor the instruments or equipment in real time.
Although the interface module is not the main part of the monitoring system, it is indispensable to the entire system. Because the monitoring system in this article mainly considers the scalability of the system and seamless connection with other systems. The monitoring system can be easily upgraded through the interface module, and seamless connection with other systems or equipment can be realized. This is also the main function of this system area superior to other monitoring systems.

3 software design

3.1 Working software

The software design of the system is more complicated, and only the whole working software process is given here (Figure 2).

Design of Remote Monitoring System Based on ARM Embedded
Figure 2 Software flow chart

3.2 Operating system migration

The S3C2410 chip supports a variety of embedded operating systems, such as WINCE, uCLinux, etc. But considering the real-time requirements of the monitoring system, the μC/OS-II embedded real-time operating system is used here. μC/OS-II is a real-time multitasking operating system with open source code, portable, curable, tailorable, and preemptive. Most of its source code is written in ANSI C. The entire embedded system is divided into two layers: the hardware layer and the software layer. The main research here is the architecture of the software layer. The software layer is mainly divided into four parts: real-time operating system kernel, processor-related parts, application-related parts, and user applications. The files that need to be modified to transplant μC/OS-II system are: application related files: OS_CFG.H INCLUDE.H; processor related files: OS_CPU.H, OS_CPU_A.ASM, OS_CPU_C.C.

3.2.1 Code related to the processor

This is the most critical part of the transplant. The kernel organically combines the application system and the underlying hardware into a real-time system. To make the same kernel applicable to different hardware systems, there needs to be an intermediate layer between the kernel and the hardware, which is the code related to the processor. The processor is different. This part of the code is also different. We need to transplant this part of the code ourselves when transplanting.

a) OS_CPU.H

Including processor-related constants, macros and type definitions defined with #define, system data type definitions, stack growth direction definitions, close interrupt and open interrupt definitions, system soft interrupt definitions, and so on.

b) OS_CPU_A.ASM

This part needs to operate on the processor’s registers, so it must be written in assembly language. It includes four sub-functions: OSStartHighRdy(), OSCtxSw(), OSIntCtxSw(), OSTickISR(). OSStartHighRdy() is called in the multitasking system startup function OSStart(). The completed function is: Set the system running flag OSRunning = TRUE; Load the stack pointer of the highest priority task in the ready table into the SP, and force the interrupt to return. In this way, the highest priority task that is ready is like returning to the running state from an interrupt, allowing the entire system to operate. OSCtxSw() is called in the task-level task switching function. Task-level switching is realized through interrupts artificially created by SWI or TRAP. The vector address of the ISR must point to OSCtxSw(). The function completed by this interrupt: save the environment variables of the task (mainly the value of the register, realized by stacking), store the current SP in the task TCB, load the SP of the highest priority task ready, and restore the highest priority ready The environment variable of the task, interrupt and return. This completes the task-level switching. OSIntCtxSw() is called in the exit interrupt service function OSIntExit() to achieve interrupt-level task switching. Because it is called in an interrupt, the processor’s register stacking work has been completed, so it is not used for this part of the work. Specific completed tasks; adjust the stack pointer (because calling the function will cause the task stack structure to be inconsistent with the stack standard structure when the system task is switched), save the current task SP, load the SP of the highest priority task ready, and restore the highest priority task ready Environment variable, interrupt return. This completes the interrupt-level task switching. OSTickISR() system clock beat interrupt service function, which is a periodic interrupt, provides clock beats for the core. The higher the frequency, the heavier the system load. The size of its cycle determines the minimum time interval service that the kernel can provide to the application system. Generally limited to ms level (related to MCU), users need to create interrupts to solve more demanding tasks. The specific content of this function: save the register (if the hardware is automatically completed, it can be omitted), call OSIntEnter(), call OSTimeTick( ), call OSIntExit(), restore the register, and return from the interrupt.

c) OS_CPU_C.C

There are a total of 6 functions defined in this file, but the most important one is OSTaskStkInit(). The others are used to extend the system kernel. OSTaskStkInit() is called by the system itself when the user creates a task, and the stack of user tasks Initialize. Make the stack of the established task into the ready state consistent with the stack structure when the system is interrupted and the environment variable is saved. In this way, an interrupt return instruction can be used to make the ready task run.

3.2.2 Application-related code

This part includes two files: OS_CFG.H, INCLUDES.H. Users can customize appropriate core service functions according to their own application system. OS_CFG.H to configure the kernel, users can customize the kernel according to their needs, leave the necessary parts, remove the unnecessary parts, and set the basic situation of the system. For example, the maximum number of tasks that the system can provide, whether to customize the mailbox service, whether the system needs to provide task suspension function, whether to provide task priority dynamic change function, and so on. INCLUDES.H system header file, the file needed by the entire real-time system program, including the kernel and user header files.

3.3 User Graphical Interface

Although μC/OS-II operating system has high real-time performance, it does not have good graphical interface support like WINCE, uCLinux and other operating systems. Therefore, in the case of using LCD and touch screen, it is necessary to transplant the user graphic interface program. What is used here is μC/GUI. μC/GUI is a collection of software modules through which a user graphical interface (GUI) can be added to our embedded products. μC/GUI has high execution efficiency and is independent of the processor and LCD controller. The module can work in a single-task or multi-task environment, and can support Display modes of different sizes.

Through μC/GUI, we can easily draw graphics and interfaces on the LCD screen. If you need multiple font support, you must add the corresponding font font library to the μC/GUI. In order to avoid garbled characters, try to use GB2312 national standard font.

3.4 About the compatibility of fonts

The Chinese character library commonly used in our country is GB code, but UNICODE code is used internationally, so if the data terminal uses mobile communication equipment such as mobile phones, PDAs, etc., then the word code conversion must be carried out before data transmission, that is, GB code conversion It is UNICODE code or UNICODE code is converted to GB code. Since GB code and UNICODE code do not have any rules in permutation and combination, the usual method of character code conversion is the look-up table method.

4 Conclusion

The remote monitoring system based on the ARM9 embedded system is different from the previous monitoring system. The high-performance processor chip greatly improves the performance of the system. Enable the monitoring system to work in a relatively harsh environment. And in the design, the scalability and compatibility of the system have been fully taken into account, and the seamless connection between this system and other systems has been realized. To meet the needs of different working environments.

Author’s innovative point of view: The remote monitoring system designed in this article has a wider range of applications, more flexibility and convenience. Through the different combinations of various functional modules, it can be applied to various fields very conveniently and quickly, realizing intelligence, automation and high cost performance.

The Links:   G154I1-LE1 PM30CSJ060

Related Posts