Driver design of micro printer based on FPGA and VHDL

Publisher:量子启示Latest update time:2011-03-30 Source: 维库Keywords:FPGA Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Abstract: In order to replace the traditional use of single-chip microcomputer to drive the micro printer, the hardware control circuit of the printer is designed using the FPGA chip EP3C25Q240C8N of Altera Company, and the working timing of the micro printer is correctly controlled. The software uses the hardware description language VH DL to realize the timing control of the micro printer, and is downloaded to the FPGA through the Quartus software platform for debugging. It proves that this method is effective and can completely replace the traditional use of single-chip microcomputer to drive the micro printer. It has good anti-interference, high reliability and strong portability.

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.

Double row socket pin number

Figure 1 Double-row socket pin number

Table 1 Pin definitions of micro printer 26 parallel port

Micro printer 26 parallel port pin definition

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.

Parallel Interface Timing Diagram

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.

FPGA and printer connection diagram

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.

Software Development Flowchart

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.

State Transition Diagram

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.

Keywords:FPGA Reference address:Driver design of micro printer based on FPGA and VHDL

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

A brief analysis of the development and relationship of the two major markets of DSP and FPGA
  With the rapid development of many vertical sub-industries in the analog IC market, traditional DSP devices have encountered competition from various alternative signal processing platforms, of which FPGA is a typical example. With the advantages of high density, low power consumption and low cost, FPGA not only per
[Embedded]
Design and simulation of sub-image extraction module of linear CCD based on FPGA
In industrial production automation systems, the use of computer vision and image processing technology to achieve product quality monitoring and control has gradually become an effective application technology. Linear array CCD image sensors are widely used in many fields such as product size measurement and classifi
[Power Management]
Design and simulation of sub-image extraction module of linear CCD based on FPGA
Application of ARM7 combined with FPGA
  Industrial control often requires multi-channel fault detection and multi-channel command control (this multi-task setting is very common). A single CPU chip is difficult to directly complete multi-channel inspection and control tasks due to its limited number of external control interfaces. Therefore, it is a very g
[Microcontroller]
Application of ARM7 combined with FPGA
Design of Signal Generator Based on FPGA and 51 Single Chip Microcomputer
Signal generator, also known as waveform generator, is a commonly used signal source and one of the important instruments widely used in the fields of electronic circuits, communications, control and teaching experiments. In order to reduce the cost of traditional function signal generators and improve the low-frequen
[Microcontroller]
Design of Signal Generator Based on FPGA and 51 Single Chip Microcomputer
基于FPGA的核物理实验定标器的设计与实现
简介:介绍使用现代EDA手段设计核物理实验常用仪器——定标器的原理和实现方法。新的定标器利用FPGA技术对系统中大量电路进行集成,结合AT89C51单片机进行控制和处理,并增加数据存储功能和RS232接口,实现与PC机通信,进行实验数据处理。本文给出详细新定标器设计原理图和FPGA具体设计方案。 定标器在大学实验中有很广泛的应用,其中近代物理实验中的核物理实验里就有2个实验(G-M计数管和β吸收)要用到高压电源和定标器,而目前现有的设备一般使用的是分立元器件,已严重老化,高压极不稳定,维护也较为困难;另一方面在许多常用功能上明显欠缺,使得学生的实验课难以维持。为此我们提出了一种新的设计方案:采用EDA进行结构设计,充分发挥FPGA
[Microcontroller]
基于FPGA的核物理实验定标器的设计与实现
Design and FPGA Implementation of Carrier Tracking in DS-OQPSK System
0 Introduction Carrier synchronization is an important practical problem in wireless communication systems and a key technology for baseband signal processing. The main factors that lead to carrier frequency and phase uncertainty are: first, the drift of the frequency source will cause the drift of the carr
[Embedded]
Design and FPGA Implementation of Carrier Tracking in DS-OQPSK System
FPGA Design and Implementation of Frame Synchronization System
1 Introduction In digital communication, a certain number of code elements are usually used to form "words" or "sentences", that is, to form "frames" for transmission. Therefore, the frequency of the frame synchronization signal can be easily obtained by dividing the bit synchronization signal, but the begi
[Embedded]
FPGA Design and Implementation of Frame Synchronization System
Intel, which once led the PC era, is now joining the automotive industry?
Intel, which once led the PC era, sees the automotive industry as the next hot spot after missing out on the mobile era.   Data shows that currently, 8,000 chips may be needed in a car, and as the complexity of cars increases, the demand for automotive semiconductor components is bound to grow steadily. According to t
[Embedded]
Intel, which once led the PC era, is now joining the automotive industry?
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号