MC9S12G128 wake up from Pseudo Stop Mode

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

MC9S12G128 wake up from Pseudo Stop Mode

Jump to solution
2,674 Views
1090097669
Contributor III

MC9S12G128 wake up from Pseudo Stop Mode,After Wake up Where is the program running position? if MCU wakes up from Isr,How to make the chip rerun to the main function without resetting?

Labels (4)
0 Kudos
1 Solution
2,403 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

1)

the code continues with the interrupt which has woken the MCU up and the it goes to the next code after the instruction asm STOP where you put the MCU to stop/pseudo stop mode.

2) If you want to return to main then just use main();

Of course, if you want to go to start of the code which uses also Startup function (CodeWarrior) you should:

a) define the function in the module you will call the Startup() from.

For example modue main.c will contain:

void _Startup(void);

b) Call the function at the place you require.

Do not forget that some register are write once only so they will not be changed by new write.

Please look  into attached example it solves something similar....

Best regards,

Ladislav

View solution in original post

6 Replies
2,403 Views
vijayravi
Contributor II

Hi,

I tried to wakeup from STOP mode. After waking up from STOP mode using interrupt, if i call the main function as you said, the process is slow when compared to calling startup function. may i know why is that?Re: MC9S12G128 wake up from Pseudo Stop Mode

0 Kudos
2,403 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

One more thing, however, came to my mind.

Thank you for response, one thing I would like only to highlight. If you go directly to the start of the code but behind the place where stack is initialized you have to process/reinitialize the stack (LDS).

If you want to find the original stack value then search for code LDS in the file start12.c.

Best regards,

Ladislav

0 Kudos
2,403 Views
1090097669
Contributor III

Hi Lama,

   Thank you for your Calling attention to that,However,Software restart function——_Startup() is before initializing the stack ,RAM and so on,so,I dont have to worry about the question.

    if I get error somewhere else,Please point it out,thank you.

0 Kudos
2,404 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

1)

the code continues with the interrupt which has woken the MCU up and the it goes to the next code after the instruction asm STOP where you put the MCU to stop/pseudo stop mode.

2) If you want to return to main then just use main();

Of course, if you want to go to start of the code which uses also Startup function (CodeWarrior) you should:

a) define the function in the module you will call the Startup() from.

For example modue main.c will contain:

void _Startup(void);

b) Call the function at the place you require.

Do not forget that some register are write once only so they will not be changed by new write.

Please look  into attached example it solves something similar....

Best regards,

Ladislav

2,403 Views
1090097669
Contributor III

Hi LAMA,

there is a question that after the chip sleeps(enter stop  Mode), power on again after a period of time (About 20s), it may automatically trigger a CAN wakeup interrupt, resulting in an incorrect process,How to avoid this phenomenon?

0 Kudos
2,403 Views
1090097669
Contributor III

Hi Lama,

   I have resoved the question alreadly,thank you very much!

0 Kudos