With a goal of energy conservation, a project is herein documented and attached as a zip file showing how to operate the key peripherals for a simple power supply (which can be embelished as desired).
All of the peirpherals involved in a power supply are included in the project and are configured to be clocked during STOP mode.
The main program consists of a simple do forever loop which inlcude two instructions:
Goto STOP mode
The NOP is there just to put a breakpoint to show that the CPU wakes up on the timer interrupt.
At that point, the ADC samples are available, the PWM and comparator have been running the power supply.
The key is using Processor Expert to configure the clocks to keep running in STOP mode. This lets the core stop while the smart peripherals keep the power supply running.
This is shown just below:
And of course, turn on the clocks for these in the regular run mode as well as shown just above.
The zipped project is attached for CodeWarrior 10.6 for MCU.
It uses the MC56F82748 device, the latest DSC from Freescale.
Original Attachment has been moved to: SleepingPowerSupply2.zip