AnsweredAssumed Answered

Difficulty with Full Stop mode

Question asked by Kurt Liebezite on May 20, 2009
Latest reply on May 21, 2009 by Kurt Liebezite

Hi, we have a product where we want to support putting the unit into a very low-power mode.  The device we are using is the MC9S12XD64; the data sheet says that it should be possible to get the current down to less than 1 mA with all the clocks stopped in Full Stop mode.  Trouble is, we can't seem to achieve this.  We have a strange situation where it appears that the firmware execution has paused as we want it to (we don't see it twiddling the usual SPI port when we execute a 'go to sleep' command), and then when we issue the wake up command it appears to come out of sleep as expected via the IRQ interrupt.  However, we have ECLKX2 coming out on PE7, and we don't see this activity stop during sleep, nor do we see any reduction in current draw (running at about 27 mA for 39 MHz clock).


The behavior we're seeing is almost what I would expect with Pseudo Stop mode, but I've checked carefully and we're writing a $00 to CLKSEL; I don't see any reduced amplitude in the crystal signals, either (it shows about 1.2 volts pk-pk either while in sleep or full operating mode).  I'm not setting any of the other bits in the CLKSEL register, like PLLWAI or RTIWAI, or COPWAI, since I'm assuming that they only apply to WAIT mode, not both WAIT and STOP mode.  But I could be wrong?


We normally run from the PLL as a clock source; do I need to switch back to the crystal before executing a STOP command?


We enter sleep mode from within an interrupt context at priority level 1 (the lowest interrupt priority).  We arm the IRQ interrupt, clear the S bit, re-enable interrupts via CLI, and execute a STOP opcode.  The IRQ is set up with an interrupt priority of 2 (it's the only one with a higher priority level).  Is it possible that some level 1 interrupt is sneaking in, keeping the clock system  alive but not allowing execution to go forward?


If you have any ideas on why we're not seeing sub-mA power draw, I would be grateful if you post a response.  Thanks in advance!