0 Introduction
With the rapid development of modern industry, there is an increasing demand for intelligent detection, automated control of factory manufacturing processes, equipment data acquisition, and human-machine interface database interaction. Traditional monitoring systems can no longer meet these diverse customer needs. Traditional monitoring systems typically use microcontrollers as microprocessors. Microcontroller systems have a simple structure, limited system flexibility, and can only meet some basic control requirements. Furthermore, these systems are often wired, leading to cumbersome wiring, unstable networks, and difficulties in later network maintenance and modifications. Embedded intelligent data acquisition devices, integrating leading technologies and control concepts, represent a new generation of intelligent modular control network systems. They utilize the latest technological advancements in computer communication, network, microelectronics, and fuzzy control technologies, offering numerous advantages in network functionality, multitasking, real-time performance, scalability, and human-machine interface, leading to their increasingly widespread application.
This paper proposes a multi-functional data acquisition gateway based on the ARM920T S3C2440 processor and GPRS technology, integrating data acquisition, data protocol conversion, and long-distance wireless data transmission. The proposed multi-functional data acquisition gateway adopts a modular design, allowing it to be equipped with different ARM processors and required wireless communication modules according to actual needs. This multi-functional data acquisition gateway has the advantages of wide application range, low maintenance cost, and high cost-effectiveness. A schematic diagram of the multi-functional data acquisition gateway application is shown in Figure 1.
Figure 1. Schematic diagram of data acquisition system application
1 System Hardware Design
The hardware platform uses the S3C2440 processor with the ARM920T core. Designed by ARM (Advanced RISC Machines), the ARM920T S3C2440 boasts globally leading technology and is widely used in various fields due to its small size, low power consumption, and high cost-effectiveness. It fully supports Windows CE 4.2/5.0, 6.0, and Linux 2.6 operating systems. The S3C2440 core board includes external memory and the necessary peripheral circuitry for the CPU, allowing for the design of peripheral circuits around the core board.
The ARM920T processor S3C2440 is configured with a storage unit, RF transceiver module, power supply module, JTAG interface, human-machine interface, LCD display interface, and MiniUSB master and slave interfaces. The storage unit module includes 64MB of Nandflash, 64MB of SDRAM, and an SD card. The storage module is used to store debugged application programs and the embedded Windows Embedded CE 6.0 operating system. The power supply module provides multiple power supply options. In this system, the power supply module is divided into three parts: providing 1.25V and 3.3V DC to the minimum system, and supplying the signal acquisition board with 5V DC for both digital and analog voltages. The JTAG interface is used for emulation and debugging programs. The LCD display is used to connect to an LCD screen for convenient user settings and viewing of current parameters and data. The USB interface is used to program the Windows Embedded CE 6.0 operating system. The hardware structure diagram of the data acquisition gateway is shown in Figure 2.
The wireless communication module selected is the MC35i module. The MC35i is a new generation dual-band GSM/GPRS communication module from Siemens, providing users with an always-on, high-speed, and simpler mobile data communication method. The MC35i features a rich set of AT commands, powerful functionality, and flexible and convenient operation. The MC35i module mainly consists of a GSM baseband controller, RF module, power supply module, flash memory, ZIF connector, RF power amplifier, and antenna interface. The MC35i is characterized by its small size, light weight, and low power consumption. The MC35i operates at 3.3~4.8V, with a typical voltage of 4.2V and a maximum operating current of 2A. The module can operate on both EGSM900 and GSM1800 frequency bands, can be controlled using AT commands, and supports text and PDU-mode short messages.
The data acquisition gateway employs opto-isolation between its internal input/output units and control unit, significantly reducing the impact of industrial field interference on module operation and improving module reliability. Input/output modules communicate with the CPU via RS-485, allowing for arbitrary module expansion. The CPU provides both serial and RS-485 communication with the modules. Modules communicate with the main CPU via the Modbus protocol. All modules are opto-isolated to enhance system security.
Figure 2 Hardware structure diagram of the multi-functional data acquisition gateway
2 System Software Design
2.1 Porting Windows Embedded CE 6.0 System
The porting process of WinCE 6.0 is essentially a process of writing and modifying the BSP (Browser Support Package) for different CPUs and target boards. If the writing and testing are successful, a WinCE 6.0 system suitable for the designer can be created using PlatformBuilder. The process of customizing a new WinCE 6.0 system image is as follows:
Create a board support package suitable for the target hardware, which includes the BootLoader, OEM configuration layer (OMEAdaptation), and device drivers.
Customize the system design (OSDesign) to meet the requirements of the research project. This involves creating a PlatformBuilder project using the Visual Studio platform. Compiling this project will generate the runtime image file for the terminal.
Write the corresponding drivers for the peripheral devices of the target board and add them to the BSP.
Modify OSDesign, primarily through CatalogItems and creating sub-projects.
After OSDesign compiles the image, the resulting image file is downloaded to the target device, and system debugging is required via communication devices such as serial ports and USB.
If the above debugging is successful, the SDK (Software Development Kit) corresponding to the system image can be exported. The SDK is an essential software for application system development. After installing the SDK, application developers can start developing applications.
In the entire process of porting the WinCE 6.0 operating system, porting the BSP is the most fundamental step. The process of creating a BSP mainly includes...
Create BootLoader
Create OAL
Creating a device driver
Modify the runtime image configuration file
2.2 Design of WinceBootloader
Bootloader development is an essential part of embedded system development. A good bootloader can not only greatly facilitate the subsequent development work of the project, but also provide users with many conveniences when using the product after the project is completed.
The design steps for WinCE Bootloader are as follows:
Bootloader Design Phase 1
(1) Enter the startup entry address, disable the watchdog timer and disable all interrupts.
(2) Set the CPU speed and clock frequency.
(3) Initialize the basic hardware and memory system.
(4) Set up the stack and jump to the second phase.
2. Bootloader Design Phase Two
After the first stage is completed, the function jumps to the Bootloadermain() function. Bootloadermain() calls the OEMDebugInit() function, which is responsible for initializing the Bootloader's debug serial port. After the call, the Bootloader can call the output function. OEMDebugInit() calls OEMInit(), which in turn calls OEMInitDebugSerial() to initialize the debug serial port.
The function code is as follows:
BOOLOEMPlatformInit(){…
G_dwImageStartBlock=IMAGE_START_BLOCK;
OEMGetRealTime(&st);…
InitDisplay();
InitUSB();...
Isr_Init();
RerurnTRUE;}
3. Configuration file
The compiled Bootloader source code generates a file named eboot.exe, but the Bootloader written to Flash is a binary image file, so the eboot.exe file needs to be converted to a .bin file.
Create a file named eboot.bin in the folder %-WINCEROOT%\Platform\HardwarePlatformName\Sre\Bootloader\Eboot.
Add configuration information to the eboot.bin file.
MEMORY
FILLERA0000000000030000RESERVED
EBOOTA0003000000020000RAMIMAGE
RAMA0005000000010000RAM
CONFIG
COMPRESSION=OFF
PROFILE=OFF
KERNELFXUPS=ON
MODULES
Create a file named makefile.inc under %-WINCEROOT%\Platform\HardwarePlatformName\Sre\Bootloader\Eboot.
Add the code to the makefile.inc file
BootImage:
Romimageboot.bib
Add the following code to the end of the SOURCES file:
WINCETARGETFILES=BootImage
4. Flash the Bootloader
After configuration, edit the Eboot.bin file on your PC and flash the bootloader to the target machine. Use the sjf2440 tool to flash it and use JTAG to download it. After the bootloader is downloaded, download the system kernel image file to the target machine via Ethernet.
2.3 Driver Development under Windows Embedded CE 6.0 Operating System
Drivers sit between the operating system and peripheral devices. Their main function is to provide an interface for the operating system to operate different hardware, including physical and virtual devices, and to provide device services for applications.
Stream drivers enable communication between system applications and hardware, primarily receiving two types of commands: commands issued by the device manager and commands invoked by the application. Users access the device through file operation functions such as CreateFile, ReadFile, and WriteFile.
A stream driver only needs to include the following steps:
Write the driver source code, including header file calls, driver code, and driver interface.
Write driver interface
Write a Makefile
Write source files
Modify registry information
Compile dynamic link library (DLL) files into the system image
2.4 GPRS Module Software Design
Common applications of GPRS modules include data transmission, voice calls, and SMS. The communication protocol between the module and the controller is the AT command set. All code in the program is written in C language, allowing for the creation of GPRS driver functions: GPRS module on/off functions, GPRS module initialization functions, dialing functions, disconnection functions, and functions to check online status. These low-level driver functions facilitate the writing of upper-layer protocols. More importantly, they provide a driver abstraction layer. When the underlying hardware is modified, only the low-level driver functions need to be modified, while the upper-layer function code remains unchanged. A layered structure is adopted, from bottom to top: serial port driver layer, GPRS module driver layer, PPP protocol layer, IP protocol layer, TCP/UDP protocol layer, and application layer. If the module has its own protocol stack, only the serial port driver layer, GPRS module driver layer, and application layer are needed. The implementation of upper-layer functions requires the use of lower-level functions, and the task of the lower-level functions is to provide services to the upper-layer functions, ultimately completing the application layer task of data transmission.
Driver development. The embedded microprocessor controls the GPRS module via the serial port to perform operations such as dialing and settings. First, the serial port driver layer is written. It implements functions for opening and closing the serial port, reading serial port data, and writing serial port data. Then, based on these serial port functions, the driver function for the GPRS module is written. This function sends messages, and its process is as follows: test if the modem is active; set the working mode to send messages; set the message mode to text format; set the target mobile phone number for message sending; edit the message content and select the port to send the message; wait to receive feedback information.
3. Conclusion
This paper proposes an embedded multi-functional data acquisition gateway based on an ARM processor, organically combining GPRS technology with embedded technology. The design adopts a modular design concept, allowing users to expand system functionality by configuring the required ARM processor and peripheral expansion modules according to actual needs. It boasts significant advantages such as wide application range, simple maintenance, high cost-effectiveness, and secondary upgradeability. This multi-functional data acquisition gateway provides a wireless, remote, low-functionality, low-cost, and scalable technical solution for various monitoring systems in industrial production.
About the author:
Yi Yingjun (1987-), male, Han nationality, engineer at Shenzhen Yihua Computer Co., Ltd. (Yantai Office).
Zhong Mengwei (1987-), male, Han nationality, is a postgraduate student at the School of Automation, Qingdao University of Science and Technology, specializing in computer control.
Mailing address: Room 1001, Unit 1, Building 41, Huaxin Jiayuan, Zhifu District, Yantai City, Shandong Province.
Postal code: 264000
Email: [email protected]
Telephone: 15853562125
Recipient: Yi Yingjun
Preparation: 3.22. Transmission fuel tank