I need some help using the wait mode with MC9S08DZ16 microcontroller.
In my main routine firstly i do some peripherals initialization (I am using UART, MSCAN, IIC and a Timer) and then I would like to put the microcontroller into Wait Mode waiting for an interrupt on the UART to reduce power consumption.
After calling che Cpu_WaitInterrupt() function I have the following code into the main routine:
while(function() == 1);
where "function()" just looks if some data have been put into a sw buffer from the UART ISR.
What I see is that power consumption do not decrease and moreover all debug functions are active whereas on the datasheet I see that in Wait Mode only some functionalities should be enabled.
Is my procedure correct or do I have to consider some particular expedient to make the wait mode to run properly?
Thank you in advance