Does anybody know how to set 8051 timer to sleep for a few second and then wake up by itself?
Well, it probably helps to show the whole section of code so that the comment really makes sense.
/*------------------------------------------------ Setup TIMER0 to generate a regular interupt. ------------------------------------------------*/ TR0 = 0; /* Stop Timer 0 */ TMOD &= ~0x0F; /* 16-bit, no prescale mode */ TMOD |= 0x01; TL0 = 0; /* Set T0 */ TH0 = 0; PT0 = 0; /* Low Priority Interrupt */ ET0 = 1; /* Enable Timer0 Interrupt */ TR0 = 1; /* Start Timer 0 */ EA = 1; /* Enable Global Interrupts */