ATtiny10/11/12
23
•
Bit 0 - PORF: Power-on Reset Flag
This bit is set by a power-on reset. A watchdog reset or an external reset will leave this bit unchanged.
To summarize, the following table shows the value of these two bits after the three modes of reset.
To identify a reset condition, the user software should clear both the PORF and EXTRF bits as early as possible in the pro-
gram. Checking the PORF and EXTRF values is done before the bits are cleared. If the bit is cleared before an external or
watchdog reset occurs, the source of reset can be found by using the following truth table:
MCU Status Register – MCUSR for the ATtiny12
The MCU Status Register provides information on which reset source caused an MCU reset.
•
Bit 7..4 - Res: Reserved Bits
These bits are reserved bits in the ATtiny12 and always read as zero.
•
Bit 3 - WDRF: Watchdog Reset Flag
This bit is set if a watchdog reset occurs. The bit is reset by a power-on reset, or by writing a logic zero to the flag.
•
Bit 2 - BORF: Brown-out Reset Flag
This bit is set if a brown-out reset occurs. The bit is reset by a power-on reset, or by writing a logic zero to the flag.
•
Bit 1 - EXTRF: EXTernal Reset Flag
This bit is set if an external reset occurs. The bit is reset by a power-on reset, or by writing a logic zero to the flag.
•
Bit 0 - PORF: Power-on Reset Flag
This bit is set if a power-on reset occurs. The bit is reset by writing a logic zero to the flag.
To use the reset flags to identify a reset condition, the user should read and then reset the MCUSR as early as possible in
the program. If the register is cleared before another reset occurs, the source of the reset can be found by examining the
reset flags.
ATtiny12 Internal Voltage Reference
ATtiny12 features an internal voltage reference with a nominal voltage of 1.22V. This reference is used for Brown-out
Detection, and it can be used as an input to the Analog Comparator.
Table 11. PORF and EXTRF Values after Reset
Reset Source EXTRF PORF
Power-on undefined 1
External Reset 1 unchanged
Watchdog Reset unchanged unchanged
Table 12. Reset Source Identification
EXTRF PORF Reset Source
0 0 Watchdog Reset
1 0 External Reset
0 1 Power-on Reset
1 1 Power-on Reset
Bit 76543210
$34 - - - - WDRF BORF EXTRF PORF MCUSR
Read/Write R R R R R/W R/W R/W R/W
Initial value 0 0 0 0 See bit description