Now I use the MCU MC9S12XET256, when the MCU in the Stop or Wait Mode ,I can wake it up by a input Interrupt(PP2),Now I want to wake it up by the PIN XIRQ, which regiter or instruction I should program before it go to stop or wait mode., The datasheet say XIRQ enable by cleaer the X-BIt in CPU conditon code register,and I don't particularly understand.
Hi jiongzhong,
X bit is part of CCR register (Condition code register, one of CPU’s basic registers).
You could clear this bit similar way how you clear S bit prior STOP mode.
So, for example:
asm ANDCC #0x7F; //clear S bit
asm ANDCC #0xBF; //clear X bit
or
asm ANDCC #0x3F; //clear S and X bit
For more detail, please see CPU12X reference manual:
http://www.nxp.com/files/microcontrollers/doc/ref_manual/S12XCPUV2.pdf
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------