ATmega 328
ATmega 328
ATmega 328
http://playground.arduino.com/Code/Timer1
http://www.gammon.com.au/forum/?id=11497
http://donalmorrissey.blogspot.com/2010/04/putting-arduino-diecimila-to-sleeppart.html
When the ATmega328 enters sleep mode, the execution of the code pauses at a
certain point and will resume only after it is woken from sleep by one of its internal
hardware modules, e.g. timer expiring, external interrupt, WDT, etc.
ATmega328 16-bit Timer1
Clock source frequency:
Timer1 prescale values:
Prescale
1
8
64
256
1024
16 MHz
1, 8, 64, 256 or 1024
Timer per counter tick
(S)
0.0625
0.5
4
16
64
The sequence for clearing WDE and chaning time-out configuration is as follows:
1. In the same operation, write a logic one to the Watchdog change enable bit
(WDCE) and WDE. A logic one must be written to WDE regardless of te
previous value of the WDE bit.
2. Within the next four clock cycles, write the WDE and Watchdog prescaler bits
(WDP) as desired, but with the WDCE bit cleared. This must be done in one
operation.
WDTCSR Watchdog Timer Control Register