I refer to SPRUFK5A, TMS320C674x DSP Megamodule , section 9.2.4, the CPU can be powered-down by issuing an IDLE instruction.
The entire C674x megamodule can be powered-down using the following procedure. Other than the options previously specified, it is not possible to power-down only part of the C674x megamodule.
Powering-down the C674x megamodule is completely under software control by programming the megamodule power-down (MEGPD) bit in the power-down controller command register (PDCCMD).
The following software sequence is required to power-down the C674x megamodule:
1. Enable power-down by setting the MEGPD field to 1 in the PDCCMD register.
2. Enable the CPU interrupt(s) that you want to wake-up the C674x megamodule. Disable all other interrupts.
3. Execute the IDLE instruction
I create a DSP BIOS idle task to execute the IDLE instruction.
bios.IDL.create("IdleTask");
bios.IDL.instance("IdleTask").order = 1;
bios.IDL.instance("IdleTask").comment = "Idle Task";
bios.IDL.instance("IdleTask").fxn = prog.extern("IdleTask");
bios.IDL.instance("IdleTask").calibration = 0;
void IdleTask( void )
{
asm(" idle");
}
My question if I could enable power-down by setting the MEGPD field to 1 in the PDCCMD register only once. The subsequence IDLE instruction in "idle task" can power down the DSP Megamodule?
Or I need to set the MEGPD field to 1 in the PDCCMD register every time IdleTask is executed?
void IdleTask( void )
{
*(volatile uint32_t *)(0x01810000) |= 0x00010000;// set MEGPD=1 Sleep mode
{
asm(" idle");
}
}