I want to build a function wjich should keep on running even in sleep mode.Can anyone tell me how to de that?
How to set the sleep mode and also will the clock will keep on oscillating in sleep mode?
Looking at the datasheet, sleep mode seems to be specific to the CAN module. Is that what you are talking about? Or are you talking about wait mode or stop mode?
NO I am not talking about CAN module .Actually,I want to implement a function to calculate time ,which should keep on running when controller is in sleep mode or low power mode.
Even I didn't find any sleep mode in this controller.So which mode should I use and how to set that.
Pseudo STOP mode can be used with the RTI enabled to provide a time base within a low power mode.
This is described in chapter 7 of the Reference Manual S12XHZ-RM
Pseudo STOP mode is selected as opposed to STOP mode by setting the PSTP bit. Then when the CPU executes the STOP instruction, the device enters pseudo STOP mode instead of STOP mode. In pseudo STOP mode the oscillator continues operating....
Setting PSTP in the CLKSEL register ensures that the oscillator continues (pseudo STOP instead of STOP mode).
Setting PRE in the PLLCTL register enables the RTI in pseudo STOP
Register RTICTL is used to set the RTI rate.
RTIE in the register CRGINT enables the interrupt.
Ensure also that the CPU CCR S bit is clear for (pseudo) STOP mode entry.
Retrieving data ...