• Nie Znaleziono Wyników

If there is valid data at address 0x0000.0004, the stack pointer (SP) is loaded from Flash memory at address 0x0000.0000 and the program counter (PC) is loaded from address 0x0000.000

W dokumencie LM3S5R31 (Stron 196-200)

5 System Control

4. If there is valid data at address 0x0000.0004, the stack pointer (SP) is loaded from Flash memory at address 0x0000.0000 and the program counter (PC) is loaded from address 0x0000.000

The user application begins executing.

For example, if the BOOTCFG register is written and committed with the value of 0x0000.3C01, thenPB7is examined at reset to determine if the ROM Boot Loader should be executed. IfPB7is Low, the core unconditionally begins executing the ROM boot loader. IfPB7is High, then the application in Flash memory is executed if the reset vector at location 0x0000.0004 is not 0xFFFF.FFFF. Otherwise, the ROM boot loader is executed.

5.2.2.2 Power-On Reset (POR)

The internal Power-On Reset (POR) circuit monitors the power supply voltage (VDD) and generates a reset signal to all of the internal logic including JTAG when the power supply ramp reaches a threshold value (VTH). The microcontroller must be operating within the specified operating parameters when the on-chip power-on reset pulse is complete (see “Power and Brown-Out” on page 1199). For applications that require the use of an external reset signal to hold the microcontroller in reset longer than the internal POR, theRSTinput may be used as discussed in “External RST Pin” on page 196.

The Power-On Reset sequence is as follows:

1. The microcontroller waits for internal POR to go inactive.

2. The internal reset is released and the core loads from memory the initial stack pointer, the initial program counter, and the first instruction designated by the program counter, and then begins execution.

The internal POR is only active on the initial power-up of the microcontroller and when the microcontroller wakes from hibernation. The Power-On Reset timing is shown in Figure 26-4 on page 1199.

5.2.2.3 External RST Pin

Note: It is recommended that the trace for theRSTsignal must be kept as short as possible. Be sure to place any components connected to theRSTsignal as close to the microcontroller as possible.

If the application only uses the internal POR circuit, theRSTinput must be connected to the power supply (VDD) through an optional pull-up resistor (0 to 100K Ω) as shown in Figure 5-1 on page 197.

Figure 5-1. Basic RST Configuration

PU

RST Stellaris®

R VDD

RPU= 0 to 100 kΩ

The external reset pin (RST) resets the microcontroller including the core and all the on-chip peripherals except the JTAG TAP controller (see “JTAG Interface” on page 182). The external reset sequence is as follows:

1. The external reset pin (RST) is asserted for the duration specified by TMINand then de-asserted (see “Reset” on page 1200).

2. The internal reset is released and the core loads from memory the initial stack pointer, the initial program counter, and the first instruction designated by the program counter, and then begins execution.

To improve noise immunity and/or to delay reset at power up, theRSTinput may be connected to an RC network as shown in Figure 5-2 on page 197.

Figure 5-2. External Circuitry to Extend Power-On Reset

PU

C1 RST

Stellaris®

R VDD

RPU= 1 kΩ to 100 kΩ C1= 1 nF to 10 µF

If the application requires the use of an external reset switch, Figure 5-3 on page 198 shows the proper circuitry to use.

Figure 5-3. Reset Circuit Controlled by Switch

PU

C1 RS RST

Stellaris®

R VDD

Typical RPU= 10 kΩ Typical RS= 470 Ω C1= 10 nF

The RPUand C1components define the power-on delay.

The external reset timing is shown in Figure 26-7 on page 1200.

5.2.2.4 Brown-Out Reset (BOR)

The microcontroller provides a brown-out detection circuit that triggers if the power supply (VDD) drops below a brown-out threshold voltage (VBTH). If a brown-out condition is detected, the system may generate an interrupt or a system reset. The default condition is to generate an interrupt, so BOR must be enabled. Brown-out resets are controlled with the Power-On and Brown-Out Reset Control (PBORCTL) register. TheBORIORbit in the PBORCTL register must be set for a brown-out condition to trigger a reset; ifBORIORis clear, an interrupt is generated. When a Brown-out condition occurs during a Flash PROGRAM or ERASE operation, a full system reset is always triggered without regard to the setting in the PBORCTL register.

The brown-out reset sequence is as follows:

1. When VDDdrops below VBTH, an internal BOR condition is set.

2. If the BOR condition exists, an internal reset is asserted.

3. The internal reset is released and the microcontroller fetches and loads the initial stack pointer, the initial program counter, the first instruction designated by the program counter, and begins execution.

4. The internal BOR condition is reset after 500 µs to prevent another BOR condition from being set before software has a chance to investigate the original cause.

The result of a brown-out reset is equivalent to that of an assertion of the externalRSTinput, and the reset is held active until the proper VDDlevel is restored. The RESC register can be examined in the reset interrupt handler to determine if a Brown-Out condition was the cause of the reset, thus allowing software to determine what actions are required to recover.

The internal Brown-Out Reset timing is shown in Figure 26-5 on page 1199.

5.2.2.5 Software Reset

Software can reset a specific peripheral or generate a reset to the entire microcontroller.

Peripherals can be individually reset by software via three registers that control reset signals to each on-chip peripheral (see the SRCRn registers, page 294). If the bit position corresponding to a peripheral is set and subsequently cleared, the peripheral is reset. The encoding of the reset registers is consistent with the encoding of the clock gating control for peripherals and on-chip functions (see

“System Control” on page 209).

The entire microcontroller, including the core, can be reset by software by setting theSYSRESREQ bit in the Application Interrupt and Reset Control (APINT) register. The software-initiated system reset sequence is as follows:

1. A software microcontroller reset is initiated by setting theSYSRESREQbit.

2. An internal reset is asserted.

3. The internal reset is deasserted and the microcontroller loads from memory the initial stack pointer, the initial program counter, and the first instruction designated by the program counter, and then begins execution.

The core only can be reset by software by setting theVECTRESETbit in the APINT register. The software-initiated core reset sequence is as follows:

1. A core reset is initiated by setting theVECTRESETbit.

2. An internal reset is asserted.

3. The internal reset is deasserted and the microcontroller loads from memory the initial stack pointer, the initial program counter, and the first instruction designated by the program counter, and then begins execution.

The software-initiated system reset timing is shown in Figure 26-8 on page 1200.

5.2.2.6 Watchdog Timer Reset

The Watchdog Timer module's function is to prevent system hangs. The LM3S5R31 microcontroller has two Watchdog Timer modules in case one watchdog clock source fails. One watchdog is run off the system clock and the other is run off the Precision Internal Oscillator (PIOSC). Each module operates in the same manner except that because the PIOSC watchdog timer module is in a different clock domain, register accesses must have a time delay between them. The watchdog timer can be configured to generate an interrupt to the microcontroller on its first time-out and to generate a reset on its second time-out.

After the watchdog's first time-out event, the 32-bit watchdog counter is reloaded with the value of the Watchdog Timer Load (WDTLOAD) register and resumes counting down from that value. If the timer counts down to zero again before the first time-out interrupt is cleared, and the reset signal has been enabled, the watchdog timer asserts its reset signal to the microcontroller. The watchdog timer reset sequence is as follows:

1. The watchdog timer times out for the second time without being serviced.

2. An internal reset is asserted.

3. The internal reset is released and the microcontroller loads from memory the initial stack pointer, the initial program counter, and the first instruction designated by the program counter, and then begins execution.

For more information on the Watchdog Timer module, see “Watchdog Timers” on page 599.

W dokumencie LM3S5R31 (Stron 196-200)