Reset operation and reset circuit design of AT89S51 microcontroller

Publisher:technology1Latest update time:2023-03-27 Source: elecfansKeywords:AT89S51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Reset is the initialization operation of the microcontroller. You only need to add a high level to the reset pin RST of the AT89S51 for more than 2 machine cycles (that is, 24 clock oscillation cycles) to reset the AT89S51.


reset operation

When the AT89S51 is reset, the PC is initialized to OOOOH, causing the AT89S51 microcontroller to start executing the program from the OOOOH unit of the program memory. In addition to the normal initialization of the system, when the program runs incorrectly (such as the program "runs away") or the operation error causes the system to be in a "deadlock" state, it is also necessary to press the reset button, that is, the RST pin is high, to free the AT89S51 "Runaway" or "deadlock" state and restart the program.


In addition to the PC, the reset operation also affects some other registers. The status of these registers during reset is shown in Table 2-7. As can be seen from Table 2-7, during reset, SP-07H, and the pins of the four I/O ports PO~P3 are all high level. In some control applications, attention should be paid to the impact of the high level of the PO~P3 pins on the external circuits connected to these pins. For example, a certain pin of the Pl port is connected to an external relay winding. When reset, the pin is at a high level, and current will flow through the relay winding, attracting the relay switch and turning the switch on, which may cause unexpected consequences. .


Table 2-7 The status of each on-chip register during reset

Reset operation and reset circuit design of AT89S51 microcontroller

Reset circuit design

The reset of AT89S51 is implemented by an external reset circuit. The structure of the AT89S51 on-chip reset circuit is shown in Figure 2-17

The reset pin RST is connected to the reset circuit through a Schmitt trigger. The Schmitt trigger is used to suppress noise. In S5P2 of each machine cycle: the output level of the Schmitt trigger is sampled once by the reset circuit before it can Get the signal required for internal reset operation.


The reset circuit usually adopts two methods: automatic reset on power-on and button reset.

The simplest power-on automatic reset circuit is shown in Figure 2-18

Reset operation and reset circuit design of AT89S51 microcontroller

For CMOS microcontrollers, since there is a pull-down resistor inside the RST pin, the resistor R can be removed and the capacitor C is selected to be 10 μF.


The power-on automatic reset is to charge the capacitor C through an external reset circuit and add a short high-level signal to the RST pin. This signal gradually falls back as VCC charges the capacitor C, that is, the high-level signal on the RST pin The duration depends on the charging time of capacitor C. Therefore, in order to ensure that the system can be reset reliably, the high level on the RST pin must be maintained for a long enough time.


In addition to power-on reset, sometimes it is also necessary to manually reset by pressing a button. There are two methods of manual button reset: level and pulse.


The button manual level reset is achieved by connecting the RST terminal to the power supply Vcc through a resistor. The specific circuit is shown in Figure 2-19.

When the clock frequency is 6 MHz, the typical value of C is 10μF and the value of R is 2kΩ.

Pulse reset is achieved by using the positive pulse generated by the RC differential circuit. The pulse reset circuit is shown in Figure 2-20.

The resistance and capacitance parameters in the figure are suitable for a 6 MHz clock.

The circuit shown in Figure 2-21 can output high and low level reset control signals to adapt to the different reset level signals required by peripheral I/O interface chips. In Figure 2-21, 74LS122 is a monostable circuit. Experiments show that it is better to choose a capacitor C of about 0.1μF.

In actual application system design, if there are external extended I/O interface circuits, they also need to be initially reset. If their reset terminal is connected to the reset terminal of AT89S51, the R and C parameters in the reset circuit will be affected. At this time, the reset circuit The R and C parameters in should be considered uniformly to ensure reliable reset. If the reset circuit and reset time of the AT89S51 and the peripheral I/O interface circuit are not completely consistent, causing the microcontroller initialization program to fail to run normally, the reset of the peripheral I/O interface circuit does not need to be connected to the reset terminal of the AT89S51, and an independent power-on reset is used. circuit. If the RC power-on reset circuit is connected to the input terminal of the Schmitt circuit, and the output terminal of the Schmidt circuit is connected to the AT89S51 and peripheral circuit reset terminals, the system can be reliably synchronously reset. Generally speaking, the reset speed of microcontroller is faster than that of peripheral I/O interface circuit. In order to ensure reliable system reset, a certain reset delay time should be arranged in the initialization program.


Keywords:AT89S51 Reference address:Reset operation and reset circuit design of AT89S51 microcontroller

Previous article:Electronic scale design using AT89C51+ADC0832+LCD1602
Next article:An introduction to the pin functions of the external structure of the microcontroller and an overview of the usage information

Recommended ReadingLatest update time:2024-11-23 18:34

Design of Multi-way Switch Status Indicator
1. Experimental tasks As shown in Figure 4.3.1, P1.0-P1.3 of the AT89S51 microcontroller are connected to four LEDs L1-L4, and P1.4-P1.7 are connected to four switches K1-K4. The programming reflects the state of the switch on the LED. (When the switch is closed, the corresponding light is on, and when the switch
[Microcontroller]
Design of Multi-way Switch Status Indicator
Interface and Program Design between Digital-to-Analog Converter DAC7724 and AT89S51 Single Chip Microcomputer
Abstract: This paper introduces the functional characteristics and working process of a 4-channel 12-bit parallel D/A converter DAC7724 with excellent performance and low power consumption. It also gives the interface circuit between DAC7724 and 51 single-chip microcomputer and its assembly language application prog
[Microcontroller]
Interface and Program Design between Digital-to-Analog Converter DAC7724 and AT89S51 Single Chip Microcomputer
Dynamic digital display design based on AT89S51 microcontroller
1. Experimental tasks As shown in the figure, the P0 port of the AT89S51 microcontroller is connected to the font code pen section of the dynamic digital tube, the P2 port is connected to the digital selection terminal of the dynamic digital tube, and P1.7 is connected to a switch. When the switch is connected to high
[Microcontroller]
Dynamic digital display design based on AT89S51 microcontroller
Analysis of the internal structure of the AT89S51 microcontroller serial port
The internal structure of the AT89S51 microcontroller serial port is shown in the figure below. It has two physically independent receiving and transmitting buffers SBUF (special function registers), which can send and receive data at the same time. The sending buffer can only be written but not read, and the receivin
[Microcontroller]
Analysis of the internal structure of the AT89S51 microcontroller serial port
Understanding AT89S51 microcontroller and pin functions
        AT89S51 is a low voltage, high performance CMOS 8-bit microprocessor with 4K bytes of flash programmable and erasable read-only memory (FPEROM), commonly known as a single-chip microcomputer. The device is manufactured using ATMEL's high-density non-volatile memory manufacturing technology and is compatible wit
[Microcontroller]
Explanation of some instructions of AT89S51
  1. The difference between the "read pin" and "read latch" instructions of the parallel I/O port      There are two types of reading parallel I/O ports: "read pin" and "read latch". Take the P1 port as an example. When the P1.0 pin of the P1 port is connected to the anode of a light-emitting diode LED, the cathode of
[Microcontroller]
Explanation of some instructions of AT89S51
Design of Taxi Meter System Based on AT89S51 Single Chip Microcomputer
With the improvement of living standards, people are no longer satisfied with the enjoyment of food, clothing and housing, and the comfort of travel has attracted more and more attention. Therefore, the taxi industry has brought people the enjoyment of travel with low-cost and high-quality services. However, there a
[Microcontroller]
Design of Taxi Meter System Based on AT89S51 Single Chip Microcomputer
Design of AT89S51 Multiple External Interrupt Source System
  AT89S51 provides users with two external interrupt request input terminals INT0 (the inverse) and INT1 (the inverse). In actual application systems, two external interrupt request sources are often not enough, and the external interrupt sources need to be expanded. The following introduces a method for expanding ext
[Microcontroller]
Design of AT89S51 Multiple External Interrupt Source System
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号