This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320VC5509A fail to disable the internal oscillator

Other Parts Discussed in Thread: TMS320VC5509A, TMS320VC5503

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

  • After deactivate USB

     *(ioport volatile unsigned int *)0x7000 = 0x5; // activate USB and enable USB idle (USB Reset =1, USB Idle = 1)

    The step writing 0x002E should be after writing 0xC000:

     *(ioport volatile unsigned int *)0x6C00 = 0xC000;

    *(ioport volatile unsigned int *)0x0001 = 0x002E; // enable EMIF, Peripheral, and DMA idle

     *(ioport volatile unsigned int *)0x0001 = 0x003F; // enable EMIF, Peripheral, DMA, CPU and Clock idle

    Regards.

     

     

  • Steve,

     I have changed the instructions you have mentioned, but unfortunately it yielded no result. The oscillator is still unwilling to relax.
    Here is the heart of code:

    *(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 *)0x6C00 = 0xC000; // Clockout & osc disable in External Bus Selection Register 
    
    *(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");
    
    *(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");

  • Have you disconnected the emulator? Do you have a C5509A DSK from Spectrum Digital to try you code?

    Regards.

     

  • Steve,

      Yes, the emulator is certainly disconnected. The board is on its free run. The CPU is booted from the SPI flash. Unfortunately,  we have no any C5509A DSK and it seems are unable to buy, since the CPU is quite eldery,  and no neighbouring distributors have it in their ranks.

  • Sergey,

    So far you have been doing the right thing. I don't know what else to try. As for the DSK, Spectrum Digital site still say "order now", you can check it out if you want.

    http://www.spectrumdigital.com/product_info.php?cPath=24&products_id=178&osCsid=66a35b6f0f58f80345b75156f0801ff8

    Regards.

  • Steve,

       We have developed a test board to investigate the power consumption and oscillator disabling issues. The board contains the 5509A DSP and SPI boot flash. All the DSP pins are connected to test points and properly routed according to http://www.ti.com/lit/an/sprab14/sprab14.pdf document. It turned out that INT pins left unconnected were our case. These pins prevent the internal oscillator from stop. Now, beeing in stop mode, the board consumes about 900 uA (3.8V).

  • Great! Thank you for sharing. This is a good example on debugging board issues; unused pins need to be in known state.

    Thanks.