AnsweredAssumed Answered

how to config S12G128  enter stop mode and wake up by CAN message?

Question asked by Shanwen Li on Jan 8, 2019

      I config  S12G128 with PLL and MSCAN.when I dubug by P&E_Multlilink_USB ,s12g128 enter stop mode and bring about "ILLEGAL_BP" like this:

      Does it reset?It is normal or what's wrong with it? It is on going run ,but Idonot know where it run?

      I config PLL with frequence PLL = 32MHz , BUS = 16MHz,VCO = 32Mhz.

      enter full stop mode code:

void Go_Full_StopMode(void)
{
DDRT_DDRT6 = 1;
delay_Mms(20);
CANCTL0_SLPRQ = 1; //sleep mode request ,Wait MSCAN sleep
asm(nop);
while(CANCTL1_SLPAK == 0);

delay_Mms(1);
CPMUCLKS_PSTP = 0; // Oscillator is disabled in Stop Mode (Full Stop Mode)
asm ANDCC #0x7F;
asm(nop);
EnableInterrupts;
asm STOP;
}

 

#pragma CODE_SEG __NEAR_SEG NON_BANKED

void interrupt 36 CAN_WakeUp(void)
{
// delay_can_Mms(5);
INIT_WAKE_CAN();
CANRFLG_WUPIF = 1;
}
#pragma CODE_SEG DEFAULT

 

Is there something wrong? I need your advice.

 

Thank you.

Outcomes