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
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
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
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
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
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
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.
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
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
- [FreeRTOS check-in station 3 is open] Task status and switching, closing time is August 20
- New feature! You can add videos directly to your posts~~~~ No worries~~
- Application of Standing Wave Ratio Analysis Module in Leaky Cable Monitoring System
- DSP system design-DSP development dynamics issues
- What is the function of the INCREMENT COMPONENT PART NUMBER button in PROTEL99?
- MicroPython Retro Gaming on Wio
- Why does the actual throughput of zynq not exceed 10Mbps after configuring 100M Ethernet?
- MicroPython simple task scheduler
- [2022 Digi-Key Innovation Design Competition] Distributed Temperature and Humidity Acquisition System - Brief Design Overview
- CC2541 Bluetooth Watchdog Mode