Zakładka z wyszukiwarką danych komponentów
  Polish  ▼
ALLDATASHEET.PL

X  

ATmega165 Arkusz danych(PDF) 45 Page - ATMEL Corporation

Numer części ATmega165
Szczegółowy opis  8-bit Microcontroller with 16K Bytes In-System Programmable Flash
PDF  336 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Producent  ATMEL [ATMEL Corporation]
Strona internetowa  http://www.atmel.com
Logo ATMEL - ATMEL Corporation

ATmega165 Arkusz danych(HTML) 45 Page - ATMEL Corporation

Back Button ATmega165 Datasheet HTML 41Page - ATMEL Corporation ATmega165 Datasheet HTML 42Page - ATMEL Corporation ATmega165 Datasheet HTML 43Page - ATMEL Corporation ATmega165 Datasheet HTML 44Page - ATMEL Corporation ATmega165 Datasheet HTML 45Page - ATMEL Corporation ATmega165 Datasheet HTML 46Page - ATMEL Corporation ATmega165 Datasheet HTML 47Page - ATMEL Corporation ATmega165 Datasheet HTML 48Page - ATMEL Corporation ATmega165 Datasheet HTML 49Page - ATMEL Corporation Next Button
Zoom Inzoom in Zoom Outzoom out
 45 / 336 page
background image
45
ATmega165/V
2573G–AVR–07/09
The following code example shows one assembly and one C function for turning off the
WDT. The example assumes that interrupts are controlled (e.g. by disabling interrupts
globally) so that no interrupts will occur during execution of these functions.
Note:
1. See “About Code Examples” on page 6.
Timed Sequences for Changing the Configuration of the Watchdog Timer
The sequence for changing configuration differs slightly between the two safety levels.
Separate procedures are described for each level.
Safety Level 1
In this mode, the Watchdog Timer is initially disabled, but can be enabled by writing the
WDE bit to 1 without any restriction. A timed sequence is needed when changing the
Watchdog Time-out period or disabling an enabled Watchdog Timer. To disable an
enabled Watchdog Timer, and/or changing the Watchdog Time-out, the following proce-
dure must be followed:
1.
In the same operation, write a logic one to WDCE and WDE. A logic one must be
written to WDE regardless of the previous value of the WDE bit.
2.
Within the next four clock cycles, in the same operation, write the WDE and WDP
bits as desired, but with the WDCE bit cleared.
Safety Level 2
In this mode, the Watchdog Timer is always enabled, and the WDE bit will always read
as one. A timed sequence is needed when changing the Watchdog Time-out period. To
change the Watchdog Time-out, the following procedure must be followed:
1.
In the same operation, write a logical one to WDCE and WDE. Even though the
WDE always is set, the WDE must be written to one to start the timed sequence.
2.
Within the next four clock cycles, in the same operation, write the WDP bits as
desired, but with the WDCE bit cleared. The value written to the WDE bit is
irrelevant.
Assembly Code Example(1)
WDT_off:
; Reset WDT
wdr
; Write logical one to WDCE and WDE
in
r16, WDTCR
ori
r16, (1<<WDCE)|(1<<WDE)
out
WDTCR, r16
; Turn off WDT
ldi
r16, (0<<WDE)
out
WDTCR, r16
ret
C Code Example
(1)
void
WDT_off(void)
{
/* Reset WDT */
__watchdog_reset();
/* Write logical one to WDCE and WDE */
WDTCR |= (1<<WDCE) | (1<<WDE);
/* Turn off WDT */
WDTCR = 0x00;
}



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Arkusz danych Pobierz

Go To PDF Page


Link URL



Czy Alldatasheet okazała się pomocna?  [ DONATE ] 

O Alldatasheet   |   Reklama   |   Kontakt   |   Polityka prywatności   |   Link do karty katalogowej    |   Linki   |   Lista producentów
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com