Dear Sir or Madam,
My application uses S12XET256. In order to save power, S12XET256 has to be in STOP (pseudo or full) mode.
During the normal operation, debugging information is printed out of SCI port at baud-rate 38400.
Based on the documents, the processor can be put into pseudo STOP mode with /XIRQ pull high externally, S-Bit is clear (ANDCC #$7F), X-Bit is set(ORCC #$40), I-bit is clear(CLI), PSTP = 0. It seems S12X goes to the right mode.
An external interrupt is configured to Port H. Once the interrupt is fired, S12XET256 goes out of pseudo STOP mode. New debugging information will be printed out of SCI.
However, after wakeup, the new debugging information that goes out of SCI are corrupted. It seems that the program does not start right after "STOP" instruction.
Where does the processor wake up from STOP mode? Is it possible the SCI baudrate got changes during STOP mode?
By using "WAI" Instead of "STOP", everything works fine.
Please advice what I have done wrong on entering or exiting STOP mode.
Thank you in advance.
--Luke
解決済! 解決策の投稿を見る。
Are you using PLL? If so, then after wakeup you should not send over SCI anything until PLL is relocked and you switch to PLL clock.
Is fast wake up enabled (PLLCTL.FSTWKP)? Then you should not print debug message while MCU is in self clock mode (CRGFLG.SCM==1).
Are you using PLL? If so, then after wakeup you should not send over SCI anything until PLL is relocked and you switch to PLL clock.
Is fast wake up enabled (PLLCTL.FSTWKP)? Then you should not print debug message while MCU is in self clock mode (CRGFLG.SCM==1).
Hi Kef,
Thank you for your help. It works now.
--Luke