I am setting the MC9S08QE8 into stop3 mode and waking it up with a keyboard input. It looks like it goes to sleep for a few tens of uS and then the processor appears to reset.
My turn off code is:
KBIPE = 0x0e; //key input on bits 1,2,3
KBISC = KBISC | 0x02; //enable ints from KBI
SOPT1_STOPE = 1;
SPMSC1_LVDE = 0;
SPMSC2_LPR = 0;
SPMSC2_PPDC = 0;
My KBI int code is:
KBISC_KBACK = 1; //reset flag
KBISC_KBIE = 0; //disable any further ints until needed
I am fairly sure that the processor resets as I clear a power enable bit in the start up code (turns on power to the rest of the circuit). This is set immediately prior to my turn off code (to power down circuitry). This line goes high at turn off but goes back low again 75uS later (it is always 75uS exactly). I have a 125uS tick timer running under interrupt also. I have used a MC9S08RE16 this way with no problems.