why the LPC2378 sleep mode can not enter second

cancel
Showing results for 
Search instead for 
Did you mean: 

why the LPC2378 sleep mode can not enter second

427 Views
Contributor I

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?

0 Kudos
2 Replies

12 Views
Contributor I

who known?thank you

0 Kudos

12 Views
NXP Employee
NXP Employee

Hi,

According with your description, and the relation with your other thread:

https://community.nxp.com/thread/441738

 

It seems that there are some pending interrupts to be cleared on the CAN, so, therefore, the CAN module cannot enter sleep mode, and it is triggering a wakeup interrupt, causing that the entire MCU is not able to enter into sleep mode (that’s why you are seeing PCON=0x00 instead of 0x81 after starting the transmission).

So, in order to avoid such behavior, you should verify your CAN bus state to ensure a correct CAN termination and bus idle condition when disconnecting the other device that sends CAN data; additionally to verify the logic of the code to attend any pending interrupt and allow the module to enter into sleep mode and not causing interrupts that awakes the entire MCU from low power mode.


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos