Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ATtiny104_Datasheet.pdf
Скачиваний:
0
Добавлен:
12.02.2026
Размер:
3.8 Mб
Скачать

Reset (WDR) instruction resets the Watchdog Timer. The Watchdog Timer is also reset when it is disabled and when a device reset occurs. Ten different clock cycle periods can be selected to determine the reset period. If the reset period expires without another Watchdog Reset, the device resets and executes from the Reset Vector.

Figure 12-6. Watchdog Timer

128 kHz OSCILLATOR

WATCHDOG RESET

WDP0

WDP1

WDP2

WDP3

WDE

WATCHDOG

PRESCALER

OSC/2KOSC/4KOSC/8KOSC/16KOSC/32KOSC/64KOSC/128KOSC/256KOSC/512KOSC/1024K

MUX

MCU RESET

The Watchdog Timer can also be configured to generate an interrupt instead of a reset. This can be very helpful when using the Watchdog to wake-up from Power-down.

To prevent unintentional disabling of the Watchdog or unintentional change of time-out period, two different safety levels are selected by the fuse WDTON. See Procedure for Changing the Watchdog Timer Configuration for details.

Table 12-1. WDT Configuration as a Function of the Fuse Settings of WDTON

WDTON

Safety Level

WDT Initial

How to Disable the

How to Change Time-

 

 

State

WDT

out

 

 

 

 

 

Unprogrammed

1

Disabled

Protected change

No limitations

 

 

 

sequence

 

 

 

 

 

 

Programmed

2

Enabled

Always enabled

Protected change

 

 

 

 

sequence

 

 

 

 

 

12.5.2.Procedure for Changing the Watchdog Timer Configuration

The sequence for changing configuration differs between the two safety levels, as follows:

12.5.2.1.Safety Level 1

In this mode, the Watchdog Timer is initially disabled, but can be enabled by writing the WDE bit to one without any restriction. A special sequence is needed when disabling an enabled Watchdog Timer. To disable an enabled Watchdog Timer, the following procedure must be followed:

1.Write the signature for change enable of protected I/O registers to register CCP

2.Within four instruction cycles, in the same operation, write WDE and WDP bits

12.5.2.2.Safety Level 2

In this mode, the Watchdog Timer is always enabled, and the WDE bit will always read as one. A protected change is needed when changing the Watchdog Time-out period. To change the Watchdog Time-out, the following procedure must be followed:

Atmel ATtiny102 / ATtiny104 [DATASHEET]

49

Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016