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 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
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.
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
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- The fifth pitfall of domestic FPGA chips: "No devices found" reappears
- How to build and debug an unrecorded Cortex-M3 chip using IAR
- CNTTR Communication Electronics Training Materials Power Engineering Design
- [Xianji HPM6750 Review] + The previous screen adapter board has been soldered for testing
- Intel does not make memory
- Flying capacitors: one of the methods for isolating analog signals
- 【Smart Kitchen】Environmental Sensor PCB Design
- 5. Printf implementation and DMA implementation of USART0
- Radio Design Considerations for EDGE Cell Phones
- Circuit stability