Welcome: Hunan Intelligent Applications Tecgnology CO.,ltd.-HNIAT.com
Language: Chinese ∷  English

Smart test

Design of photoelectric measurement simulation detection system based on S3C2410 microprocessor and operating system

introduction

Moving base photoelectric measurement platform can be divided into four types: vehicle-mounted, ship-borne, air-borne and space-borne according to different carriers. In order to ensure the reliability of the measurement platform system and the accuracy of the measurement, simulation testing is required before the platform is officially put on the carrier for operation. Most of the current moving base photoelectric measurement simulation detection systems are high in cost, poor in human-computer interaction, and inconvenient to carry, which brings a lot of trouble to the field detection. Aiming at this problem, this paper uses Samsung's ARM9 processor S3C2410 and embedded WinCE operating system to design a visual and portable photoelectric measurement simulation system for moving bases. The system uses terminal control commands to manipulate the optoelectronic platform, and detects various performance indicators of the platform in real time through serial communication.

S3C2410 is a 32-bit RISC microprocessor based on the ARM920T core produced by Samsung, with a main frequency of 203 MHz. It integrates a large number of peripheral resources and has the characteristics of high performance, low power consumption, and rich interfaces. WinCE is an open and upgradeable 32-bit embedded real-time operating system developed by Microsoft. Its graphical user interface is quite excellent, with modular and structured features. WinCE supports various hardware peripherals, other devices and network systems. . WinCE has a complete set of supporting development software tools, enabling embedded system developers and application developers to customize various products.

1 The hardware configuration of the system

After analysis and screening, choose suitable hardware to build a hardware development environment. The hardware environment of the photoelectric measurement simulation detection system is mainly composed of three parts: S3C2410 as the single-chip microcomputer, LCD with touch screen and SD card. The overall structure of the system is shown in Figure 1.

1.gif

Figure 1 Overall structure of the system

The part above the dotted line is the hardware environment of the photoelectric measurement simulation detection system, and its components and functions are as follows:

(1) Single board computer based on S3C2410. This is the hardware of the entire system. It has a 64M SDRAM and a 64M Nand Flash. An SD card socket is used to install an SD card for data storage, a USB Host can be connected to the mouse and keyboard to input control equipment, and a USB Device interface is used to program the system. In order to facilitate debugging during development, a 10M Ethernet interface is also extended, which is mainly used for communication with the host, debugging and programs. There are also two DB9 serial ports, one is used for debugging in the design stage, and the other is used to communicate with the PC104 on the lower computer, so as to achieve the purpose of controlling the photoelectric measurement platform.

(2) LCD with touch screen. This is the display control terminal of the system, responsible for the graphical interface display of the user control terminal. Users can input control commands according to their needs on the sending panel, and at the same time, the receiving panel will display various performance indicators from the lower computer. For portable design considerations, the screen is only 3.5 inches in size with a resolution of 320*240.

(3) SD card. It is the storage device of the system and is responsible for storing communication data. For the consideration of miniaturization and portability of the system, we choose a small SD card as the data storage medium.

Due to space limitations, here is only a brief introduction to the hardware development environment of the system. In the next part, the software development process will be explained in detail.

2 System software development environment

Before software development, a software development environment must be established. This article will use the embedded WinCE operating system as the operating platform of the software. The following will briefly introduce the establishment of its software development environment.

(1) Customization of WinCE kernel. Due to the limitation of hardware resources, embedded systems often need to be cut during actual development, and then customized embedded operating systems suitable for their own hardware resources. According to the existing hardware device configuration, use Platform Builder 4.2 to customize, configure, and compile a WinCE operating system kernel. The important thing is to add the driver of the required device, and finally generate the WinCE kernel file nk.bin and install WinCE. Eboot program.

(2) Install WinCE on the ARM board. First burn the bios to Nandflash through the JTAG board, and then use the USB data cable to upload the Eboot program and WinCE kernel nk.bin to the ARM board. Through the Eboot program, WinCE will be installed automatically.

(3) Application development. Microsoft has launched eMbedded Visual C++ 4.0 specifically for WinC++E software development. The tools provided by eMbedded Visual C++ 4.0 can be used to easily create, modify and debug applications.

3 System terminal program design

After setting up the software development environment, the next step is to develop terminal applications. The terminal program of the photoelectric measurement system of the moving base is mainly composed of three modules: sending, receiving and serial communication. Among them, the sending module control command and sending display two parts, and the receiving module is divided into two parts: receiving display and data storage. The main functional module frame diagram of the terminal system is shown in Figure 2 below:

2.gif

Figure 2 The frame diagram of the terminal program function module

The specific design of the terminal program uses eMbedded Visual C++ 4.0 software. The following briefly introduces the program design process:

3.1 Sending module and receiving module

The design of the sending and receiving module is mainly the design of the window. The establishment of the window is not complicated, mainly the initialization of the window and the establishment of various button controls. Like other versions of windows programs, the WinCE program also uses a message-driven mechanism. Various operations of the user are sent to the application in the form of messages, and the application is always waiting for the arrival of the message. The processed message is obtained and analyzed, and the application program takes appropriate actions according to the content contained in the message to respond to the user's operation. The following is the message loop function:

While (GetMessage (&msg, NULL, 0, 0)) {

TranslateMessage (&msg);

DispatchMessage (&msg);

When the user starts the program, the message loop starts, and the messages that establish each window and button control are sent. After the application receives these messages, it translates them, and then runs the function corresponding to each message.

3.2 Serial communication

Windows CE does not support overlapped I/O, so if a large number of read and write serial port operations are performed on the main thread, the entire program may fall into a slow serial port wait, so multi-threaded read and write serial port operations are used.

The main thread of the program is responsible for message processing, and there are two additional threads. The reading thread is responsible for reading back data from the serial port, and the writing thread is triggered by an event to send control commands. Create an event when the program is initialized, create a writing thread and use the WaitCommEvent function to block the thread, waiting for the event to trigger. Then open the serial port by hand, create a read thread, read back the data, and process; when the send command is pressed, a communication event is triggered to unblock the write thread, and then data is sent.

4 Test results

The finalized executable program is programmed onto the target board, and then the ground simulation test is carried out. The simulation system uses +5V input voltage, and the control panel of the system terminal software sends control commands to flexibly manipulate the various operating states of the photoelectric platform. The receiving panel can display various performance indicators of the optoelectronic platform in real time with a refresh rate of 100ms. At the same time, if data storage is selected, these data information can also be stored on the SD card. The running interface of the software is shown in Figure 3 below:

Figure 3 Software running interface

Take the high and low temperature experiment of the optoelectronic platform as an example. In the whole 2 hours, the simulation system can always communicate with the optoelectronic platform correctly and display various performance indicators of the platform in real time. The test results show that the system has the advantages of rich functions, high reliability, and convenient operation.

  5 Conclusion

We take advantage of the powerful functions of the ARM9 processor, and the convenient and efficient underlying support provided by the embedded WinCE operating system network, visual graphical interface, multi-threaded programming, etc., to develop an embedded photoelectric measurement simulation detection system with rich functions and reliability High, friendly interface, convenient operation and many other advantages. This article introduces the hardware components and functions of the system, focusing on the embedded software development process and the key technology serial communication solution process, I believe it can provide reference for the development of other WinCE-based embedded terminal systems. The project will eventually generate economic benefits of 200,000 yuan.

The author's innovation point: This article uses the combination of ARM&WinCE and multi-threaded serial communication to design a portable, low-cost, and good man-machine interaction photoelectric measurement simulation detection system for the moving base.

CONTACT US

Contact: Manager Xu

Phone: 13907330718

Tel: 0731-22222718

Email: hniatcom@163.com

Add: Room 603, 6th Floor, Shifting Room, No. 2, Orbit Zhigu, No. 79 Liancheng Road, Shifeng District, Zhuzhou City, Hunan Province

Scan the qr codeClose
the qr code