Книга: Advanced PIC Microcontroller Projects in C
2.1.5 The Reset
2.1.5 The Reset
The reset action puts the microcontroller into a known state. Resetting a PIC18F microcontroller starts execution of the program from address 0000H of the program memory. The microcontroller can be reset during one of the following operations:
• Power-on reset (POR)
• MCLR reset
• Watchdog timer (WDT) reset
• Brown-out reset (BOR)
• Reset instruction
• Stack full reset
• Stack underflow reset
Two types of resets are commonly used: power-on reset and external reset using the MCLR pin.
Power-on Reset
The power-on reset is generated automatically when power supply voltage is applied to the chip. The MCLR pin should be tied to the supply voltage directly or, preferably, through a 10K resistor. Figure 2.11 shows a typical reset circuit.
Figure 2.11: Typical reset circuit
For applications where the rise time of the voltage is slow, it is recommended to use a diode, a capacitor, and a series resistor as shown in Figure 2.12.
Figure 2.12: Reset circuit for slow-rising voltages
In some applications the microcontroller may have to be reset externally by pressing a button. Figure 2.13 shows the circuit that can be used to reset the microcontroller externally. Normally the MCLR input is at logic 1. When the RESET button is pressed, this pin goes to logic 0 and resets the microcontroller.
Figure 2.13: External reset circuit
- 2.1.1 Program Memory Organization
- 2.1.2 Data Memory Organization
- 2.1.3 The Configuration Registers
- 2.1.4 The Power Supply
- 2.1.5 The Reset
- 2.1.6 The Clock Sources
- 2.1.7 Watchdog Timer
- 2.1.8 Parallel I/O Ports
- 2.1.9 Timers
- 2.1.10 Capture/Compare/PWM Modules (CCP)
- 2.1.11 Analog-to-Digital Converter (A/D) Module
- 2.1.12 Interrupts
- 1.3.5 Reset Input
- Resetting the Counters
- Resetting the Development Settings
- 4.4.4 The Dispatcher
- About the author
- Chapter 7. The state machine
- Appendix E. Other resources and links
- Example NAT machine in theory
- The final stage of our NAT machine
- Compiling the user-land applications
- The conntrack entries
- Untracked connections and the raw table