no way to stay into stop/pseudo-stop

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

no way to stay into stop/pseudo-stop

752 Views
angelo_d
Senior Contributor I

Dear experts,

 

i am working on a mc9s12XEP100.

I need to stay into stop, but the stop instruction is passed over.

 

    asm volatile (
        "andcc    #0x7f    \n"
        "orcc    #0x10    \n"
        "stop        \n"
    );

 

on CCR, i set to 0 the S bit, and to 1 the I bit, while X bit is already set to 1 (checked by debugger).

Since i am disabling all those flags, i was not expecting mcu to exit from stop for any external interrupt. But it exits.

What could be the source of the stop exit ?

 

Thanks

angelo

Labels (1)
0 Kudos
Reply
3 Replies

542 Views
angelo_d
Senior Contributor I

Hi Daniel and Lama,  thanks, quite more clear now.

And, just to be sure, what about IRQ pin ? The IRQEN but unset can avoid stop to happen ?

0 Kudos
Reply

542 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I would like only to add that there is pull-up resistor at XIRQ pin, however it is weak so it is better to use external pull-up resistor to be sure nothing will happen.

Best regards,

Ladislav

0 Kudos
Reply

542 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi

Please check voltage on XIRQ pin. Low level on that pin wakes up the MCU, it doesn’t matter whether the X bit in CCR is set or not. The X bit just enables execution of XIRQ ISR.

In case the stop instruction is not even executed, you may try NOP instruction

asm ANDCC  #0x7F;         // Clear S bit

asm ORCC     #0x10;        // Set I bit

asm NOP;

asm STOP;                        // MCU STOP mode

asm NOP;

I have tried it in CW5.2 and it works.

Dan

0 Kudos
Reply