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.
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.
When KBI even happen
Is there something I have missed at wait mode?
I set after 3.5s to into wait mode
/* Write your code here ... */
and I use KBI interrupt to return Run mode
Original Attachment has been moved to: 9S08PA_ADC_FIFO_SOFT.zip