We have a custom board with 5509A DSP. This project needs the power saving mode to be implemented. 12MGz crystal is connected to X1/X2 DSP pins. The USB and RTC modules are not being used but are powered properly. DSP boots from SPI flash memory. When the power saving code is executed, the crystal signal at X1/X2 DSP pins still can be sensed. When DSP enters idle mode, code execution is terminated, and the current drops to 5mA. The crystal signal is still present at X1/X2 pins. If we explicitly put X2 to GND the current drops to 1mA.
Before entering idle mode we disable all the interrupts to make the case simpler.
Here is the idle mode code:
volatile int i, usb_reg; _disable_interrupts(); *IER0 = 0x0000; *IER1 = 0x0000; *IFR0 = 0xffff; *IFR1 = 0xffff; *(ioport volatile unsigned int *)0x2805 &= ~(SPCR_RRST); // Serial Port Control Register 1, McBSP #0 *(ioport volatile unsigned int *)0x2804 &= ~(SPCR_FRST|SPCR_GRST|SPCR_XRST); // Serial Port Control Register 2, McBSP #0 *(ioport volatile unsigned int *)0x2C05 &= ~(SPCR_RRST); // Serial Port Control Register 1, McBSP #1 *(ioport volatile unsigned int *)0x2C04 &= ~(SPCR_FRST|SPCR_GRST|SPCR_XRST); // Serial Port Control Register 2, McBSP #1 *(ioport volatile unsigned int *)0x3005 &= ~(SPCR_RRST); // Serial Port Control Register 2, McBSP #2 *(ioport volatile unsigned int *)0x3004 &= ~(SPCR_FRST|SPCR_GRST|SPCR_XRST); // Serial Port Control Register 2, McBSP #2 *(ioport volatile unsigned int *)0x6C00 = 0x8000; // Clockout disable in External Bus Selection Register *(ioport volatile unsigned int *)0x1E00 = 0x200; // set USB PLL to x4 in USB PLL register *(ioport volatile unsigned int *)0x1E00 = 0x210; // set lock bit *(ioport volatile unsigned int *)0x7000 = 0x4; // activate USB (USB Reset = 1) in USB IDLE Control register *(ioport volatile unsigned int *)0x67FC |= 0x80; // pull DP high in USB CTL *(ioport volatile unsigned int *)0x7000 = 0x5; // activate USB and enable USB idle (USB Reset =1, USB Idle = 1) *(ioport volatile unsigned int *)0x3C0F = 0x0001; // IDLE IIC *(ioport volatile unsigned int *)0x6803 = 0x0100; // IDLE ADC *(ioport volatile unsigned int *)0x2812 |= 0x4000; // IDLE McBSP0 with PCR0 *(ioport volatile unsigned int *)0x2C12 |= 0x4000; // IDLE McBSP1 with PCR1 *(ioport volatile unsigned int *)0x3012 |= 0x4000; // IDLE McBSP2 with PCR2 *(ioport volatile unsigned int *)0x1002 |= 0x8000; // IDLE Timer0 with TCR0 *(ioport volatile unsigned int *)0x2402 |= 0x8000; // IDLE Timer1 with TCR1 *(ioport volatile unsigned int *)0x0001 = 0x002E; // enable EMIF, Peripheral, and DMA idle for (i=0; i<1000; i++); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); asm(" IDLE"); usb_reg = *(ioport volatile int *)0x7000; // check USB Idle Control and Status Register *(ioport volatile unsigned int *)0x6C00 = 0xC000; *(ioport volatile unsigned int *)0x0001 = 0x003F; // enable EMIF, Peripheral, DMA, CPU and Clock idle // delay of at least 2.5 us needed between the two IDLE instructions for (i=0; i<1000; i++); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); asm(" IDLE");
While investigating this issue, we have covered the following documents:
1. http://www.ti.com/lit/ds/symlink/tms320vc5509a.pdf TMS320VC5509A Fixed-Point Digital Signal Processor
2. http://www.ti.com/lit/ug/spru317k/spru317k.pdf TMS320C55x DSP Peripherals Overview
3. http://www.ti.com/lit/an/spraa30/spraa30.pdf TMS320VC5509A Hardware Designer’s Resource Guide
4. http://www.ti.com/lit/an/spraa04c/spraa04c.pdf TMS320VC5503/C5506/C5507/C5509A Power Consumption Summary
5. http://www.ti.com/lit/an/spra078d/spra078d.pdf Disabling the Internal Oscillator on the VC5503/C5506/C5507/C5509/C5509A DSP
6. http://www.ti.com/lit/an/sprab14/sprab14.pdf Board and System Design Considerations for the TMS320VC5503/5506/5507/5509A DSPs
7. http://www.ti.com/lit/an/spra983c/spra983c.pdf TMS320VC5509 to TMS320VC5509A Migration