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