Minimized Application of AT89S51
For the microcontroller to operate normally, it must have certain hardware conditions, among which the most important are three basic conditions: 1. Normal power supply; 2. Normal clock; 3. Normal reset. The following is an example of the 51 microcontroller AT89S51 used in our experiment to introduce its hardware connection method. Among the 40 pins of the AT89S51 microcontroller: 2 power pins, 2 crystal pins, 4 control pins, and 32 programmable input and output pins. The following Figure 1 is the wiring method of the AT89S51 minimized application (only driving 1 light-emitting diode):
1. Working power supply: The power supply is the power source of the microcontroller. Of course, it cannot work without power supply:). The corresponding wiring method is: 40-pin (VCC) power supply pin, connected to +5V power supply when working, 20-pin (GND) is the ground wire.
2. Clock circuit: The clock circuit generates timing pulses for the microcontroller. All operations and control processes of the microcontroller are driven by a unified timing pulse. The clock circuit is like a human heart. If the human heartbeat stops, the person... Similarly, if the clock circuit of the microcontroller stops working (the crystal oscillator stops oscillating), the microcontroller will also stop running. When using an internal clock, the connection method is shown in the figure below. Connect a crystal oscillator between the crystal oscillator pins XTAL1 (pin 19) and XTAL2 (pin 18), and connect a capacitor to the ground of the two pins to generate the required clock signal. The capacitance of the capacitor is generally in tens of pico-farads, such as 30PF.
3. Reset circuit: A high-level signal that continues to appear at the reset pin (pin 9) for 24 oscillator pulse cycles (i.e., 2 machine cycles) will reset the microcontroller. As shown in the figure below, capacitor C and resistor R form the microcontroller power-on automatic reset circuit. After reset, the microcontroller starts executing the program from unit 0000H and initializes some special registers to reset state values. The affected special registers are shown in the following table:
4. Connection method of control pin EA. EA/VPP (pin 31) is the internal and external program memory selection control pin. When EA is low, the microcontroller fetches instructions from the external program memory; when EA is high, the microcontroller fetches instructions from the internal program memory. . . The AT89S51 microcontroller has a 4KB program memory that can be repeatedly erased and written more than 1000 times. Therefore, we connect EA to a +5V high level to let the microcontroller run the internal program. We can verify our program by repeatedly burning it.
5. Next, we add an indicator light to the MCU. We connect a light-emitting diode to the MCU P1.7 (pin 8), so that we can do a simple experiment of driving the light-emitting diode with the MCU. In the figure, a 560-ohm current-limiting resistor is connected in series between the cathode of the light-emitting diode and the MCU pin P1.7 to prevent the light-emitting diode and the MCU pin P1.7 from burning out due to excessive current, so that both the light-emitting diode and the MCU work in a safe state.
So far, we have completed the connection of the AT89S51 microcontroller's minimized system. Just burn the program you wrote into the microcontroller and connect it to a 5V power supply to run it normally. The rest of the microcontroller can be left unconnected and left empty.
Previous article:The difference between 89c51 MCU and 89s51 MCU, and the summary of new functions of 89s51 MCU
Next article:What is the difference between the two types of microcontrollers, AT89S51 and AT89S52?
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Recommended MCU with larger on-chip RAM
- ART-Pi Evaluation RTE Environment Build RTOS Project
- Newcomer report!
- At the age of thirty, I am penniless and have nothing to lose. I have to start all over again!!!
- How to adjust CC+forCC software simulation? I am a novice and I need your advice.
- Have you heard of inertial sensors with electrostatic detection function?
- UDP networking process of BC-95 B8 NB module
- EEWORLD University----[High Precision Laboratory] Magnetic Sensor: Basics and Advanced
- Oscilloscope observation of Class D power amplifier
- MSP430F5529 HCSR04 ultrasonic ranging in capture mode