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.
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
- 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
- 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
- [phyBOARD-i.MX 8M Plus Development Board] Review 3: File Analysis in the System Root Directory
- How to implement without PLC
- SL1584 4-30V/3A 380KHz Buck Circuit
- TI Power Management Experiment Kit Boost Experiment Manual
- Hangxin Data-F070 Development Board & Touch Board Introduction, LCD Board Schematic Diagram
- TI op amp stability analysis
- MSP430F5438 Evaluation Board
- Servo Motor Driver Problems
- [Mil MYD-YA15XC-T Review] + Using QT to read temperature and humidity sensor data
- Question about freewheeling diode