1/************************????1 ?Ƿ??е?ѹ??? ?Ƿ?????***************************/ //#include "lcd1602.h" #include "delay.h" #include "common.h" #include "STC12C5A60S2.h"//??????Ƭ???Ĵ?????ͷ?ļ? #include "usart.h" //#include "iic.h" /*????2???ⲿ?????жϼ??*/ 7 6 5 4 3 2 1 0 Reset Value //sfr PCON = 0x87; - - LVDF POF GF1 GF0 PD IDL 0001,0000 //Power Control //LVDF: ??ѹ????־??ֻҪ??ѹ???ڼ???ż???ѹ????λ??1????????0??˯??ǰ??ֹ??ѹ?жϿɽ??͹??ġ????????ѹʱ?жϻ???MCU?? void main() { USART0_Init(); //???ڳ?ʼ?? PCON = PCON & ~(1<<5); //??ѹ????־??0 PLVD = 1; //??ѹ?ж? ???ȼ??? EA = 1; ELVD = 1; //??ѹ????ж????? /*???󣺴??ڵ???????ÿ??2S?Ӵ?ӡ??һ??"hello,world"??????????????ε???P4.6?ĵ?ѹʼ??û?н????жϣ??ⲿ?Dz???Ҫ??ʲô??·??*/ /*˵????#include "STC12C5A60S2.h" ???ͷ?ļ?????keil??stc12c5a.h ?????????мӷ??ظ?????????? ???Բ??ù?*/ while(1) { USART0_SendString("hello,world");//???ڵ?????????ʾ??hello??world?? Delay1ms(2000); //??ʱ2S } } void LVD_Routine(void) interrupt 6 { uchar i; USART0_SendString("Enter LVD"); //??λ???ϴ?ӡ"Enter LVD" while(PCON & (1<<5)) //????Ƿ???Ȼ?͵?ѹ { PCON = PCON & ~(1<<5); //??ѹ????־??0 for(i=0; i<100; i++) ; //??ʱһ?? } USART0_SendString("Quit LVD"); }