Questions for Entering and Exiting Stop mode on S12XET256

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

Questions for Entering and Exiting Stop mode on S12XET256

Jump to solution
935 Views
luke_5817
Contributor I

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

Labels (1)
0 Kudos
1 Solution
606 Views
kef
Specialist I

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).

View solution in original post

2 Replies
607 Views
kef
Specialist I

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).

606 Views
luke_5817
Contributor I

Hi Kef,

Thank you for your help. It works now.

--Luke

0 Kudos