8 Reset PDF
8 Reset PDF
Reset
HIGHLIGHTS
This section of the manual contains the following topics:
Reset
8.14 Revision History ........................................................................................................... 8-19
8.1 Introduction
The Reset module combines all Reset sources and controls the device Master Reset Signal,
SYSRST. The following is a list of device Reset sources:
• POR: Power-on Reset
• EXTR: Pin Reset (MCLR)
• SWR: RESET Instruction
• WDTR: Watchdog Timer Reset
• BOR: Brown-out Reset
• TRAPR: Trap Conflict Reset
• IOPR: Illegal Opcode Reset
• UWR: Uninitialized W Register Reset
A simplified block diagram of the Reset module is shown in Figure 8-1. Any active source of
Reset will make the SYSRST signal active. Many registers associated with the CPU and periph-
erals are forced to a known “Reset state”. Most registers are unaffected by a Reset; their status
is unknown on POR and unchanged by all other Resets.
Note: Refer to the specific peripheral or CPU section of this manual for register Reset
states.
All types of device Reset will set a corresponding status bit in the RCON register to indicate the
type of Reset (see Register 8-1). A POR will clear all bits except for the POR and BOR bits
(RCON<2:1>), which are set. The user may set or clear any bit at any time during code execution.
The RCON bits only serve as status bits. Setting a particular Reset status bit in software will not
cause a device Reset to occur.
The RCON register also has other bits associated with the Low Voltage Detect module,
Watchdog Timer, and device power saving states. The function of these bits is discussed in other
sections of this manual.
RESET
Instruction
Glitch Filter
MCLR
Sleep or Idle
WDT
Module
Trap Conflict
Illegal Opcode
Uninitialized W Register
Lower Byte:
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-1 R/W-1
EXTR SWR SWDTEN WDTO SLEEP IDLE BOR POR
bit 7 bit 0
Reset
bit 7 EXTR: External Reset (MCLR) Pin bit
1 = A Master Clear (pin) Reset has occurred
0 = A Master Clear (pin) Reset has not occurred
bit 6 SWR: Software RESET (Instruction) Flag bit
1 = A RESET instruction has been executed
0 = A RESET instruction has not been executed
bit 5 SWDTEN: Software Enable/Disable of WDT bit
1 = WDT is turned on
0 = WDT is turned off
Note: If FWDTEN fuse bit is ‘1’ (unprogrammed), the WDT is ALWAYS ENABLED, regardless of the
SWDTEN bit setting.
bit 4 WDTO: Watchdog Timer Time-out Flag bit
1 = WDT Time-out has occurred
0 = WDT Time-out has not occurred
bit 3 SLEEP: Wake From Sleep Flag bit
1 = Device has been in Sleep mode
0 = Device has not been in Sleep mode
bit 2 IDLE: Wake-up From Idle Flag bit
1 = Device was in Idle mode
0 = Device was not in Idle mode
Note: All of the Reset status bits may be set or cleared in software. Setting one of these bits in software
does not cause a device Reset.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Table 8-1: Oscillator Selection vs. Type of Reset (Clock Switching Enabled)
Reset Type Clock Source Selected Based On
POR Oscillator Configuration Fuses
BOR Oscillator Configuration Fuses
EXTR COSC Control bits (OSCCON<13:12>)
WDTR COSC Control bits (OSCCON<13:12>)
SWR COSC Control bits (OSCCON<13:12>)
Reset
After the Power-on Reset pulse is generated, the POR circuit inserts a small delay, TPOR, which
is nominally 10 µs and ensures that internal device bias circuits are stable. Furthermore, a user
selected Power-up Time-out (TPWRT) may be applied. The TPWRT parameter is based on device
configuration bits and can be 0 ms (no delay), 4 ms, 16 ms or 64 ms. The total delay time at
device power-up is TPOR + TPWRT. When these delays have expired, SYSRST will be released
on the next leading edge of the instruction cycle clock, and the PC will jump to the Reset vector.
The timing for the SYSRST signal is shown in Figure 8-2. A Power-on Reset is initialized when
VDD falls below a threshold voltage, VT. The POR delay time is inserted when VDD crosses the
POR circuit threshold voltage. Finally, the PWRT delay time, TPWRT, is inserted before SYSRST
is released.
The power-on event will set the POR and BOR status bits (RCON<1:0>).
VPOR
Time
TPOR
POR Circuit
Time
System Reset is released
after Power-up Timer
expires.
TPWRT
(0 ms, 4 ms, 16 ms or 64 ms)
SYSRST
Time
Note: When the device exits the Reset condition (begins normal operation), the device
operating parameters (voltage, frequency, temperature, etc.) must be within their
operating ranges, otherwise the device will not function correctly. The user must
ensure that the delay between the time power is first applied and the time SYSRST
becomes inactive is long enough to get all operating parameters within
specification.
VDD VDD
D R
R1
MCLR
C dsPIC30F
8
Note 1: The value of R should be low enough so that the voltage drop across it does not violate
the VIH specification of the MCLR pin.
2: R1 will limit any current flowing into MCLR from external capacitor C in the event of
MCLR/VPP pin breakdown, due to Electrostatic Discharge (ESD) or Electrical Overstress
Reset
(EOS).
Note: The BOR voltage trip points indicated here are nominal values provided for design
guidance only. Refer to the “Electrical Specifications” in the specific device data
sheet for BOR voltage limit specifications.
On a BOR, the device will select the system clock source based on the device configuration bit
values (FPR<3:0>, FOS<1:0>). The PWRT time-out (TPWRT), if enabled, will be applied before
SYSRST is released.
If a crystal oscillator source is selected, the Brown-out Reset will invoke the Oscillator Start-up
Timer (OST). The system clock is held until OST expires. If a system clock source is derived from
the PLL, then the clock will be held until the LOCK bit (OSCCON<5>) is set.
The BOR status bit (RCON<1>) will be set to indicate that a BOR has occurred.
The BOR circuit, if enabled, will continue to operate while in Sleep or Idle modes and will reset
the device should VDD fall below the BOR threshold voltage.
Refer to the “Electrical Specifications” section of the appropriate device data sheet for the BOR
electrical specifications.
Typical brown-out scenarios are shown in Figure 8-4. As shown, a PWRT delay (if enabled) will
be initiated each time VDD rises above the VBOR trip point.
VDD
VBOR
TPWRT
SYSRST
VDD
VBOR
TPWRT
SYSRST
VDD
VBOR
TPWRT
SYSRST
Reset
uninitialized until written to. An attempt to use an uninitialized register as an address pointer will
reset the device. Furthermore, the IOPUWR status bit (RCON<14>) will be set.
Note: The status bits in the RCON register should be cleared after they are read so that
the next RCON register value after a device Reset will be meaningful.
Table 8-2 provides a summary of the Reset flag bit operation.
Reset
Software Any clock — — —
Illegal Opcode Any Clock — — —
Uninitialized W Any Clock — — —
Trap Conflict Any Clock — — —
Note 1: TPOR = Power-on Reset delay (10 µs nominal).
2: TPWRT = Additional “power-up” delay as determined by the FPWRT<1:0>
configuration bits. This delay is 0 ms, 4 ms, 16 ms or 64 ms nominal.
3: TOST = Oscillator Start-up Timer. A 10-bit counter counts 1024 oscillator periods
before releasing the oscillator clock to the system.
4: TLOCK = PLL lock time (20 µs nominal).
5: TFSCM = Fail-Safe Clock Monitor delay (100 µs nominal).
When the system clock source is provided by a crystal oscillator and/or the PLL, a small delay,
TFSCM, will automatically be inserted after the POR and PWRT delay times. The FSCM will not
begin to monitor the system clock source until this delay expires. The FSCM delay time is
nominally 100 µs and provides additional time for the oscillator and/or PLL to stabilize. In most
cases, the FSCM delay will prevent an oscillator failure trap at a device Reset when the PWRT
is disabled.
Figure 8-5: Device Reset Delay, Crystal + PLL Clock Source, PWRT Disabled
Reset
SYSRST
Oscillator
OSC Delay
System OSC
FSCM enabled.
TFSCM
FSCM
The Reset time line shown in Figure 8-6 is similar to that shown in Figure 8-5, except that the
PWRT has been enabled to increase the amount of delay time before SYSRST is released.
The FSCM, if enabled, will begin to monitor the system clock after TFSCM expires. Note that the
additional PWRT delay time added to TFSCM provides ample time for the system clock source to
stabilize in most cases.
Figure 8-6: Device Reset Delay, Crystal + PLL Clock Source, PWRT Enabled
TPOR TPWRT
SYSRST
TFSCM
FSCM
TFSCM short
compared to
TPWRT.
The Reset time line in Figure 8-7 shows an example when an EC + PLL clock source is used as
the system clock and the PWRT is enabled. This example is similar to the one shown in
Figure 8-6, except that the oscillator start-up timer delay, TOST, does not occur.
TPOR TPWRT
SYSRST
TFSCM
FSCM
8
TFSCM short
compared to
TPWRT.
Reset
Note 1: Delay times shown are not drawn to scale.
2: FSCM, if enabled, monitors system clock at expiration of TPOR + TPWRT + TFSCM.
3: TLOCK not inserted when PLL is is disabled.
The Reset time line shown in Figure 8-8 shows an example where an EC without PLL, or RC
system clock source is selected and the PWRT is disabled. Note that this configuration provides
minimal Reset delays. The POR delay is the only delay time that occurs before device operation
begins. No FSCM delay will occur if the FSCM is enabled, because the system clock source is
not derived from a crystal oscillator or the PLL.
SYSRST
OSC Delay
FSCM
Question 3: The BOR module does not have the programmable trip points that my
application needs. How can I work around this?
Answer: There are some applications where the device’s programmable BOR trip point levels
may still not be at the desired level for the application. Figure 8-9 shows a possible circuit for
external brown-out protection, using the MCP100 system supervisor.
VDD
VDD
8
MCP100
VSS RST
MCLR
Reset
dsPIC30F
Question 4: I initialized a W register with a 16-bit address, but the device appears to
reset when I attempt to use the register as an address.
Answer: Because all data addresses are 16 bit values, the uninitialized W register logic only
recognizes that a register has been initialized correctly if it was subjected to a word load. Two
byte moves to a W register, even if successive, will not work, resulting in a device Reset if the W
register is used as an address pointer in an operation.
Note: Please visit the Microchip web site (www.microchip.com) for additional Application
Notes and code examples for the dsPIC30F Family of devices.
Reset
NOTES: