mr_LYI

I have found a trouble in determining the cause of Atmega168 restart.According to the documentation, the 3rd bit of the MCUSR register should be 1 if MCU restarted due WDT (00001000b).But seems that this bit is never 1.Checked other bits - PowerUp bit (00000001b) is working correctly.

The Arduino bootloader intercepts all resets, and will likely interfere with the user sketch determining the reason for reset. (this is certainly true of Optiboot: http://code.google.com/p/optiboot/issues/detail?id=66 ) Whether it's true of 168-based arduinos (which run one of several other bootloaders) is uncertain...)