/* --- STC12C5Axx Series MCU Power-Down wakeup by INT0 Demo --------*/ #include "reg51.h" #include "intrins.h" //External interrupt0 service routine void exint0() interrupt 0 //(location at 0003H) { } void main() { IT0 = 1; //set INT0 int type (1:Falling 0:Low level) EX0 = 1; //enable INT0 interrupt EA = 1; //open global interrupt switch while (1) { INT0 = 1; //ready read INT0 port while (!INT0); //check INT0 _nop_(); _nop_(); PCON = 0x02; //MCU power down _nop_(); _nop_(); P1++; } }