Graphical display of general dot matrix electronic devices

Publisher:Yuexiang666Latest update time:2006-05-07 Source: 国外电子元器件 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Abstract: The current situation and characteristics of general lattice electronic devices are analyzed. Taking drawing two-dimensional curves as an example, the drawing algorithm using the integer digital differential method (INTEGER DDA) is introduced, and the lattice electronic devices are explained in detail. The graphic display principle was verified by combining MGLS-12032A/B LCD and WH4005 micro printer, and achieved relatively good results.

    Keywords: Single chip graphic display dot matrix MGLS-12032A/B WH4005

1 Introduction

In today's world, electronic technology is developing rapidly, and dot-matrix devices have been widely used in the information industry, military industry and other fields. Dot-matrix devices specifically include liquid crystal display modules (LCD) and Chinese character dot matrix printers. As far as displays are concerned, at present, three types of displays are generally used in most microcomputerized systems, namely: CRT screen displays, LED seven-segment displays and LCD liquid crystal displays. CRT monitors have strong functions and are widely applicable, but they are large in size and expensive, and are not suitable for miniaturization and integration. The LED seven-segment display is small and easy to control, but its function is weak and can only display limited numbers and letters. Compared with the previous two, the advantages of LCD are more obvious. It is small in size, powerful in function, easy to control, affordable, and can adapt to the development direction of displays. Therefore, it has gained more and more attention in the fields of communications, home appliances, large-screen design, etc. Wide range of applications. Compared with liquid crystals, micro printers are also based on dot matrix devices. Different from traditional printers, micro printers are small in size, easy to control, and cheap. Therefore, they are widely used in cash registers such as banks and supermarkets. application.

2. Principles and algorithm steps of dot matrix display

The following takes drawing a two-dimensional coordinate curve as an example to briefly describe the drawing principle.

In dot matrix devices, the drawing of two-dimensional curves can generally be divided into the following two steps: The first is to calculate the coordinate values ​​of each point of the drawn graph based on a certain algorithm and store it. This step generally requires the preparation of the algorithm program; the second step is to convert the position of the display point on the dot matrix device based on the point coordinates provided by the algorithm program on the applied dot matrix device, that is, the corresponding unit address of the display buffer and The internal data of the unit is determined to form the required display graphics on the display area. This step requires completing the preparation of the point drawing program. The algorithm program is universal, while the point drawing program needs to be compiled according to the characteristics of the display control equipped with the dot matrix device.

The drawing of curves can eventually be converted into the drawing of straight lines, so you should consider drawing straight lines first. There are many types of algorithms for drawing straight lines. In order to avoid complex floating point operations, the author uses integer digital differential analysis (INTEGER DDA). First draw a straight line with (Xs, Ys) as the starting point and (XE, YE) as the end point, and then make its slope k = (YE-YS)/(XE-XS). The basic idea of ​​the integer digital differential method is to avoid the division operation in the process of calculating the slope k, and apply the relationship between ΔY=YE-YS and ΔX=XE-XS to divide the slope k into four types while ensuring ΔY≥0 situation, and then use EER to indicate the difference between the establishment point position and its actual line in each case to determine the corresponding point construction rules, and finally take the end point situation into consideration. These four situations are:

(1) k=0~1, at this time, ΔY≥0, ΔX≥0, and the relationship ΔY≤ΔX is established. The rules for making points are:

At the current (X, Y) point, if ERR<0, then slow down at (X+1, Y), and ERR=ERR+ΔY;

If ERR≥0, draw a point at (X+1, Y+1), and ERR=ERR+ΔY-ΔX.

Then use the new slow point coordinates as the current (X, Y) point, and use the obtained ERR value as the deviation value of the coordinate point. Repeat the above work until X=XE.

The initial coordinate value of (X, Y) is (XS, YS), and ERR=0.

(2) k>1, then ΔY≥0, ΔX≥0, and ΔY>ΔX. The rules for making points are:

At the glue point (X, Y), if ERR<0, slow down at (X+1, Y+1), and ERR=+ΔY-ΔX.

If ERR≥0, draw a point at (X, Y+1), and ERR=ERR-ΔX. Then use the new drawing point coordinates as the current (X, Y) point, and use the obtained ERR value as the deviation value of the coordinate point, and repeat the above work until Y=YE.

The initial coordinate value of (X, Y) is (XS, YS), and ERR=0.

(3) When k=-1~0, ΔY≥0, ΔX<0, and |ΔY|≤|Δ| The rules for making points are:

At the current (X, Y) point, if ERR<0, draw the point at (X-1, Y), and ERR=ERR+ΔY; if ERR≥0, draw the point at (X-1, Y) point, and ERR=ERR+ΔY+ΔY=ERR+ΔY-|ΔX|.

Then the new drawing point coordinates are used as the current (X, Y) point, and the obtained ERR value is the deviation value of the coordinate point. Repeat the above work until X=XE.

The initial coordinate value of (X, Y) is (Xs, Ys), and ERR=0.

(4) k<-1, ΔY≥0, ΔX<0, and |ΔY|>|ΔX|. The rules for making points are:

At the current (X, Y) point, if ERR<0, draw a point at (X-1, Y+1), and ERR=ERR+ΔY+ΔY=ERR+ΔY-|ΔX|;

If ERR≥0, draw the point at (X, Y+1), and ERR=ERR+ΔY=ERR-|ΔX|.

Then use the new drawing point coordinates as the current (X, Y) point, and the obtained ERR value is the deviation value of the point coordinate point. Repeat the above work until Y=YE.

The initial coordinate value of the (X, Y) point is (XS, YS), and ERR=0.

The program block diagram of a practical algorithm for integer digital differentiation using the MCS-51 instruction set is shown in Figure 1. This program can draw any straight line in the range of (0~255, 0~255), and the quality of the straight line displayed on the dot matrix LCD screen and micro printer is quite good.

Using the technique of drawing straight lines to draw curves is actually to select some key points (the selection of key points is related to the curve being drawn), and then calculate the coordinates of the connecting line between each two points. But there are two points to note here: The first is the issue of calculating the storage order of each point. In straight line drawing, since each row or line column has only one point, it can be calculated while adding points without storage. However, there may be multiple points in each row or column in the curve, and when the dot matrix device is displayed or printed, each row or column is printed and cannot be echoed. This feature makes it difficult to display points in the same row or column. , the coordinates of points calculated at different moments must be displayed at the same moment, so they must be stored first. Then when the curve becomes more complex after related processing, it will cause a rapid increase in the storage capacity, thus requiring a large-capacity data storage. Therefore, it is necessary to predict before designing the circuit to avoid storage overflow.

Reference address:Graphical display of general dot matrix electronic devices

Previous article:EL field display technology and its application in portable electronic systems
Next article:Control technology of graphic dot matrix liquid crystal display module

Latest Power Management 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号