/* --- STC12C5Axx Series MCU Power-Down wakeup by RXD Demo ---------*/ #include "reg51.h" #include "intrins.h" typedef unsigned char BYTE; typedef unsigned int WORD; /*Declare SFR associated with the PCA */ sfr WAKE_CLKO = 0x8F; void uart_isr() interrupt 4 using 1 { if (RI) { RI = 0; } } void main() { WAKE_CLKO = 0x40; //enable RXD falling edge wakeup MCU from power-down mode ES = 1; EA = 1; while (1) { RXD = 1; //ready read RXD port while (!RXD); //check RXD _nop_(); _nop_(); PCON = 0x02; //MCU power down _nop_(); _nop_(); P2++; } }