I am trying to reset atmega32a programmatically. It can be done with watchdog timer. In my case i am trying to reset the timer when i send some command from PC.
I have written code like this for that function.
Code:
case(RESET):
#asm("CLI"); //Disable global interrupt
MCUSR = 0x00;
#asm("WDR");
WDTCR=0x1B;
WDTCR=0x0B;
while(1); //Wait for reset
Command = 0;
break;
but this is not working, can anyone help me what i am doing wrong or how to reset ATmega32A programmatically. When i send "RESET" command from PC then it has to reset micro controller.
I am trying to enable and reset the controller and disable WDT in the same command. Is it possible? I have looked into the fuse bits about watchdog enabled or not i didn't find anything about.