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
STOP3 mode
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
When KBI even happen
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
Solved! Go to Solution.
Hi Kris
Please check the attached file, also I already sent it through the SR that you created
I hope this will help you.