/****************PMS150G掉电模式*******************/
/**************************************************/
/**************************************************/
/**************************************************/
// ________pms150g________
// 3.3v-|1 vdd \_/ gnd 8|-地
// key-|2 pa7 pa0 7|-led
// |3 pa6 pa4 6|
// |4_pa5_____________pa3_5|
#include "extern.h"
led bit pa.0;
key bit pa.7;
/**************************************************/
void FPPA0 (void)
{
.ADJUST_IC SYSCLK=IHRC/8 // SYSCLK=IHRC/4
byte a1;
/**************************************************/ //IO初始化
$ led out,low; //输出,低
$ key in,pull; //输入,上拉电阻
/**************************************************/
while(1)
{
led=0;
//$ clkmd ilrc/4,en_ilrc; //切换到ilrc/4
clkmd =0xf4;
clkmd.4 =0;
while (1)
{
stopsys; //进入断电模式
if(key== 0){break;}
}
//$ clkmd ihrc/8,en_ihrc; //切换到ihrc/8
clkmd =0x3c;
a1 =5;
while(a1--) //闪5次
{
led =0;
.delay 500000;
led =1;
.delay 500000;
led =0;
}
}
}
/**************************************************/