AnsweredAssumed Answered

MC9S08PA4 of wait mode question

Question asked by Kris Ke on Oct 28, 2015
Latest reply on Oct 29, 2015 by vicentegomez

As the MC9S08PA4 Reference Manual show

 

10.4.2 Wait mode

The WAIT instruction enables interrupts by clearing the I bit in the CCR. It then halts the clocks to the CPU to reduce overall power consumption while the CPU is waiting for the interrupt or reset event that will wake the CPU from wait mode. When an interrupt or

reset event occurs, the CPU clocks will resume and the interrupt or reset event will be processed normally.

 

 

So, if I into to Wait/STOP mode, just give it a interrupt even that will wake the CPU from wait/STOP mode.

 

I have try to set MC9S08PA4 into STOP mode, and it can work, and use KBI to trigger interrupt to return RUN mode are work normal.

 

Run Mode

DSC_0495.JPG

 

 

STOP3 mode

DSC_0494.JPG

 

 

If I set  MC9S08PA4 into wait mode, it can work.

But I use KBI to trigger interrupt back to Run are fail, still in wait mode.

 

Wait mode

DSC_0497.JPG

 

 

When KBI even happen

DSC_0496.JPG

 

 

 

Is there something I have missed at wait mode?

 

 

I set after 3.5s to into wait mode

 

 

void TI1_OnInterrupt(void)

{

  /* Write your code here ... */

  //Cpu_SetStopMode();

  KBI0_SC_KBACK=1;

  FTM0_SC_TOIE=0;

  Cpu_SetWaitMode();

}

 

 

 

 

and I use KBI interrupt to return Run mode

 

 

 

 

ISR(Wait_interrupt)

{

  wait_Flag=1;

 

  KBI0_SC_KBACK=1;

  FTM0_SC_TOIE=1;

  //FTM0_SC_CLKS=1;

}

Original Attachment has been moved to: 9S08PA_ADC_FIFO_SOFT.zip

Outcomes