There are billboards everywhere that display Chinese characters on LED displays. The principle is actually very simple. We can use a 51 single-chip microcomputer to control the display of Chinese characters.
As a principle experiment, I only use four 8x8 LEDs to display a Chinese character "欢". If you understand this experiment, it is not difficult to do the scrolling and displaying in turns.
Test environment: proteus,keil
Experiment with virtual components:
4 MATRIX-8x8-RED
1 4-16 decoder: 74HC154
Microcontroller:ATC89C52
Resistor: RESPACK-8, because P0 port is used, so pull-up resistor is required.
Originally, four 74ALS373s were needed to drag the LEDs, but in order to simplify the experiment, four 74ALS373s were omitted in the virtual experiment. Please pay attention to this when doing a physical demonstration.
In addition, use the software "Font Wizard" (search on Baidu) to obtain the font of Chinese characters. A Chinese character has 32 bytes of data, P2 is the high 8 bits, and P0 is the low 8 bits.
Pay attention to the connection of the four LEDs:
The two LEDs above are the upper 8 rows. I used l1-l8.
The lines of the two blocks below are l9--l16.
The columns from right to left are h1--h16.
The principle of rotating display is:
The first time, i=0, row 1, send column data 0x00 (P2), 0x80 (P0), then the 7th bit of P0 in the first row is on;
The second time, i=1, the second row, send column data 0x00, 0x80, then the 7th bit of P0 in the second row is bright;
The third time, i=2, the third row, send column data 0xfc, 0x80, then the third row P2 high 7 bits light up, P0's highest bit lights up;
...and so on, 16 rows of LEDs are lit up one by one.
Adjust the delay time, and you will see all 16 rows of selected LEDs light up, and the Chinese characters will be displayed.
Simulation circuit diagram (click or download to see the enlarged image):
Complete C program:
#include
unsigned char code tab0[]={
0x00,0x80,0x00,0x80,0xFC,0x80,0x05,0xFE,0x85,0x04,0x4A,0x48,0x28,0x40,0x10,0x40,
0x18,0x40,0x18,0x60,0x24,0xA0,0x24,0x90,0x41,0x18,0x86,0x0E,0x38,0x04,0x00,0x00
};
void delay()
{
unsigned char i,j;
for(i=0;i<2;i++)
for(j=0;j<255;j++);
}
main()
{
unsigned char i,j;
while(1)
{
j=0;
for(i=0;i<=15;i++)
{
P1=i;
P2=tab0[j];
P0=tab0[++j];
delay();
P2=0x00;
P0=0x00;
j++;
}
}
}
Previous article:Keil51 interrupt processing
Next article:51proteus simulation: connection and timing of stepper motor in proteus
Recommended ReadingLatest update time:2024-11-16 20:23
- Popular Resources
- Popular amplifiers
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
- Sipeed LicheeRV 86 Panel Review】6- Review Summary
- FPGA Experiment (III) VGA Color Bar Signal Display Based on HDL Language
- The key to the warehouse was found, and the music phone from 15 years ago was unboxed!
- Application of OPT3004 in battery-powered cameras
- Does anyone on the forum have a SiliconLabs BRD4001A board?
- [Flower carving hands-on] Interesting and fun music visualization series of small projects (01) --- LED rhythm lights
- Understanding Delta-Sigma (Δ) ADCs
- 【Qinheng RISC-V core CH582】 6-Hardware I2C reads DHT12 data
- [Discussion] Is there any antenna expert who can tell me in detail how difficult satellite communications are?
- C++ Generate a random number between 0 and 1