/* --- STC12C5Axx Series MCU Power-Down wakeup by T0 Demo ----------*/ #include "reg51.h" #include "intrins.h" sfr WAKE_CLKO = 0x8f; //External interrupt0 service routine void t0int() interrupt 1 //(location at 000BH) { } void main() { WAKE_CLKO = 0x10; //enable T0 falling edge wakeup MCU from power-down mode ET0 = 1; //enable T0 interrupt EA = 1; //open global interrupt switch while (1) { T0 = 1; //ready read T0 port while (!T0); //check T0 _nop_(); _nop_(); PCON = 0x02; //MCU power down _nop_(); _nop_(); P1++; } }