Share this

Embedded System Design of Track Detector Based on ARM7

2026-04-06 06:21:24 · · #1
Abstract: This paper describes the design process of an ARM7 embedded system with a track inspection instrument as the application target. Centered on the S3C44B0 embedded processor with the ARM7TDMI core, the hardware platform of the system is constructed using high-performance peripheral circuits such as CH375 and MAX197. The real-time requirements of data acquisition, data processing, and human-computer interaction are achieved by utilizing ARM's unique interrupt handling mechanism. This design has been successfully used in a track inspection instrument prototype. Keywords: ARM7; S3C44B0; fast interrupt; track inspection instrument 1 Introduction Static geometric parameter detection of railway tracks is a routine task for railway departments. Using portable track inspection instruments can significantly reduce the workload of inspection personnel. This intelligent measurement technology can not only improve the accuracy and reliability of measurements, but also provide on-site and subsequent track data analysis, greatly improving the quality and efficiency of track inspection work. Portable track testing instruments place many new demands on the functions and performance of embedded computer systems: high real-time performance, high computing performance, high integration, low power consumption, and low cost. While traditional microcontroller systems can perform general control tasks, their computational power is too low to meet the requirements of on-site data processing. Embedded systems based on ARM series microprocessors designed with the SoC concept can well meet these requirements. ARM cores are known for their high performance and low power consumption, and coupled with a large number of on-chip peripherals provided by IC manufacturers, ARM series processors have excellent embedded application performance. In this design, the Samsung S3C44B0 ARM7TDMI core processor is used to handle control and computation, the MAX197 12-bit high-performance AD ​​converter is used to convert sensor signals, and the CH375 USB host controller is used to transfer data to a USB flash drive. The system also includes other necessary peripherals such as an LCD screen, keyboard, and mini printer. 2 System Design Requirements 2.1 Measurement Principle The measurement principle of the track detector is shown in Figure 1. The sensor is fixed by a mechanical bracket with rollers, and the operator pushes the detector on the track. The displacement sensor measures the distance d between tracks A and B, the tilt sensor measures the tilt angle θ between the track plane and the horizontal plane, and the photoelectric encoder is connected to a roller to record the current mileage L. The track detector can be set with a sampling interval ranging from 0.5m to 1m. When the mileage reaches the sampling interval, the current mileage L, gauge d, superelevation h, and triangular crater t are saved as a record. During the movement of the mechanical support, vibrations with a frequency much higher than the track inclination change frequency are generated. Therefore, the inclination signal needs to be filtered to reduce measurement errors. Figure 1 shows the principle of track measurement. 2.2 Performance Requirements The track detector's workflow is as follows: An AD converter is used to sample the signals from the displacement and inclination sensors at a sampling frequency of 33Hz. Then, a filtering operation is performed on the first 80 inclination sample values. Every 5cm increase in mileage, the current gauge and superelevation are saved to a queue. When the mileage reaches the sampling interval, the triangular crater is calculated based on the data in the queue and then saved along with the gauge and superelevation as the final data. Therefore, the system requires a timer that can complete a filtering operation within 30ms. The displacement sensor has a range of 5cm and a conversion relationship of 1V/1cm. The tilt sensor has a range of ±10º and a conversion relationship of 1V/1º. The display resolution of track gauge, superelevation and triangular pit is required to reach 0.1mm. Therefore, the AD converter needs to have 12-bit precision. In addition, it is also necessary to realize functions such as USB flash drive storage, on-site printing, clock, LCD display, and keyboard input. 3 Hardware Design 3.1 Overall Hardware Design There are many models of ARM7 series processors. The design uses the more common Samsung S3C44B0, which contains a powerful ARM7TDMI core and a large number of practical peripherals [1]. According to the actual needs of the application, the S3C44B0 is equipped with a 1M×16Bit Nor Flash SST39VF1601 and a 4Banks×1M×16Bit SDRAM HY57V641620. MAX197 is a single-supply, multi-channel, multi-range 1/2LSB precision 12-bit AD converter with a sampling rate of up to 100ksps, which fully meets the requirement of a 33Hz sampling rate. Although it is powered by a single 5V, it has four ranges: ±10V, ±5V, 10V and 5V. It also integrates a clock generator and a reference circuit, and the data interface can be directly connected to a general-purpose controller. MAX197 provides high performance with a simple circuit and is an ideal choice for embedded applications [2]. CH375 is a general-purpose interface chip for USB bus, supporting both master and slave modes. The master mode supports commonly used full-speed USB devices. It has built-in firmware for a dedicated communication protocol for handling Mass-Storage devices. External controllers can directly read and write commonly used USB storage devices in sectors [3], providing a practical USB flash drive storage solution for embedded devices. Fig. 2 Picture of hardware structure The system block diagram is shown in Fig. 2. The IO pins of the S3C44B0 are driven by 3.3V LVCMOS, and the maximum input voltage is 4.6V[1]. Therefore, when the bus is connected to peripherals with 5V logic level such as MAX197 and LCD screen, a bus transceiver should be added for isolation. In addition, some GPIO pins used for input also need to be buffered. 3.2 High-efficiency power management Power management is a key part of battery-powered portable devices. Using low-power devices and improving power management efficiency are two important means to extend the continuous working time of the system. The power supply scheme shown in Figure 3 is made according to the characteristics of the electrical appliances and cost considerations. Fig. 3 Scheme of power supply Although DC-DC power supply has high efficiency, its ripple coefficient is large and it is not suitable for power supply of analog circuits. Although linear regulator has good voltage regulation effect, its efficiency is low and it can only step down. The AD converter has a very small operating current and high requirements for power supply stability, so a linear regulator is used to power it directly. The digital part uses DC-DC power supply. For the multiple voltages required by the processor, a linear regulator is also used. The resulting power loss is acceptable. The positive and negative voltages required by the sensor are obtained through a DC-DC converter's boost and inversion. A linear regulator is used to eliminate the influence of ripple. Separate DC-DC converters, controlled by the processor, are used for the high-power LCD backlight and printer. However, DC-DC converters are not very adaptable to large load fluctuations; the printer head's power consumption is intermittent with high instantaneous power, therefore the DC-DC converter needs sufficient power margin. This power supply scheme has achieved good results in practice; with the backlight and printer off, the 12V battery output current is less than 120mA. 4. Software Design 4.1 Real-time Data Acquisition Due to the high real-time requirements of data acquisition, the software design does not use an operating system but consists of multiple interrupt service routines and a main program. The design uses a total of 4 external interrupts and 3 internal interrupts, from the photoelectric encoder's forward and reverse rotation, MAX197, CH375, RTC, and two timers, respectively. Two important interrupts are from the photoelectric encoder and the timer that generates the sampling frequency. The former is characterized by a high frequency, up to 1KHz, and cannot be lost. The latter is characterized by a long interrupt service routine running time and the need to complete filtering operations, so the interrupts are required to be nestable. The ARM processor does not directly support the nested execution of interrupt service routines in hardware [4]. Although it can be implemented in software, it will increase the additional running overhead. The above problems can be solved by cleverly utilizing the unique interrupt mechanism of ARM. ARM provides two types of interrupts: FIQ and IRQ. When the FIQ interrupt arrives, the processor will switch the running state to FIQ mode. In this mode, there are dedicated registers to reduce the time loss caused by stack pushing. IRQ is similar, but there are not as many dedicated registers as FIQ. Therefore, when the processor runs the interrupt service routine in IRQ mode, it can respond to the FIQ interrupt immediately. By using the interrupt generated by the photoelectric encoder as the FIQ type and other interrupts as the IRQ type, each interrupt can be responded to in a timely manner [5]. The interrupt controller of S3C44B0 can set an interrupt as FIQ or IRQ type and send it to the ARM core. The ARM core only has two interrupt signal lines, FIQ and IRQ. Therefore, the processor needs the cooperation of the interrupt controller to determine which interrupt source a certain interrupt comes from. The S3C44B0 provides two solutions: VECTORED INTERRUPT MODE and NON-VECTORED INTERRUPT MODE. VECTORED INTERRUPT MODE can execute different interrupt handlers for different interrupts, just like CISC processors. Its implementation principle is that when an interrupt arrives, the hardware logic generates a corresponding jump instruction based on the specific interrupt source and places it on the bus. After the ARM core obtains the instruction, it immediately jumps to the corresponding handler [1]. This can improve the interrupt response speed and simplify program design, but this mode only supports IRQ type interrupts; NON-VECTORED INTERRUPT MODE, like other ARM processors, uses the interrupt service routine to access the I_ISPR register of the interrupt controller to determine the interrupt source. In the design, the interrupt type of the photoelectric encoder is set to FIQ type and NON-VECTORED mode is used, while other interrupts are set to IRQ type and VECTORED mode is used. The interrupt vector table consists of two parts: the first part contains exception jump instructions for the ARM core, and the second part is used by the S3C44B0's VECTORED interrupt mode. Interrupt service routines can be written in assembly or C. For FIQ and IRQ type C functions, the __irq macro needs to be added so that the compiler can generate the correct return instruction. 4.2 Overall Software Design Since there is no operating system, the startup code and application program are integrated. The startup code is written in assembly language and, in addition to the interrupt vector table, is responsible for hardware initialization, copying itself from ROM to SDRAM, initializing the stack in various modes, etc. Only after completing these tasks can the program jump to the functions written in C. The work outside of data acquisition has very low real-time requirements. Except for keyboard scanning and RTC using low-priority interrupts, other parts are contained within the main program loop. It is particularly important to note that since the interrupt vector table is stored in Flash, all interrupts must be disabled when writing data to Flash. Therefore, data that needs to be saved should first be placed in SDRAM and then written to Flash after a measurement is completed. The manufacturer of the CH375 USB controller provides library files for USB flash drive read/write. Only external functions for reading and writing the CH375 hardware and configuring interrupt service routines to the corresponding interrupts are needed to operate on the USB flash drive's FAT file system. 4.3 Compilation and Debugging The software development environment used in the design is ARM's ADS1.2. Compiling the C language program may generate code for Semihost communication, which includes the SWI software interrupt instruction. However, the design does not include SWI exception handling, and the compiler does not have a corresponding compilation option to remove the Semihost function. Once the SWI instruction is encountered, a software interrupt exception will occur. Therefore, the machine code can be disassembled, the corresponding function found, and redefined. 5 Conclusion The characteristic of embedded systems lies in their highly targeted application. This design fully utilizes the performance and resources of the ARM7 processor, building the entire hardware and software platform according to specific application goals, achieving the goals of high performance and low power consumption. This system has been successfully used in a track inspection instrument prototype and has good reference value for the development and design of other ARM processor-based embedded systems. The innovation of this paper lies in its application of the ARM7 processor in a track detector. Traditional testing instruments often rely on microcontrollers, which are relatively slow and resource-constrained, requiring expansion in many applications, thus hindering power consumption reduction and integration. This innovative combination of ARM7 processor and traditional application represents a significant advancement in information processing technology. The ARM7 embedded platform enhances system performance and integration while transforming traditional system design methods. In particular, the ARM processor's unique interrupt mechanism facilitates more convenient and reliable real-time data acquisition and processing. Furthermore, the high-efficiency power supply system is another highlight of this paper. References [1] S3C44B0X Datasheet [Z]. Samsung. Co. Ltd., 2003. [2] Zhang Juntao, Wang Chang'an. 12b A/D converter MAX197 and its application [J]. Modern Electronics Technology, 2004, (19). [3] Li Xinlong, Zhai Hongfan, Di Guowei, Wang Xin. Application of USB chip CH375 in power measurement instrument system [J]. Microcomputer Information, 2006, (26). [4] Du Chunlei. ARM Architecture and Programming [M]. Beijing: Tsinghua University Press, 2003. [5] Ji Zhenhua. Analysis of S3C44B0 exception handling based on ARM7TDMI core [J]. Microcomputer Information, 2006, (05).
Read next

CATDOLL 138CM Tami Torso Doll

Height: 138 Torso Weight: 18.5kg Shoulder Width: 30cm Bust/Waist/Hip: 64/59/74cm Oral Depth: 3-5cm Vaginal Depth: 3-15c...

Articles 2026-02-22
CATDOLL 115CM Momoko TPE

CATDOLL 115CM Momoko TPE

Articles
2026-02-22
CATDOLL Kara TPE Head

CATDOLL Kara TPE Head

Articles
2026-02-22
CATDOLL 135CM Ya

CATDOLL 135CM Ya

Articles
2026-02-22