Difficulty with Full Stop mode

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

Difficulty with Full Stop mode

Jump to solution
2,616 Views
usdkurt
Contributor I

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!

 

Kurt

Labels (1)
0 Kudos
Reply
1 Solution
1,269 Views
kef
Specialist I

Kurt,

 

is /XIRQ pin pulled high? It doesn't matter, is X bit set or not, /XIRQ pulled low will wakep CPU.

Also XGATE should not run and fake XGATE activity bit should be cleared.

Message Edited by kef on 2009-05-21 07:17 AM

View solution in original post

0 Kudos
Reply
2 Replies
1,269 Views
usdkurt
Contributor I

The XIRQ is indeed pulled up to VCC, so no problem there.  Thank you for the reminder to check the XGATE settings.  When I disabled the XGATE via the XGE bit in XGMCTL I found that the clock chain stopped successfully.

 

Thanks,

 

Kurt
0 Kudos
Reply
1,270 Views
kef
Specialist I

Kurt,

 

is /XIRQ pin pulled high? It doesn't matter, is X bit set or not, /XIRQ pulled low will wakep CPU.

Also XGATE should not run and fake XGATE activity bit should be cleared.

Message Edited by kef on 2009-05-21 07:17 AM
0 Kudos
Reply