mc9s12 CAN wake up fail

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mc9s12 CAN wake up fail

1,118 Views
fupeng
Contributor II
Hi,
    I am using MC9S12xet256 micrcontroller,I use the Processor Expert to create the code.In stop mode, Normally I can wake up it by CAN,but when the AD module added,I can not wake up by CAN.
   Execute the code as follows:
  main.c
for(;;)
{
   AD1_Measure(TRUE);  /*It is possible to delete these two lines*/
   AD1_GetValue16(&advalue);
   if(EnterStopFlag)
   {
      EnterStopFlag = 0;
      /*turn off led*/
      CAN1_SetSleepRequest();
      Cpu_SetStopMode();
      /*turn on led*/
   }
}
   event.c
void CAN1_OnFullRxBuffer(void)
{
   ...
   ...
   if(MessageID == 0x101)
   {
      EnterStopFlag= 1;
   }
   else
   {
      EnterStopFlag= 0;
   }
}
void CAN1_OnWakeup(void)
{
   /* Write your code here ... */
   CAN1_ClearSleepRequest();
}
Can anybody please help me reolve this issue?
 
Regards,
Felix
0 Kudos
Reply
4 Replies

781 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Can you attach the project?

Regards,

Daniel

0 Kudos
Reply

781 Views
fupeng
Contributor II

Hi,

   When I don't add AD module,I tried many times stop-> wake up ->stop,at last MCU can not be wake up.

0 Kudos
Reply

781 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Sorry for the late response.

I have run the project but I don't see any problem.

It always wake up regardless of ADC.

Regards,

Daniel

0 Kudos
Reply

781 Views
fupeng
Contributor II
I am grateful for your response.
0 Kudos
Reply