LED display screen (graduation project)
Author:Lost Memory Time:2021-09-10 13:31 Browse(841)
Absrtact: the dynamic display of ordinary LED dot matrix display screen is usually driven by hardware scanning, This is not flexible enough in some occasions that need special display.
this paper proposes a design method to realize the flexible dynamic display and remote monitoring of display screen by using the communication between PC and MCU.

LED display screen (graduation project)

at the same time, this method can preview the display content on PC.
key words: LED; Dynamic display; Remote control; Display preview
1 Introduction LED dot matrix electronic display is a large-scale display system integrating microelectronics technology, computer technology and information processing technology.
with its bright colors, wide dynamic range, high brightness, long service life, stable and reliable operation, it has become an ideal choice for many display media and outdoor work display.
at the same time, it can also be widely used in military, military and other fields Many industries, such as railway station, hotel, sports, news, finance, securities, advertising, transportation, etc.
at present, most LED dot matrix display systems have their own font.
the realization of their display and dynamic effect (mainly the scrolling of display content) mainly depends on the hardware scanning drive.
although this method is relatively convenient, However, the display can only be carried out according to the pre design.
in fact, some special dynamic display requirements are often encountered.
for example, the up and down movement of the arrow in the elevator running, the bar display of the amplitude of some intelligent meters, the trademark display of manufacturers in advertisements, etc.
at this time, the general display system is difficult to meet the requirements.
in addition, due to the limitation of the memory itself, Its special characters or patterns are often difficult to display, and the display content can not be changed at will.
this paper proposes a communication method of LED display system controlled by PC and single chip microcomputer.
this paper introduces a communication method of LED display system controlled by PC and single chip microcomputerThis method can control the display content (including Chinese characters and special symbols) in real time.
so as to achieve a variety of dynamic display effects such as flashing, scrolling, typing, etc.
this method can also adjust the speed of dynamic display.
at the same time, users can preview the display effect on PC, The display content can also be modified immediately.
in addition,
the remote control of the display system can be realized through the standard RS232 / 485 conversion module.
2 system hardware design the main hardware design of the system is the display control part of the lower computer single chip microcomputer.
the interface between the upper computer (PC) and the single chip microcomputer display control part is the standard RS232 communication mode.
if the remote control is needed The specific LED display control circuit is shown in Figure 1.
the whole circuit is composed of 89C52, 6264, ULN2803, TIP122, and The electronic screen designed by this circuit can display 10 Chinese characters.
it needs 40 8 characters × 8 LED dot matrix module, can be composed of 16 × Because AT89C52 has only 8K memory space, and the content displayed is controlled by PC, it is impossible to store the content to be displayed in the single chip microcomputer as a lattice in advance, However, the PC can only transmit the lattice data to the MCU immediately and store it in the buffer 6264.
the display of the circuit adopts the line by line scanning mode.
when it works.
the MCU takes out the first line of lattice data to be displayed from the buffer,Then, the column lattice data input port P1.2 is input to the column shift register in sequence by bit, and the order of data input is opposite to that of display content.
then, the row lattice gate port p1.3 is set to 1.
that is, the D of the row shift register is set to high level, STR is enabled (all OE pins of 4094 are connected with + 5V level), So that the data in the column shift register can be output in parallel at the same time to gate the row.
after a period of delay, the next row of lattice data can be displayed.
it should be noted that.
only one row of data can be gated at a time, The main functions of PC include the selection of display subsystem, the selection of display mode (including static, flashing, scrolling, typing, etc.), In general, the microcontroller receives the indication from PC through RS232 / 485 and scans the line by timer interrupt.
one line is interrupted each time, The timing interrupt time is 1.25 MS, so the refresh rate of the whole screen is 50 Hz, so there is no flicker.

the method to adjust the dynamic display speed is usually to change the interrupt time of the timer.
but when the display speed is very slow, this method is easy to reduce the refresh rate of the whole screen, So that the display content flickers.
this design uses a "soft timing" method, that is, naming a variable as a "soft timer" in the program to set the time interval between two dynamic displays.
this design uses a "soft timer" methodWhen counting timer interrupt calls.
if the number of calls reaches the set value, change the display content.
in order to ensure normal display.
the set value of "soft timer" must be greater than the whole screen display cycle.
because each line of the display screen displays 1.25ms.
the whole screen display cycle is 20ms, considering the margin, The setting value of the soft timer can be set at more than 30ms.
in this way, the dynamic display can be realized.
the setting value of the "soft timer" can be changed by the upper PC.
in this way, the speed of the LED dynamic display can be adjusted, and the flow and flicker free feeling of the display content can be maintained.
3.1 the dynamic display of the single chip microcomputer can control the above mentioned static, flicker and flicker Scrolling and typing are actually different methods for line scanning processing by MCU timing interrupt program.
the following will explain how to realize these four display modes.
static display only needs to call the corresponding line of display data from the display buffer in the timing interrupt program.
then select the line to realize the display of the line, The whole content can be displayed.
the flashing display is similar to this.
the difference is that a "soft timer" timing time should be interval. During line scanning, the d end of the line shift register will enter all zeros, so that the whole screen will not be displayed, so as to ensure that the black screen time is equal to the display time, In order to realize the flashing display of Chinese characters or symbols.
scrolling display requires the content to be displayed to move one column in the specified direction (here, take right to left as an example) every certain time.
in this way, the display screen can display more content.
it is necessary to change the content of the display buffer before moving the display next time,The specific operation method is as follows: set a display buffer (as shown in Figure 2).
the buffer should include two parts: one part is used to save the 10 Chinese character dot matrix data displayed on the current LED display screen; the other part is used to save the 10 Chinese character dot matrix data displayed on the LED display screen; The other part is the lattice data pre loading area, which is used to store the lattice data of a Chinese character about to enter the LED display.
the scroll pointer always points to the rightmost origin of the display.
when the scroll pointer moves to the first address of the first Chinese character in the lattice data storage area to be displayed.
the display buffer LED display area is blank, However, the pre loading area has saved the lattice data of the first Chinese character to be displayed.
when scrolling display is needed.
the lattice data of the corresponding row in the display buffer can be shifted one bit to the left in each row scanning interrupt processing program of the next scanning cycle, At the same time, change the content of the display buffer.
(note that.
to ensure that the operation can be completed within 1.25ms interruption time.
here 89C52 uses 22mhz crystal oscillator.
experiments show that the operation can be realized).
in this way.
after a scanning cycle, the whole Chinese character will be moved one column to the left, The contents of the display buffer are changed at the same time.
because the preload saves one Chinese character lattice data.
that is, 16 × 16 dot matrix, so the content of the current display buffer can only move 16 columns.
when the next scroll arrives.
the scroll pointer will move to the first address of the next Chinese character in the dot matrix data storage area, And store the dot matrix data of the Chinese character in the preloading area.
then repeat the above operation to realize the scrolling display.
the display of special characters or graphics is similar to this.
I will not repeat it here.
this article will not be repeated

The typing display requires Chinese characters to appear one by one from left to right on the display screen.
it is just like the effect of typing.
the following methods can be adopted in the design: first, clear all the display buffers corresponding to the LED display screen.
that is, the LED display is blank, and then set the dynamic display time by a "soft timer" every interval, A dot matrix data of Chinese characters is added into the display buffer and scanned to display, so as to achieve the effect of typing and display.
3.2 PC control program a. the communication function is realized in Windows environment.
the communication between PC and MCU can be realized by using the communication API function of windows or the standard communication function of VC + + (or other languages) InP But the above two methods are more complicated.
it is very convenient to use the ActiveX control MSComm32.
the control simplifies the programming of serial port operation in the way of event.
it can also set the data sending and receiving of serial communication, The initialization procedure is as follows: Generally speaking,
PC needs to communicate with multiple 89C51 systems in master-slave mode. In order to distinguish each single-chip system, 89C51 can adopt serial port working mode 3, that is, 11 bit asynchronous receiving / sending mode. The effective data of this mode is 9 bits, The 9th bit is the flag bit of address / data information, which is used to make the slave computer judge whether the data sent is an address, so as to realize multi computer operation.
but now MSComm control is used to realize the communication between PC and MCU.
this is a standard 10 bit serial communication mode,So it is difficult to use the above scheme.
therefore, the serial port of single chip microcomputer can be set as working mode 1.
that is to say, it is changed to 10 bit asynchronous receive / send mode to solve the problem. The communication process is as follows: first, send the communication start flag, and then send the address of single chip microcomputer system to be operated, The first byte is used to set the display mode and scrolling direction, and the second byte is used to set the display speed.
next, the lattice data of the display content is transmitted.
finally, the data is checked.
the communication protocol is very simple.
it can solve the above problems, So as to realize the master-slave communication between PC and multi MCU and control the display.
it should be noted that when the display content needs to be changed, in order to avoid the display screen to appear garbled code when the serial interrupt of MCU receives data, the display screen should not be displayed temporarily (in the "black screen" state) until the data is received completely, When the serial interrupt processing is finished, it will be displayed again.
the extraction of Chinese font is very important.
the font data in this paper is taken from hzk16 under UCDOS.
there are many introductions on this aspect.
reference [2] gives a more specific scheme of extracting Chinese font under VC, It will not be repeated here.
for the extraction of special character or graphic lattice data.
a simple method is to make a BMP file first, and then use some modulus software (such as font extraction v2.1) to obtain it.
for the convenience of display.
the format of lattice data should be n ×( sixteen × 8) In order to adjust the display effect of LED conveniently,
BThe simulation display of LED screen is designed on the control interface of PC, which is exactly the same as the actual display effect.
the user can set the display mode and adjust the display speed, then preview the display effect on the interface, and modify and set the parameters at any time, So it is very convenient and simple.
for this reason.
the virtual LED display screen can be depicted on the interface first, because the actual display screen is 160 × The method to achieve dynamic display effect is basically similar to the above.
here, take scrolling display as an example.
for the text that needs to be scrolled.
you can set it as bitmap format and store it in memory, Then the bitmap copy function BitBlt is provided by VC to copy the bitmap to the display position.
. For special characters or graphics,.
can be directly invoked to the display location.
by BitBlt function, then the function.
is invoked in OnTimer function of CLEDDlg class to achieve text scrolling..
can also change the text by setting different response time intervals. Dynamic speed.

Chinese character display screen is widely used in automobile stop announcer.
this paper introduces the production of a practical Chinese character display screen.
considering the easy purchasing of circuit components, instead of using 8 * 8 lattice LED module, 256 high metric LEDs are directly used, At the same time, in order to reduce the difficulty of production,
only one word is displayed in turn, and the number of displayed words can be expanded according to this principle in actual use.
in order to reduce the difficulty of production
1. The principle of Chinese character display:
we take UCDOS Chinese Song typeface library as an example.
each character is displayed by 16 rows and 16 columns of dot matrix.
that is, each character in the national standard Chinese character library is represented by 256 dot matrix.
we can understand each dot as a pixel.
and the font of each character as an image.
in fact, this Chinese character screen can not only display Chinese characters Display Chinese characters.
it can also display any graphics within the range of 256 pixels.

it is controlled by 8-bit AT89C51 single chip microcomputer.
because the bus of single chip microcomputer is 8-bit, a word needs to be divided into two parts.

after the software is opened, input Chinese characters.
click "check", the Chinese character code of hexadecimal data can be automatically generated, The vertical data we need can be copied into our program.

we connect the row and column bus to the I0 port of MCU.
then we send the scanning code analyzed above into the bus, and we can get the displayed Chinese characters.
in this example.
since 16 rows and 16 columns are used, if all of them are connected to 89C51
MCU, a total of 32 IO ports are used, In practical application, we use 4-16 line decoder 74ls154 to display column direction.
while 16 lines in row direction are connected to port
P0 and port P2.

program list:
ORG 00h
loop: mov A.
# 0ffh; Power on initialization, clear the screen
mov P0,A ; Clearance of P 0
anl P2, # 00; Clear P2 port
mov R2, # 200
d100ms: mov R3, # 250; Delay time 100 ms
djnz R3, $
djnz R2, d100ms
mov 20h, # 00h; The initial value of code pointer
L100: mov R1, # 100; The retention time of each word
L16: mov R6, # 16; Each word has 16 codes
mov R4, # 00h; Scan pointer reset
mov r0,20h; The code pointer is stored in R0
L3: mov a, R4; The scan pointer is stored in a
mov P1, a; Scan output
Inc R4; Scan pointer plus 1, scan next
mov a, R0; The code pointer is stored in a
mov dptr, # table; Take the code of the upper part of the data table
MOVC a, @ a + dptr
mov P0, a; Output to P0
Inc R0; Add 1 to the code pointer and take the next code.

mov A.
mov dptr, # table; Take the code of the lower part of the data table
MOVC a, @ a + dptr
mov P2, a; Output to P2 port
Inc R0
mov R3,#02 ; Scan 1 ms
delay2: mov R5, # 248
  DJNZ R5,$
  MOV A,#00H ; Clear the screen
mov P0, a
anl P2, # 00h
djnz R6, L3; Is 16 codes per word complete
  DJNZ R1,L16 ; Is it time for each word to stay
  MOV 20H,R0 ; The access pointer is stored in 20h
cjne R0, # 0ffh, L100; Is 8 words 256 codes complete
  JMP LOOP ; Repeated circulation

; The code of Chinese character "Yi" is
DB 01h, 00h, 02h, 00h, 04H, 00h, 1fh, 0ffh
DB 0e2h, 00h, 22h, 00h, 22h, 0fch, 26h, 88H
DB 2ah, 88H, 0f2h, 88H, 2ah, 0fah, 26h, 01h
DB 63h, 0feh, 26h, 00h, 02h, 00h, 00h, 00h
; The following are the codes of Tian, Yi, Chu, Bao, Dao, Tu, long, slightly.

the line direction in the circuit is scanned by port P 0 and port p 2.
because port P 0 has no pull-up resistance, a 4.7K * 8 pull-up resistance is connected.
the circuit has no pull-up resistanceIf there is no drain resistance,
eight ordinary 4.7k1/8w resistors can be used.
to provide load capacity,
16 NPN transistors connected with 2N5551 are used to drive.

the column direction is scanned by 4-16 decoder 74ls154.
it is controlled by p1.0-p1.3 of 89C51.
the driving part is driven by 16 NPN transistors connected with 2n5401.

the power supply of the circuit is a lm7805 three terminal regulator
the power consumption is about 100mA.

a 12 * 20cm universal circuit board should be used.
better quality light-emitting tubes should be selected. (otherwise, it is troublesome to replace them). First, 256 light-emitting tubes should be inserted into the circuit board. Pay attention to the insertion direction. At the same time, the height should be consistent. The line direction should be directly welded, and the column direction should be overhead welded, After that, test it with a multimeter, and replace it if it doesn't light up.

then find a data line of the computer hard disk.
cut the required length, and lead the row and column lines to the relevant pins of the circuit respectively.
for the sake of simplicity, the schematic diagram is only drawn, with only 2 transistors in the direction of row and column, and only 4 light-emitting diodes on the screen. In fact, there are 256 light-emitting diodes, There are 16 transistors in the row and column directions, a total of 32 transistors.
the welding process can be completed in one day with careful care.
after compiling the program, write it into 89C51.
insert it into 40pin IC block, and you can see the screen display in turn: "relying on the sky to kill the dragon with a sword."

of course.

this is trueYou can replace the Chinese character code part of the program with the code you need to display the Chinese characters you need
component list:
name, quantity and specification
4.7K 1 / 8W 32 resistor
4.7K * 8 Row resistor 1
2N5551 16 low power NPN Transistor
2n5401 16 LOW POWER PNP transistor
LED 256 3mm white hair red high brightness
22P 2 ceramic Chip capacitor
10uF / 50V 1 electrolytic capacitor
100uF / 25V 2 electrolytic capacitor
AT89C51 1 or AT89S51
40pin IC socket 1 plug 89C51
12m 1 Crystal
74ls154 1 or 74hc154
lm7805 1 regulated IC
power socket 1
regulated power supply 1 http://wenwen.sogou.com/z/q866302148.htm?fr=middle_ auto,
Related topics