MC9S12G128 wake up from Pseudo Stop Mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MC9S12G128 wake up from Pseudo Stop Mode

ソリューションへジャンプ
3,306件の閲覧回数
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?

ラベル(4)
0 件の賞賛
返信
1 解決策
3,035件の閲覧回数
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

元の投稿で解決策を見る

6 返答(返信)
3,035件の閲覧回数
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 件の賞賛
返信
3,035件の閲覧回数
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 件の賞賛
返信
3,035件の閲覧回数
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 件の賞賛
返信
3,036件の閲覧回数
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

3,035件の閲覧回数
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 件の賞賛
返信
3,035件の閲覧回数
1090097669
Contributor III

Hi Lama,

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

0 件の賞賛
返信