introduction
In the construction field such as road and bridge construction, there are many raw material processing control equipment imported from abroad. The operating system on these devices is not the common WINDOWS operating system. Although it can realize the data printing function, these data cannot be stored in the management PC of the WINDOWS operating system as files, so it is not convenient to count and analyze these data, which seriously affects the management efficiency. For this reason, it is necessary to expand the functions of these devices so that they can store the required data as required and provide corresponding data analysis and processing functions, so as to facilitate the work of the management department and improve production efficiency and project management quality.
Solution Analysis
Under the premise of not affecting the normal operation of the original equipment, the data collection function of the parallel printer is completed. The following two solutions are considered:
(1) After the data is output to the printed paper, use the scanner to identify the data on the printed paper and input the identified data into the data management software of the management PC.
(2) Add a data acquisition device between the control device and the printer. The device intercepts data from the parallel port of the control device connected to the printer and completes the data forwarding to the management PC. The management PC is responsible for receiving, counting and analyzing data, as shown in Figure 1.
Figure 1 Schematic diagram of data collection scheme
Compared with the above two solutions, solution (1) requires regular manual operation of the scanner, which is labor-intensive and requires high investment, and it is impossible to guarantee that the data will be completely recognized correctly. The data acquisition device in solution (2) can be completely independent of human intervention, is easy to use, and has a high cost-effectiveness. Therefore, solution (2) is adopted.
In March 1994, the IEEE committee announced the new IEEE1284 parallel interface standard, which defines five working modes of the parallel port. These five modes are Centronics compatible mode (also called standard mode), byte transfer mode, nibble transfer mode, enhanced parallel port (EPP) mode, and extended function port (ECP) mode. The parallel port connected to the printer usually works in Centronics compatible mode, and the other four modes are fully compatible with the parallel port pin definition of this mode. Therefore, the data acquisition system is designed according to the characteristics of this mode, which is also conducive to the expansion and upgrading of other parallel port equipment data acquisition systems in the future.
There are two types of parallel ports: 25-pin and 36-pin. The printer is equipped with a 36-pin standard plug and socket, which actually only uses the signals in the 25-pin plug and socket. The 25-pin signals can be divided into three categories: data signals, control signals, and status signals.
The fastest communication speed of Centronics parallel port can only reach 150kB/S. The author tested the control device and the target printer EPSON LQ-1600K III and found that the communication speed between the two is 50kB/S.
Hardware Design
According to the working characteristics of the parallel port, the author uses a hardware circuit with a 51 series single-chip microcomputer as the core to complete the parallel port data acquisition and forwarding functions. The system circuit block diagram is shown in Figure 2, which mainly includes 6 components:
(1) Central Processing Unit. The communication speed between the control device and the printer is not very high, so the cost-effective AT89C52 is used as the core processing unit. The chip includes 256 bytes of RAM, most of which can be used as a data receiving buffer, so there is no need to expand the RAM unit. The STROBE signal is used as the external interrupt source 0. Whenever the falling edge of the STROBE signal appears, it indicates that the data is in a valid state, and the CPU reads the collected data through the P1 port. The operating frequency of the CPU is selected at 22.1184MHz to ensure that there is a sufficiently long interrupt program response time.
(2) Signal preprocessing. The acquisition system cannot affect the normal operation of the control equipment and printer, so the parallel port input signal needs to be buffered and optically isolated. The buffer chip is 74HC245 and the optical coupler is 6N137.
(3) Data latch. The data retention time of the data line on the parallel port is very short. The latch unit ensures the accuracy of the data read by the CPU each time. The latch chip is 74HC573.
(4) Watchdog and power supply monitoring: The X5045 chip is selected to complete the functions of system power-on reset, system crash reset and power supply voltage abnormality reset.
(5) Communication circuit: The MAX232 asynchronous communication interface chip is used here to complete the function of forwarding data to the management PC.
(6) Power supply. This part is responsible for providing the required power to each circuit module.
Figure 2 System circuit block diagram
The main circuit diagram of the hardware design is shown in Figure 3.
Figure 3 Main hardware circuit diagram of the system
Software Design
Figure 4 is a flow chart of the microcontroller program. The program consists of a main program and an interrupt service program. The interrupt service program is responsible for timely collecting valid data sent to the parallel port by the receiving control device and storing it in the buffer. The main program is mainly responsible for serial communication with the management PC and forwarding the data in the buffer. In this way, the management PC only needs to use a visual programming language to implement a software with data reception and file storage functions to lay the foundation for future data statistics and analysis.
Conclusion
Based on the analysis of the working characteristics of the parallel printing interface, this paper designs a parallel port data acquisition system with 51 single chip microcomputer as the core. This system has been successfully applied to several construction units of expressways. The operation experience shows that the design is simple, stable and reliable, which greatly facilitates the construction units to count and analyze various raw material data.
Previous article:Lithium battery equalization technology solves SOC and C/E mismatch problems
Next article:Design of analog signal conditioning circuit for handheld digital storage oscilloscope
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- Why can't I find the management option in the Download Center?
- How to calculate the saturation of an inductor with a magnetic core? Is there a calculation formula for reference?
- What is the difference between the PLL input clock (1) the clock generated by the XTH crystal oscillator and (2) the clock input from the XTH pin PD00?
- Summary: GigaDevice GD32F350 Innovation Design Competition Participants' Shared Content
- Good stuff for beginners - How to find MSP430 program examples on TI's official website
- MicroPython's GNSS parser micropyGPS
- Please explain the pulse signal code at the bottom that generates a clock cycle every 0.5s
- Project file production and burning
- [GD32L233C] + 7. Using ds18b20 temperature sensor under RTthread
- EEWORLD University ---- Engineer It Series