![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_60.png)
10-2
PowerMemory Management
Programmer’s Manual
10.3
Reallocating Memory
void *
Lrealloc
(void *src, U32 size)
Moving of memory. This routine re-allocates the memory that is being used in the
system from one location to another. It allocates a new area, then copies the
content from the old location to the new area and free up the old memory, putpower management tools to achieve system power saving.
it back into the system heap. The purpose of this routine is for defragmentation of
the system memory.
10.4
Copying Memory
STATUS
MoveBlock
(P_U32 srcAddr P_U32 destAddr U32 size)
Copying memory from one region to another. This tool can cope with over-lapping
area. It performs memory copy in 32-bit operations whenever possible.
10.5
Inquiring Memory
STATUS
TaskMemUsed
(U32 taskId, P_U32 pSizeUsed)
U32
TotalMemUsed
(void)
U32
TotalMemSize
(void)
S32
TaskStackAvail
(void)
Memory allocated to the application and the whole system can be inquired at run
time. PPSM returns to the caller the total number of bytes of memory allocatePPSM makes use of the Power Control Module, PCM, to improve system power
the task with the given task identifier when calling TaskMemUsed(), or numbeefficiency. It allows the allocation of system clock cycles to the CPU core under
bytes of memory allocated to the whole system when calling TotalMemUsed().
PPSM returns the number of bytes of memory on the system can be allocated
through Lmalloc(), Lcalloc() or Lrealloc() when calling TotalMemSize().
PPSM returns to the caller the total number of bytes of stack can still be used by
current task when calling TaskStackAvail(). Positive returned value indicates stack
has not been used up, negative value implies stack has already overflowed.
User can inquire the size of the largest continuous memory block by calling
Lmalloc() with input flag LARGEST_MALLOC_SIZE.
Personal Portable System Manager
Programmer’s Manual
11-1
Chapter 11 Power Management
PPSM utilizes the power control module of DragonBall
to implement a set of
The Power Management Tools enable applications to:
switch to one of the power saving modes
control the duty cycle of the processor for each application in
Normal mode
switch automatically to a lower power saving mode when system is
idle
control user defined I/O ports in any of the power saving mode
transition
Applications can choose to:
control the system’s power management features directly, or
use the PPSM’s automatic power management features.
By default, the system will go to doze mode if there is no more task swapping nor
message waiting to be served in current task. So the default state is 0 sec. doze
period and sleep period counting will start if it’s set in SetSleepPeriod().
11.1
Power Control Module
software control. System clocks generated from the phase locked loop are sent to
the CPU via the PCM. By controlling the PCM register, clocks can be bursted to
the CPU core from a minimum of 3% to the full 100% in steps of 3%. This is
referred to as the CPU core duty cycle.
While the CPU demand is low, for example in a calculator
application, the clock can be bursted with a low duty cycle.
While the CPU demand is high, for example in a handwriting
recognition application, the clock can be running continuously at a
100% duty cycle.
The PCM uses a period of 32 clock cycles to burst the CPU core.
For example, with a low duty cycle value of 12%, in any given
period of time, the CPU core is active for 4 clock cycles (12% of 32
clock cycles), followed by 28 clock cycles of idle CPU core.
Please refer to the MC68328 User's Manual for full details on the operation of the
PCM.
When using the PCM to control power management, the system clock from the
Phase Locked Loop remains in high frequency. Since all peripherals on MC68328
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.