int main()
{
PINSEL10 = 0; //LED init
FIO2DIR=0x000000ff;
IODIR1=0x00000000;
FIO2MASK = 0x00000000;
FIO2SET = 0x000000FF;
INTWAKE = 0x40; //CAN awake the sleep mode
CAN_Init( 0x001C0002, 0x001C0002 ); //CAN init
CAN_SetACCF( 0x02 ); //CAN init
while(1)
{
FIO2CLR = 0x000000FF; //LED open
delay (1);
PCON = 0x81; //enter sleep mode,the first circulate is 0x81,but the second circulate is not 0x81,is 0x00
if((!(PLLSTAT & (1 << 25)))) // CLOCK init after awake sleep
{
poweron();
}
FIO2SET = 0x000000FF; //LED close
delay (1);
}
}
when I send date by the CAN,the LPC2378 can awake but in the while{ } ,it not to sleep again,why?
PCON = 0x81; the first circulate ,it can enter the sleep mode,but when I awake it,the second circulate ,the PCON is 0x00,not is 0x81,why?