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
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 ?
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
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