Design of LCD display control circuit based on AT89S52

Publisher:GoldenDreamLatest update time:2012-11-12 Source: 21ic Keywords:AT89S52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 AT89S52 MCU Introduction

1.1 Main features of the chip

The AT89S52 microcontroller is a high-end, enhanced product recently launched by Atmel. It is a low-power, high-performance CMOS 8-bit microcontroller, with a general-purpose 8-bit central processor and ISP FLASH storage unit, 8 kB ISP (In-system programmable) FLASH read-only program memory that can be repeatedly erased and written 1,000 times. The on-chip FLASH allows the program memory to be programmable in the system and is also suitable for conventional programmers. The device is manufactured using Atmel's high-density, non-volatile storage technology, compatible with the standard MCS-51 instruction system and 80C51 pin structure. On a single chip, it has a smart 8-bit CPU and in-system programmable FLASH, making the AT89S52 a highly flexible and cost-effective solution for many embedded control application systems.

1. 2 AT89S52 pin arrangement

The AT89S52 microcontroller has three packaging types: PDIP, PLCC and TQFP (see Figure 1 for the common PDIP arrangement).

Figure 1 AT89S52 MCU pin arrangement

Figure 1 AT89S52 MCU pin arrangement

2 DMC20261 LCD display

The DMC20261 LCD module consists of three parts:

LCD controller, driver, and display. See Figure 2.

Figure 2 LCD internal structure diagram

Figure 2 LCD internal structure diagram

At present, most LCD monitors use an integrated controller model HD44780. HD44780 is a controller and driver integrated circuit dedicated to character display control and driving.

HD44780 is a representative circuit of character LCD display controller. Its main features are:

HD44780 is not only a controller but also has the ability to drive 40 @ 16 dot matrix LCD pixels, and the driving capability can be expanded to 360 columns through an external driver; the display buffer and user-defined character generator CGRAM are all built-in; it has an interface suitable for the M6800 series MPU, and the interface data transmission can be 8-bit data and 4-bit data transmission in two ways; it has a simple but powerful instruction set, which can realize display functions such as character movement and flashing (see Table 1); due to the limited DDRAM capacity of HD44780, the characters that HD44780 can control are up to 80 words per line, that is, 5 @ 80 = 400 points, and it has 16 row drivers and 40 column drivers, so HD44780 itself has the ability to drive 16 @ 40 dot matrix LCD (that is, 16 characters in a single line and 8 characters in 2 lines); the built-in character generation memory (CGROM) 160 different dot matrix character graphics have been stored (see Figure 3), for example, the code for the number / 10 is 00110001B (31H), and the code for the capital letter / A0 is 01000001B (41H).

2.1 LCD controller instructions

There are 11 commands for character LCD, and their detailed functions and usage are shown in Table 1.

Table 1 LCD instruction table

Table 1 LCD instruction table

2.2 Character graphic code

Character graphic code (as shown in Figure 3).

Figure 3. Correspondence table of CGROM and CGRAM character graphics codes of LCD display

Figure 3. Correspondence table of CGROM and CGRAM character graphics codes of LCD display

3 Design of LCD and AT89S52 interface

3.1 Hardware circuit design

In actual applications, there are many ways to connect LCD modules to single-chip microcomputers. There are serial and parallel modes based on the number of I/O port lines occupied. The serial mode is slower and occupies fewer I/O ports. The parallel mode is divided into 4-wire and 8-wire, faster and occupies more I/O ports. In actual applications, the parallel mode is the most common. At present, the 51 series single-chip microcomputer is the most widely used type at home and abroad. The following introduces the interface circuit designed by the author for your reference. [page]

The connection circuit between some pins of the microcontroller's P0 and P3 ports and the DMC20261 LCD display is shown in Figure 4.

Figure 4 LCD display and control circuit

Figure 4 LCD display and control circuit

3.2 Software Design

A simple display program is written based on the DMC20261 character graphic code and the instruction characteristics of the controller / Huaian Vocational College 0. Among them, P35 is the command/character, P36 is read/write, P37 is the pulse pin, and P0 port is the data terminal. Each Chinese character occupies 5 columns and 8 rows of dot matrix, and two rows can program up to 16 characters. The main program flow chart is shown in Figure 5. The program written and debugged successfully using the adjustment software Dev C + + IDE is attached later.

Figure 5 Main program flow chart

Figure 5 Main program flow chart

Note: * indicates it can be 0 or 1.

The control system utilities are as follows:

4 Conclusion

This article introduces the design method of the interface between the LCD display and the AT89S52 microcontroller. The hardware circuit and software are simple and easy to implement. The AT89S52 high-performance microcontroller has low power consumption, strong compatibility, and an ISP FLASH in-system programmable unit that can be repeatedly erased and written 1,000 times.

The DMC20261 LCD display has a simple but powerful instruction set, which can realize display functions such as character scrolling and flashing, and the text is clear and accurate. It is widely used in intelligent instruments and various publicity places, providing a highly flexible and cost-effective solution for embedded control systems.

Keywords:AT89S52 Reference address:Design of LCD display control circuit based on AT89S52

Previous article:A wireless remote control analysis solution using AT89C51 as the control core
Next article:Digital design of a helicopter control protection box based on AT89S52

Recommended ReadingLatest update time:2024-11-16 15:58

Design of signal generator based on AD9851
  introduction   Direct Digital Synthesis (DDS) is a new electronic technology in recent years. A notable feature of the DDS system is that it can process frequency and phase accurately and quickly under the control of a digital processor. In addition, the inherent characteristics of DDS include: fairly good frequen
[Microcontroller]
Design of signal generator based on AD9851
Design of Automatic Resistance Tester Based on AT89S52
  0 Introduction   With the advancement of science and technology, the number of electronic components has increased dramatically. The measurement of resistance has been widely used in measurement technology and product development. Using a multimeter to measure resistance can no longer meet people's needs. Therefor
[Microcontroller]
Design of Automatic Resistance Tester Based on AT89S52
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号