0 Introduction
FPGA stands for Field Programmable Array. It is a new type of high-performance programmable logic device developed on the basis of CPLD. FPGA has a high degree of integration, and its device density ranges from tens of thousands of gates to tens of millions of gates. It can complete extremely complex timing and combinational logic circuit functions, and is suitable for high-speed, high-density high-end digital logic circuit design. The new generation of FPGA even integrates the core of the central processing unit (CPU) or digital processor (DSP), and performs software and hardware co-design on a piece of FPGA, providing powerful hardware support for the realization of programmable system on chip (SOPC). For the drive of micro printers, the traditional method is to use a single-chip microcomputer to realize its timing control. With the popularization of FPGA in various fields and the need for micro printers, it is necessary to realize the timing control of micro printers by FPGA.
At present, various ASIC chip manufacturers have successively developed HDL languages for their own purposes, but most of them are standardized and universal. The only one that is recognized is the VHDL language developed by the US Department of Defense, which has become the IEEE ST D_1076 standard. In addition, judging from the recent development of HDL languages, the hardware circuit design tools developed by many companies are gradually moving closer to the VHDL language, so that their hardware circuit design tools can also support the VHDL language.
VHDL language can support top-down and library-based design methods, and also supports FPGA design.
1 Introduction to Micro Printer
RD DH type micro printer adopts thermal heating dot matrix printing method. It is a small and fast printing output device. This type of printer can use standard parallel interface, RS 232 serial interface, TTL level serial port, 485 interface, USB interface, printing speed reaches 50 m/s, resolution is 8 dots/mm, 384 dots/line, and printing paper uses 57 mm thermal paper. It can print all Chinese characters and Western characters and icons in the first and second level Chinese character library of the national standard, a total of 8,178. The parallel interface of the micro printer is compatible with the CENTRONICS standard interface and can be directly controlled by the microcomputer parallel port or single-chip microcomputer. The pin number of its 26-wire double-row socket is shown in Figure 1. The signal definition of each pin of the 26 parallel ports is shown in Table 1.
Figure 1 Double-row socket pin number
Table 1 Pin definitions of micro printer 26 parallel port
The driving of the printer is mainly to correctly control its working timing. The timing diagram of the RD DH type parallel interface is shown in Figure 2.
Figure 2 Parallel interface timing diagram
2 Overall system design
The FPGA chip EP3C25Q240C8N of Altera's Cyclon? series is used to realize the hardware circuit control of the RD DH type micro printer, and the Quartus development tool is used to realize the software functions of the micro printer through VHDL language.
2.1 Hardware circuit design
Figure 3 shows the connection diagram between the printer and FPGA.
DATA 1~DATA8 represent the 8 data bits of the printer, their logic "1" represents high level, and logic "0" represents low level; STB is the data selection trigger pulse, and data is read in at the falling edge; ACK is the answer pulse, and the low level indicates that the data has been accepted; when BUSY is at a high level, it means that the printer is busy and no data is received at this time.
Since ACK and BUSY output a 5 V TTL level, and the FPGA I/O port standard is 3.3 V LVCMOS level, when these two signals are used as FPGA input signals, voltage division must be performed to ensure normal operation of the circuit.
Figure 3 Schematic diagram of FPGA and printer connection
2.2 Software Design
The software platform uses Altera's FPGA development platform Quartus.
Quartus provides a design environment that is independent of device structure. Designers do not need to be proficient in the internal structure of the device. They only need to use the input tools they are familiar with (such as schematic input or digital circuit description language input) to design. Quartus can be used to convert these designs into the format required by the final structure. Detailed knowledge about the structure has been written into the development tool software, and designers do not need to manually optimize their designs. The software development process is shown in Figure 4.
Figure 4 Software development flow chart
Use VHDL hardware description language for software design.
The driving of the micro printer is mainly to correctly control its working timing. The common state machine of VHDL is used to control the working timing of the printer. According to the timing shown in timing diagram 1, the state machine uses 4 states. The state transition diagram is shown in Figure 5.
In the initial state STATE0, the data enable trigger pulse signal STB is set to "1" (high level) to detect whether the printer is busy. If the printer is in the idle state (busy = "0"), it will enter the next state STATE1, otherwise (busy = "1"), continue to execute STATE0; in state STATE1, write data to the printer and directly enter the next state; in state STATE2, set the data enable trigger pulse signal STB to "0", the printer reads the data and enters the next state; in state STATE3, detect whether the data has been accepted. If the data has been accepted (ACK = "0"), the printer enters the initial state STATE0 and waits for new data. If the data has not been accepted (ACK = "1"), continue to execute STATE3 until the data is accepted.
Figure 5 State transition diagram
3 Conclusion
The micro printer driver designed using FPGA and V HDL hardware description language can complete the timing control of the printer through system debugging, and is currently in normal use in a certain type of tester. The design system has simple control, strong anti-interference, high reliability, good portability, and can be used in any system using FPGA chips, with certain application prospects.
Previous article:Design of Synchronous Digital Multiplexer for Portable Satellite Station Based on FPGA
Next article:Design and implementation of IRTG-B codec based on FPGA
Recommended ReadingLatest update time:2024-11-16 21:57
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- MATLAB and FPGA implementation of wireless communication
- Intelligent computing systems (Chen Yunji, Li Ling, Li Wei, Guo Qi, Du Zidong)
- Summary of non-synthesizable statements in FPGA
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Wi-Fi 7 is here. How powerful is it?
- [HPM-DIY] HPM6750 MicroPython transplantation is successful
- Looking to buy a PSoC4 development board
- What are the differences between STM32F103ZET6 and STM32F103RCT6
- The Internet of Things Conference starts this weekend. Is anyone in the forum going to attend?
- CCS configures include path and lib path
- IKS01A3 driver transplantation, LPS22HH pressure and temperature detection for STM32G474RE
- Problems with TPA series amplifier chips
- Has the 38 Degree Fever forum been blocked?
- MSP432 learning experience: system tick timer