1、外文翻译基于ATC单片机的LED显示控制系统单片机(完整版)(文档可以直接使用,也可根据实际需要修改使用,可编辑 欢迎下载)基于AT89C51单片机的LED显示控制系统 摘 要 本次设计完成基于AT89C52单片机的LED显示控制系统软硬件的设计。我们用一个简单的外部电路控制尺寸为32*192的显示屏,通过一个动态显示模块,这个显示屏也能显示六个32*32的汉字,也能分成两个小的显示屏,能够显示24 个16*16的汉字。我们能通过修改程序来改变显示内容。字幕可以实现滚动功能且滚动速度可以根据要求调节,屏幕也具有暂停功能。汉字代码储存在数据存储器中,储存器的容量可以根据显示汉字的需要扩展。该显示
2、屏具有低电压,硬件电路简单等优点。关键字 LED/汉字/AT89C521 简 介LED显示屏已成为一个重要的标志,在城市照明、现代化、信息社会不断的改善和美化人们的生活环境。LED灯可以应用于大型购物商场、车站、码头、地下车站,各种管理窗口等等。LED产业已成为一个快速增长的新兴产业,具有巨大的市场空间和前景。一些元器件的显示装置的模构通常是由显示模块、控制系统和电力系统。显示模块构成的网格结构由领导,并负责发光显示;屏幕上可以显示文本,图片、视频等,在相应的区域控制系统操控LED光亮或黑暗;电力系统是一个负责屏幕上转换输入电压和电流流进的电压和电流。LED点阵显示提取显示字符的字体通过PC,
3、通过单片机,然后显示在点阵屏,主要用于室内和室外的显示。LED点阵显示可分为图形显示,图像显示和视频显示器显示。相比提高了图像显示的特点图形,无论它是在这两种颜色单色或彩色显示。因此,图形显示不仅反映丰富的颜色,而且录像显示清晰、彩色图像,也表现在电视和电脑的信号。虽然三者之间有一些差异,但是最基本的原则是类似。2 系统整体结构设计单片机(SCM)模型选择相应的目标、功能、可靠性、成本,精度和速度控制系统。根据这个主题的实际情况,选择不同的配置管理模型主要考虑从以下两个方面:第一,供应链管理具有较强的抗干扰能力;第二,单片机具有较高的性价比。mcs51汇编语言是由于广泛应用在中国,有更多的需求
4、,还可以配合外围芯片。ATMEL公司,引进了一种新的一代单片机,即89系列,并通过对典型的产品测试具有较高的性能和较低的成本。AT89C52是一种低电压、高性能CMOS 8位单片机,包括了8 k只读芯片程序内存(PEROM)可以重复删除,256字节随机的存取数据存储器(RAM),装置采用高密度非易失性存储器存储技术。8052年产品,而芯片内置的通用8位元中央处理器(CPU)、Flash存储单元,可以应用到更复杂的控制系统中。该系统实现要求的电路是由AT89C52芯片、时钟电路、复位电路,列扫描驱动电路、行线驱动电路和6个3232 LED点阵。显示单位由两个74 HC154输入点阵数据。串行数据
5、信号分为两个部分,分别给两个8255,8255的数据来自AT89C52主控制器。扫描信号的每个字是由这两个74 HC154,分为6组来输入。信号是由74 HC154,AT89C52的P1.0 P1.3, 外部数据存储器6264与AT89C52共同来控制数据输入。3 系统的硬件电路设计3.1 核心控制系统电路的设计汉字的大小是1616,但是单片机I / O端口不能满足设计的要求,因此I / O端口必须扩展。数据端口实现扩展是两个8255来实现的。通过74 HC373的低八个地址来给6264提供的信号,但高八个地址所提供的信号P2.0 P2.7,74 HC139是2 - 4解码器,其输入信号由P2
6、.6控制,单片机提供了控制外部的I / O设备,因为这个系统有超过一个的外部的装置,确保他们不应该是干扰的,因此保证他们的地址是唯一的,不重复。时钟电路由AT89C52 的18、19脚从时钟侧(XTALI和XTAL2),和12兆赫晶体,电容C1和C2。3.2显示存储单元设计汉字显示设计大小为3232显示屏,每个字符包括四个部分,每一个包括四个矩阵大小是88的小点阵块。显示一个字符需要两个74 HC154列扫描信号来提供。电路是通过动态扫描信号来显示,单片机把要求显示的数据传给了两个8255。这样人类的眼睛会看到一个稳定的图像。因为人类的眼睛视觉停留的现象。此外,因为汉字每一个显示需要128字节
7、的存储空间,但AT89C52单片机芯片只有256字节数据存储器,它是远低于设计要求,所以我们扩大了存储空间采用88 K外部数据存储器6264来实现的。3.3数据输入单元设计8255 Inte1是一种通用可编程并行输入/输出接口芯片。它的功能可通过设定软件程序,具有很强的通用性。它可以直接通过数据总线连接到中央处理器外部设备,使用方便、灵活。Inte18255A有三个8位并行接口芯片的输入和输出端口、编程方法可以被用于设置三个端口作为输入端口或输出端口。当这些数据通过数据总线上的CPU,采用无条件转让、查询传输或中断传输。当端口C作为一个数据端口,它不仅可作为8位数据端口,但也分别的作为两个4比
8、特数据端口,可以设置一个特定的一些输入或输出,就这样提供了便利的条件控制。在显示单元电路的设计,这些线条数据送给两个8255。这个设计使用动态显示方式。显示中文可以控制行或列扫描,系统采用的方法列扫描控制屏幕。列扫描电路由12块74 HC154。 两块提供74 HC154传送显示一个字符。74 HC154输入信号是P1.0 P1.3提供通过AT89C52来控制的。3.4 串行通信接口设计PC和单片机通过串行通信联系方式。为了实现串行通讯单片机与PC机采用串口通信方式,接口是标准RS - 232。在PC机的输出电压的RS - 232 C端口12 V。考虑到单片机和PC短距离通信,单片机主要负责接
9、收的命令和数据。从信号PC机的TXD-side都变成一个电流信号通过交流电路,红外光-发光二极管的电流有一个信号发生,灯发出的信号二极管投射到了phototransistor,并转换为电信号,然后输入到单片机RXD身边,所以光电转换已经实现,并且电气完全隔离以避免反馈干扰的输出端所产生。4 软件设计整个软件设计的主要构成由显示程序和通讯程序。汉字显示的数据传输控制显示函数采用动态扫描。主机软件实施视觉显示效果。在标准串行通信,可以设置的串行通讯数据发送和接收,便于单片机与PC机间通信。为了保证可靠的通讯,确保双方都相同的数据格式和波特率,该设计采用RS - 232通讯,10位数据格式,9600
10、位/秒波特率。软件程序由一开始,初始化,显示程序。字符编码储存在静态的6264,配置管理工具将等待信号给出。当P3.0是低电平时,显示程序开始运行。首先,控制到8255年控制字写端口,8255工作采用模式0的方式。在控制完成后,将会把显示的数据转移到8255上,一排一排的数据输入,每个第一排的信号控制下一排的开启信号。在单片机是封闭的数据传输后,这样的第一列显示数据,然后叫延迟程序显示内容的稳定。第二列数据读取程序延迟后结束了,下一个行是封闭的,所以第二栏里的数据也是如此显示,等等。因为屏幕尺寸是32192,192行显示,显示屏可以构成一幅稳定而且完整的图像。总结LED显示系统的设计采用了主机
11、和从属结构、主机电脑,供给从属电脑显示器上系统通过串行通信接口,它可以实现字符串修改、展示模式设置,时间设置和其他功能;单片机控制从属结构为主结构显示LED点阵显示屏。汉字显示是 3232点阵模型,实现实时显示屏幕显示的变化,显示当前日期和时间。LED点阵的设计显示控制系统具有电路简单、稳定、低功率消耗、寿命长、易于显示等特点。只要通过扩展单片机的I / O,同时增加不同的LED点阵和相关驱动芯片,你就可以设计一个更大的面积和更多LED显示屏。本文提供了一些理论和实践的参考价值。Design of LED Display Control System Based onAT89C52 Singl
12、e Chip MicrocomputerABSTRACTTHIS paper introduces display design process about hardware and software based on AT89C52 single chip microcomputer. We use a simple external circuit to control the display screen, which size is 32 192. The display screen also can display the size of the six 32 32 dot mat
13、rix Chinese characters by a dynamic scan mode, and can be divided into two small display screens, which can display twenty-four Chinese characters whose size is 1616. We can modify the code to change the content of the display, subtitles can achieve scrolling function and the scroll speed can be adj
14、usted according to requirements, subtitles can also achieve pause function. The Chinese character code stored in external data memory, the capacity of data memory is expanded according to the requirements of Chinese characters we want to show. This display screen has advantages of small volume, few
15、hardware and simple circuit structure.KEY WORDS LED, Chinese Character Display, AT89C52I. INTRODUCTIONLED display has become an important symbol of the city lighting, modernization and information society with continuous improvement and beautification of peoples living environment. LED lights can be
16、 seen in the large shopping malls, railway station, docks, underground station, and a variety of management window and so on. LED business has become a fast-growing new industry, a huge market space and bright prospects. The text, pictures, animation and video are displayed by LEDs light, and conten
17、t can be changed. Some components are the display devices of the modular structure, and which usually consists of a display module, control system and power system. The display module is constituted by the lattice structure which consists of LED, and is responsible for light-emitting display; the sc
18、reen can display text, pictures, video and so on by control system which can control light or dark of LED in the corresponding region; Power system is responsible for transforming input voltage an d current into voltage and current which the screen needs. LED dot matrix display extracted display cha
19、racter font through PC, and sent to the microcontroller, then displayed in the dot matrix screen, which mainly used for display of indoor and outdoor characters. LED dot matrix display can be divided into graphic display, image display and video display by displayed content. Compared with the image
20、display, the characteristics of graphic display is no difference in gray color whether it is monochrome or color display. Therefore, graphic display also fails to reflect the richness of color, and video display can not only show exercise, clear and full-color images, but also show television and co
21、mputer signals. Although there are some differences between the three, but the most basic principles are similar,II. System Overall Structure DesignSingle Chip Microcomputer (SCM) models were selected according to the target, function, reliability, cost, accuracy and speed of the control system. Acc
22、ording to the actual situation of the subject, the choice of SCM models mainly considered from the following two aspects: First, SCM has strong anti-interference ability; Second, SCM has a higher cost-effective. Due to MCS-51 is widely used in China, has more information and can compatible with the
23、more peripheral chips too, in particular, ATMEL Corporation, introduced a new generation microcontroller in 2003, that is 89S series, and its typical products with high performance and low cost microcontroller is AT89C52. AT89C52 is a low voltage, high-performance CMOS 8-bit microcontroller, the chi
24、p includes 8 KB read-only program memory (PEROM) which erase can be repeated, 256byte random access data memory (RAM), devices adopt high-density nonvolatile memory technology to produce, compatible with the standard MCS-51 instruction set and the 8052 products, while the chip built-in general-purpo
25、se 8-bit central processing (CPU). Flash storage unit, can be applied to the more complex control applications. The system was realized by the circuitry which is made up of AT89C52 chip, Clock circuit, reset circuit, column scan driver circuit, line drive circuit and the six 32 32 LED dot matrix, th
26、e overall structure of LED characters display is shown in Fig.1. A display unit is composed of dot matrix and two 74HC154. Line data signal is divided into two parts, which is given by the two 8255A respectively, but the 8255A data are from the P0 port the master controller AT89C52. The column scann
27、ing signal of each character was given by the two 74HC154, the 74HC154 12 pieces and was divided into six groups. The input signal of 74HC154 was given by the P1.0P1.3 of AT89C52. External data memory 6264 connected with the AT89C52 the P0 port.III. SYSTEM HARDWARE CIRCUIT DESIGNA. Circuit Design of
28、 MCU Control SystemThe size of Chinese characters is 32 32, but microcontroller has 32 I/O port, and cant meet design requirements, so the I/O port must expand, the data port expansion was implemented by two 8255A. The data port expansion is shown in Fig.2, 74HC373 is the address latch, and latch lo
29、w eight address, the low eight address signals of 6264 provided by it, but the high eight address signals of 6264 provided by P2.0P2.4, Internal port of 8255A was chosen by A0 and A1. 74HC139 is 2-4 decoder, whose input signals are provided by P2.6 and P2.7 of SCM, and provided strobe for the extern
30、al I / O devices, because the system has more than one external device, make sure that they can not be gated, so that their addresses is the only and do not repeat. The clock circuit of AT89C52 composed of 18, 19feet from the clock side (XTALI and XTAL2), and 12MHz crystal, capacitor C1 and C2.B The
31、 Circuit Design of Display Memory UnitThe size of Chinese characters is 3232 in the design, each character composed of four parts which each part composed of four LED matrix which the size is 8 8, circuit decomposition map of display unit. In addition, because the Chinese character for each display
32、needs 128 bytes storage space, but AT89C52 microcontroller chip is only 256 bytes data memory, it is far less than the design requirements, so we the expanded storage space by 8K 8 external data memory 6264. C The communicate Design of PcInte1 8255A is a universal programmable parallel input/output
33、interface chip. Its function can be set through the software program, and has a strong versatility. It can be directly through the CPU data bus connected to external devices, easy to use and flexible. Inte18255A interface chip has three 8-bit parallel input and output ports, programming methods can
34、be used to set three ports as input ports or output ports. Chips work have the basic input and output, strobe input/output and bidirectional input / output. When the data were transmitted by data bus of CPU, its can choose to unconditionally transfer, query transmission or interrupt transmission. Du
35、ring Inte1 8255A chip three-port, the port C can be used as not only the data port, but also the control port. When the port C is taken as a data port, it can be used as not only 8-bit data port, but also separately as two 4-bit data port, and each bit of the port C can be operated, can set a partic
36、ular bit to input or output, so provide convenient conditions for bits control. D Serial Communication Interface CircuitPC and SCM are linked via a serial communication interface. In order to implement serial communication function between MCU and PC, and serial interface level of SCM will be change
37、d into standard RS-232C level. MCU and PC, taking into account the short distance communication, and microcontroller is mainly responsible for receiving commands and data, so the PC is directly connected with the microcontroller, this is the simplest connection method. the signals which is from Pacs
38、 TXD-side were changed into a current signal through the communication circuit, the infrared light emitting diodes of optocouper have current when a signal occurs, the light signals which is emitted by diode projected onto the and phototransistor, converted to electric signal, then input to the micr
39、ocontroller RXD side, so photoelectric conversion is implemented, and electrical is completely isolated to avoid the feedback and interference which is produced by output side. IV. SOFTWARE DESIGNThe entire software design mainly composes of display program and communication program. The Chinese cha
40、racters to be displayed on the screen, character and other data for transmission control and display functions were achieved by dynamic scan. Real time communication parts which communicate with PC receive data information by SCM serial disruption, so real-time data information transmission with PC
41、was implemented. The host computer software was implemented by Visual Basic. In the standard serial communication, MSCOMM which is the power communication control is provided by VB, it can set the serial communication of data sent and received, and the serial communication portStatus, message format
42、s and protocols are set, directly send data by Pacs RS -232/RS-485 serial ports. In order to realized to PC reliable communication with SCM, and ensure that both sides have the same data format and baud rate, this design uses RS-232 communications, a 10 bits data format, 9600bit / s baud rate. Softw
43、are program composed of the beginning, initialization, display program, front, which the mainCharacter code stored in the static memory 6264, and the SCM will wait for signal is given, that is, the input signal of SCM pin P3.0. When P3.0 is from low to high, display program begin to be run. First, c
44、ontrol words written to 8255A control port, 8255A work in the form of mode 0 in the design. After control word was finished, the data will be displayed which is transferred to the 8255A from the 6264, the display data is output for four times because the line width of the characters screen is 32, a
45、row of data is input and transported from top to bottom each, signal of the first rows which is controlled by SCM is gated after data transmission is over, so the first column data is displayed, then call delay procedures to display the contents of the stable. the next column of data is read after d
46、elay procedures is over, and the next row is gated, so that the second column of data is also displayed, and so on, because the screen size is 32 192, 192 rows are shown, and 192 rows constitute an image. Then, scanning begin from the first column, and the starting address of display data backward s
47、hift on the basis of the original, which has an address overflow issues, it will assign start address to the address pointer when the data address is overflow, the display data content will be constantly repeated. Flow chart of communication with PC and SCM is shown in Figure 10. Real-time communica
48、tion parts which communicate with PC receive data information by SCM serial disruption, so real-time data information transmission with PC was implemented.CONCLUSIONLED display system that was designed adopted the host computer and slave structure, the host computer is PC, and communicated with slav
49、e computer display system through the serial communication interface, which can implement string modification, display mode settings, time settings and other functions; The slave mainly implement display of LED dot matrix display screenThis was controlled by SCM. Chinese character display is 32 32 dot matrix model, and to achieve real-time screen display changes, and have to display the current time and date functions. The design of LED dot ma