Specific implementation functions:
The 51 microcontroller buttons control the speaker to emit a variety of sounds.
Design introduction
Introduction to 51 microcontroller
The 51 monolithic chip is a low-power, high-performance CMOS-8-bit microcontroller with 8K programmable Flash memory, making it a highly flexible and ultra-effective solution for many embedded control application systems.
The 51 series microcontrollers have the following standard features:
8k bytes Flash, 512 bytes RAM,
32-bit I/O port line, watchdog timer,
Built-in 4KB EEPROM,
MAX810 reset circuit,
Three 16-bit timer/counters,
A 6-vector 2-level interrupt structure,
Full duplex serial port.
In addition, in the idle mode of the 51 series, the CPU stops working and allows the RAM, timers/counters, serial ports, and interrupts to continue working. In power-down protection mode, the RAM contents are saved, the oscillator is frozen, and the microcontroller stops working until the next interrupt or hardware reset. The chip used in this design is compatible with all the following 51 series microcontrollers (including AT series and STC series).
Design ideas
Literature research method: collect and organize relevant research materials, read literature, and prepare for research;
Investigation and research method: Discover relevant existing problems and solutions through investigation, analysis, specific experiments and other methods;
Comparative analysis method: Compare the specific principles of different designs and the performance differences of the same type of sensors, and analyze the research status and development prospects of the system;
Software and hardware design method: realize the hardware through software and hardware design, and finally test whether each function meets the requirements.
Reference template for microcontroller design papers:
Worry-free Graduation | MCU Graduation Thesis Template
design content
Simulation diagram (protues8.7)
This design uses protues8.7 software to implement simulation design, as shown in the figure.
Note: Free sharing, please follow the picture below to draw the simulation yourself! !
protues8.7 software information and simulation solutions:
proteus8.7 installation and cracking tutorial (installation package included)
Solutions to common problems in protues simulation
Protues8.7 simple tutorial
Program (Keil5)
This design uses KEIL5 software to implement programming.
Note: All codes are shared for free, please create your own project! !
This design is written in C language, and the entire code is as follows:
#include
#define uchar unsigned char
#define uint unsigned int
sbit BEEP = P3^7;
sbit K1 = P1^4;
sbit K2 = P1^5;
sbit K3 = P1^6;
sbit K4 = P1^7;
void DelayMS(uint x)
{
uchart;
while(x--)
{
for(t=0;t<120;t++);
}
}
void Play(uchar t)
{
uchar i;
for(i=0;i<100;i++)
{
BEEP = ~BEEP;
DelayMS(t);
}
BEEP = 0;
}
void main()
{
P1 = 0xff;
while(1)
{
if(K1==0) Play(1);
if(K2==0) Play(2);
if(K3==0) Play(3);
if(K4==0) Play(4);
}
}
The running result is as shown in the figure:
Previous article:Implementation of container safety monitoring device and system design based on C8051F410 microcontroller
Next article:Application plan of temperature acquisition and monitoring system based on 8051F350 microcontroller
- 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
- [NXP Rapid IoT Review] + First Rapid IOT Studio Project
- At 10 am today, Datang NXP will broadcast a live broadcast of [New energy lithium battery management solution with impedance detection function]
- Can anyone help me figure out what chip model this is?
- 【DJI】Automotive Software Engineer Position
- Xianji HPM6750 Review & DIY——RCSN
- How to use freertos to forward the received message content
- A detail of MSP430 interrupt
- How to cope with the new challenges brought by Wi-Fi 6 and Wi-Fi 6E
- 【Beetle ESP32-C3】8. OLED clock and weather assistant (Arduino)
- R7F0C003/004 series, using IAR development environment, are there any tutorials?