The circuit diagram is as follows:
code show as below:
cnta=0;
Keywords:MCU
Reference address:Single chip dot matrix LED light
code show as below:
#include
unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
//unsigned char code tab[]={0x7f,0xbf,0xdf,0xef,0xfe,0xfd,0xfb,0xf7};
unsigned char code graph[3][8]={ {0x21,0x32,0xac,0x6c,0x32,0x21,0x3a,0x7f},
{0x00,0x02,0x04,0x0a,0xff,0x08,0x04,0x02},
{0xe1,0x55,0x55,0xdf,0x55,0x55,0x43,0x71}
};
unsigned char count;
unsigned char cnta;
sbit P1_0 = P1^0;
void main(void) {
unsigned char i,j;
TMOD=0x01;
TH0=(65536-4000)/256;
TL0=(65536-4000)%6;
TR0=1;
ET0=1;
EA=1;
while(1) {
if(P1_0==0) {
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P1_0==0) {
count++;
if(count==3) {
count=0;
}
while(P1_0==0);
}
}
}
}
void t0(void) interrupt 1 using 0 {
TH0=(65536-4000)/256;
TL0=(65536-4000)%6;
P2=tab[cnta];
P3=graph[count][cnta];
cnta++;
if(cnta==8) {
}
}
Previous article:MCU interrupt experiment 1
Next article:Single chip LCD display
Recommended ReadingLatest update time:2024-11-16 21:23
DC motor speed regulation experiment based on 51 single chip microcomputer
1. Experimental Principle
PWM: Pulse Width Modulation. In an inertial system, the required analog quantity can be equivalently obtained by modulating the width of a series of pulses. It is often used for motor speed regulation, light brightness adjustment, etc.
This experiment is essentially the same
[Microcontroller]
51 single chip GPIO structure block diagram and working principle
Preface No matter what microcontroller you study, the simplest peripheral is the high and low level control of the IO port. This tutorial will introduce to you how to output high and low levels by operating the GPIO port of the 51 microcontroller on the created project template. 1. GPIO concept GPIO (general purpose
[Microcontroller]
Matrix keyboard scanning, the microcontroller scans whether the key is pressed
In a single-chip microcomputer system, if there are many keys, such as electronic password locks and telephone keypads, there are generally at least 12 to 16 keys, and a matrix keyboard is usually used. A matrix keyboard is also called a row-column keyboard. It is a keyboard composed of four I/O lines as row lines and
[Microcontroller]
Intelligent Control System of Washing Machine Based on AT89C52 Single Chip Microcomputer
High-efficiency, energy-saving, water-saving, electricity-saving and environmentally friendly washing machines have always occupied a dominant position in the market. Whether in terms of quality, technology, function or appearance, they are closest to the purpose of serving people's lives. In the future, washing mac
[Microcontroller]
Design of Audio Signal Analyzer Based on Single Chip Microcomputer
0 Introduction
At present, most audio signal processors are not only large in size but also expensive, and are difficult to be popularized in some special aspects. Embedded system analyzers are small and reliable, so the development of audio analysis instruments based on special function microcontrollers is
[Microcontroller]
8-bit MCU with 6-channel PWM port for LED lighting
LAPIS Semiconductor announced on September 17, 2013 that it has developed the 8-bit microcontroller (MCU) "ML610Q111/ML610Q112" for LED lighting control. According to reports, the new product is equipped with a 6-channel PWM (pulse width modulation) port, which can achieve a variety of tones and brightness, and can
[Power Management]
MCU data/idata/xdata/pdata/bit/code
DATA: Fixedly refers to the first 128 RAM from 0x00 to 0x7f, which can be directly read and written using acc, with the fastest speed and the smallest generated code.
DATA is a data memory address between 0 and 127, or a special function register (SFR) address in the range of 128 .. 255. The two are accessed in diff
[Microcontroller]
Example of calculating the initial value of a microcontroller timer
Example of calculating the initial value of a timer
1. Calculation of the initial value of the 10MS timer:
1. Crystal oscillator 12M
12MHz divided by 12 is 1MHz, which means one second = 1000000 machine cycles. 10ms = 10000 machine cycles.
65536-10000=55536(d8f0)
TH0=0xd8, TL0=0xf0
2. Crystal oscill
[Microcontroller]
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- 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
MoreDaily News
- 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
Guess you like
- Electromagnetic Controlled Motion Device (J)
- Live broadcast at 10 am today [Introduction to TI Sitara's latest AM64X platform]
- Using UCC28070 for 6.6kWPFC, current waveform deformation problem under 260VAC input condition
- Learning Linux kernel semaphores on SinlinxA64 development board
- Two modes of offline programming for F28379D
- Proteus8.9 detailed Chinese tutorial help
- Solution to the error when downloading the CCS program
- Image of square wave-triangle wave waveform transformation
- A simple tutorial on using the domestic FPGA GOWIN software
- Problems of electromagnetic flowmeter in daily water supply application