I had this piece of code in my AVR, and it ALWAYS reset the AVR.
mame_stack is a unsigned char set by a interrupt
temp_w1 unsigned int, with initial value of 0
wdt_reset is just for the efect, wd is not actualy enabled...
while((mame_stack != 1) || (temp_w1++ != 65530)) wdt_reset();
Could the reset be caused by incrementing temp_w1 over 0xFFFF? (buffer overflow)
Why did the reset happen? When I deleted this line all was OK![/i]