Minimized Application of AT89S51

Publisher:DelightfulSmileLatest update time:2024-08-30 Source: elecfansKeywords:AT89S51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.


Keywords:AT89S51 Reference address:Minimized Application of AT89S51

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?

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号