Rainbow-electronics ATmega64L Manual de usuario Pagina 41

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 298
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 40
41
ATmega16(L)
2466B09/01
Note: 1. Values are guidelines only. Actual values are TBD.
The following code example shows one assembly and one C function for turning off the
WDT. The example assumes that interrupts are controlled (for example by disabling
interrupts globally) so that no interrupts will occur during execution of these functions.
Table 17. Watchdog Timer Prescale Select
(1)
WDP2 WDP1 WDP0
Number of WDT
Oscillator Cycles
Typical Time-out
at V
CC
= 3.0V
Typical Time-out
at V
CC
= 5.0V
000 16K TBD 16 ms
001 32K TBD 32 ms
010 64K TBD 64 ms
0 1 1 128K TBD 0.13 s
1 0 0 256K TBD 0.26 s
1 0 1 512K TBD 0.5 s
1 1 0 1,024K TBD 1.0 s
1 1 1 2,048K TBD 2.0 s
Assembly Code Example
WDT_off:
; Write logical one to WDTOE and WDE
ldi r16, (1<<WDTOE)|(1<<WDE)
out WDTCR, r16
; Turn off WDT
ldi r16, (0<<WDE)
out WDTCR, r16
ret
C Code Example
void WDT_off(void)
{
/* Write logical one to WDTOE and WDE */
WDTCR = (1<<WDTOE) | (1<<WDE);
/* Turn off WDT */
WDTCR = 0x00;
}
Vista de pagina 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 297 298

Comentarios a estos manuales

Sin comentarios