Research and Development of Embedded Network Data Conversion System
2026-04-06 06:38:33··#1
Abstract: In the fields of industrial control and consumer electronics, many devices currently require Ethernet or Internet communication capabilities. This paper discusses an Ethernet access scheme based on TINI. This system can be easily extended to convert other communication protocols, such as CAN and 1-Wire networks, to meet the needs of different devices accessing Ethernet. This system can effectively solve the problem of remote communication with automated production equipment, network switches, and sensors, as well as realize remote diagnosis and control. Furthermore, it introduces the use of Java as a development tool to develop a communication program for serial-to-Ethernet data conversion. Keywords: Network data conversion, TINI, Java, DP83846A, DS80C400 To achieve the goal of remote monitoring by utilizing the powerful network functions of the Internet, a reasonable network access scheme needs to be studied. An embedded system based on the TINI platform is used to build a bridge for different devices to access the computer network. Utilizing the powerful hardware and software functions of the embedded system, different devices can be supported, achieving the universality of the access scheme. Because the embedded system has good data processing capabilities, it can not only serve as a simple network interface but also extend the network functions of the connected devices and even perform encryption and other processing on the communication data. Embedded systems consist of dedicated hardware and software components. The hardware provides performance support, while the software offers users a wide range of flexibility. The software of an embedded system includes its own operating system and programming environment. Java's various features make it an ideal software development tool for embedded devices. There are many free and open-source resources available for Java, and Java is hardware platform independent and portable. All of this reduces the cost of developing and using embedded devices. The TINI platform is one such embedded system with Java development capabilities. 1 System Hardware Composition The hardware system based on the TINI data conversion system is shown in Figure 1. The system's interfaces with the outside world are mainly RS232 serial ports and RJ45 Ethernet interfaces, whose function is to connect serial devices to local area networks or even the Internet. 2 Java Programs for the Network Data Conversion System 2.1 Software Development Kit—TINI SDK To enable hardware access in programming, the TINI SDK developed by Dallas Semiconductor virtualizes the hardware components of the DS80C400 as Java classes. Hardware operations are achieved by calling relevant methods. The SDK includes an embedded operating system developed by Dallas Semiconductor. It is a multi-tasking, multi-threaded operating system with cross-platform capabilities and a highly optimized Java runtime environment. Application development with the support of the TINI SDK primarily uses Java, typically avoiding direct interaction with assembly language; however, the TINI runtime environment provides mechanisms for using native methods. To optimize speed-critical channels or access low-level hardware, subroutines can be written using native languages (mainly assembly language), increasing system flexibility. The APIs provided in the SDK simplify programming. Using tools such as JavaKit and TINIConverter provided in the SDK, program development and debugging are performed on a PC, generating target applications suitable for the TINI runtime environment. The TINI runtime environment (including the TINI operating system) is loaded into the TINI hardware storage via JavaKit, and network parameters are configured. User programs can then be downloaded to the TINI hardware and controlled via FTP, TELNET, etc. TINI's Java Virtual Machine translates Java bytecode into code executable by the machine hardware system. 2.2 System Program Design Method To achieve the exchange between serial port data and Ethernet network data, a network data conversion program based on the TINI system was designed. The main function of this program is to read data from the serial port device, encapsulate the obtained data using the TCP/IP protocol, and send it to the host computer via the RJ45 interface to interact with the host computer's server program. Simultaneously, it forwards data sent from the host computer to TINI to the RS232 serial port, enabling remote monitoring of the serial port device on-site via the network. In this design, the TINI printed circuit board has two serial ports, defined as Serial Port 0 and Serial Port 4. The microcontroller integrates a UART. Serial Port 0 is used to start TINI serially, download the TINI runtime environment, and serve as the TINI output terminal. This program utilizes Serial Port 4 to interact with the host computer server program. Data conversion is implemented by two processes: SerialWriter and SerialReader. SerialWriter reads the data stream from the host computer server and writes it to the serial port output stream; SerialReader reads available data from the serial port buffer into the input buffer, sends the serial port data to the network server by writing data to the network output stream, and updates the serial port data volume. It also monitors these two processes for any abnormalities. If an exception is caught, the data stream is closed and the sustaining thread is interrupted, ending the program. SerialToEthernet itself inherits a thread class. It is a sustaining thread whose function is to determine the system communication status. If normal, it prints the data flow every 6 seconds; if the connected server is closed, it closes the serial port socket and related streams. Its thread program is a loop controlled by a system running status flag, maintaining program execution. In each loop, the process is first put to sleep for 6000 ms, and then the current data flow is printed. The program flow is shown in Figures 2, 3, and 4. 3 System Debugging Scheme The main purpose of system debugging is to simulate the data conversion between field devices and Ethernet. The PC is connected to the system via a serial port and an Ethernet interface, as shown in Figure 5. The PC simulates the field devices and acts as a host computer to monitor system operation. In addition to running SerialToEthernet, two simple user programs, HelloWorld and Blinky, are prepared for system debugging. The first step is to download and run HelloWorld. Its function is to print the string "Hello World" using JavaKit as the system output terminal of TINI (similar to a PC monitor) to verify the serial port 0. The second step is to download and run Blinky. Its function is to make the LED connected to P3.5 blink continuously to verify the functionality of the I/O port. The third step is to download and run SerialToEthernet, and simultaneously run the server program TIN1Server on the host computer. Serial-ToEthernet runs on the TINI system to implement data forwarding. To verify the serial communication between the host computer and TINI, a serial port debugging program is run on the host computer to simulate an actual field serial port device. When running the serial port debugging program, the serial port is set to the same parameters as TINI's serial port, and the sending mode is set to continuous sending. Under this simulation, data input from the serial port debugging program window is sent to the TINI system through the serial port, forwarded by TINI, and then sent to the host computer through the RJ45 interface. The host computer runs the server program TINIServer, which sends the data from TINI directly to TINI through the output stream without processing. After being forwarded by TINI, the data is returned to the host computer via the serial port and displayed in the "receive area" of the serial port debugging program. The data flow is shown in Figure 6. 4. Conclusion Compared with traditional industrial control data conversion systems, TINI is cheaper, more compact, consumes less power, and is easier to maintain. Furthermore, TINI supports many low-level communication interfaces, providing sufficient flexibility to adapt to different networking requirements. The TINI-based network data conversion system solution is low-cost and reliable. Using Java programming can improve the efficiency of embedded system software development. In the development of this system, Java software can easily access the underlying hardware; leveraging Java's inherent features, powerful network functions can be implemented. For devices, this system allows for the expansion of their functionality using existing networks; it also enables remote diagnostic control of devices via Ethernet, achieving a broader level of networking.