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.

changing power modes

Hi,

is there some examples on putting th ezdsp 5535 into different modes?

PLL power down

peripheral clock idle

core voltage scaling

daram/saram low power modes

independant power domains

io voltage selection

and usb power down

i want to learn how to get into these modes. im having trouble implementing what the spruh87a manual is telling me to do.

any sample code would be very helpful.

thanks,

steven 

  • Hi,

    Team is working on and will address your request as soon as possible.

    Thanks & regards,

    Sivaraj K

  • Hi Steven,

    There isn't any src code that's C5535-specific w.r.t the different modes listed above. But the different power management modes are given a step-by-step description in the same manual (http://www.ti.com/lit/ug/spruh87d/spruh87d.pdf) under Section 1.5.6, Pages82-85. Would you've got a chance to check the same as well?

    Best Regards.

  • thank you,

    this is the manual I was trying to follow. it's not as specific as i would like it to be. i was really hoping for some example code to help. i found some but it's not the modes i need to get to and the other examples i found are not working. this is with the ezdspc5535 board. 

    would it be possible to make some example code?

    thanks again,

    steven

  • Hi Steven,

    There is no C5535-specific example code as yet available in the public domain. However, please find below a sample code snippet I'd written down for C5517, which might help guide you how to achieve an IDLE2 state. You may extend the same for an IDLE3 state or any other mode to save power.

    /**** Here, before the following code, you must have code initializing RTC, setting an RTC ALarm interrupt. The following section is actually disabling all peripherals except RTC are disabled and system clock SYSCLK is left enabled. This IDLE2 mode will be exited once the RTC alarm interrupt wakes up the CPU  ******/ 

        printf("\nDisabling USB Clk domain\n");
        CSL_USB_REGS->FADDR_POWER |= CSL_USB_FADDR_POWER_SUSPENDM_MASK;

        CSL_SYSCTRL_REGS->CLKSTOP1 |= CSL_SYS_CLKSTOP1_USBCLKSTPREQ_MASK;
        while(!(CSL_SYSCTRL_REGS->CLKSTOP1 &
          CSL_SYS_CLKSTOP1_USBCLKSTPACK_MASK));
        CSL_SYSCTRL_REGS->PCGCR2 |= CSL_SYS_PCGCR2_USBCG_MASK;
        CSL_SYSCTRL_REGS->USBSCR |= CSL_SYS_USBSCR_USBOSCDIS_MASK;

        CSL_SYSCTRL_REGS->CLKSTOP1 |=
          (CSL_SYS_CLKSTOP1_UHPICLKSTPREQ_MASK |
          CSL_SYS_CLKSTOP1_MBPCLKSTPREQ_MASK |
          CSL_SYS_CLKSTOP1_URTCLKSTPREQ_MASK |
          CSL_SYS_CLKSTOP1_EMIFCLKSTPREQ_MASK);
        while(!(CSL_SYSCTRL_REGS->CLKSTOP1 &
             (CSL_SYS_CLKSTOP1_UHPICLKSTPACK_MASK |
            CSL_SYS_CLKSTOP1_MBPCLKSTPACK_MASK |
            CSL_SYS_CLKSTOP1_URTCLKSTPACK_MASK |
            CSL_SYS_CLKSTOP1_USBCLKSTPACK_MASK |
            CSL_SYS_CLKSTOP1_EMIFCLKSTPACK_MASK)));


        CSL_SYSCTRL_REGS->CLKSTOP2 |=
          (CSL_SYS_CLKSTOP2_MSPBRIDGECLKSTPREQ_MASK |
            CSL_SYS_CLKSTOP2_MSPCLKSTPREQ_MASK);
        while(!(CSL_SYSCTRL_REGS->CLKSTOP2 &
          (CSL_SYS_CLKSTOP2_MSPBRIDGECLKSTPACK_MASK |
            CSL_SYS_CLKSTOP2_MSPCLKSTPACK_MASK)));

        printf("\nDisabling Clk to all preipherals except"
          " Sysclk to clk generator\n");
        CSL_SYSCTRL_REGS->PCGCR1 |= 0x7FFF;
        CSL_SYSCTRL_REGS->PCGCR2 |= 0xFF;

        CSL_CPU_REGS->IFR0 |= 0xFBFC;
        CSL_CPU_REGS->IFR1 |= 0x07FF;

        CSL_RTC_REGS->RTCINTREG |= CSL_RTC_RTCINTREG_EXTINTEN_MASK;

      CSL_SYSCTRL_REGS->RSCR = 0x0001;
      CSL_RTC_REGS->RGKR_LSW = 0xF1E0;
      CSL_RTC_REGS->RGKR_MSW = 0x95A4;

        printf("\nSystem is in IDLE2 mode. "
               "You may measure the power now..."
           "\n Expect The Alarm event and subsequent exit from "
             " the IDLE state at the time mentioned above");
        CSL_IDLECTRL_REGS->ICR |= (CSL_IDLE_ICR_HWAI_MASK | CSL_IDLE_ICR_CPUI_MASK);


        asm("\tIDLE                      ;====> CODE AUTO-GENERATED by CSL");

        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");

     while(!alarm_event_intr); //wait for the alarm interrupt

    ........
    ......
    ....
    ...

     

    /**** Also, have an RTC ALARM ISR defined, as shown below *****/

    void rtc_alarmEvt(void)
    {
        CSL_FINST(CSL_RTC_REGS->RTCINTFL, RTC_RTCINTFL_ALARMFL, SET);
     alarm_event_intr=1;
     printf("\nRTC Alarm Interrupt has been generated\n\n");
    }

    As soon as the alarm interrupt comes in, the cpu wakes up from the IDLE2 state and resumes execution from where it was last before going into the IDLE2 state.

    Hope the same helps.

    Best Regards.

  • thank you very much. i will try it this week.

  • Can somebody from TI also please post IDLE-state example code for the c5505 as well?

  • Hi,

    C5505 was an older version. As compared to C5517, it didn't have McSPI and McBSP and had an LCD module instead of the current C5517-UHPI. So you could use the same code as reference, 'without' the McSPI and McBSP disable. You may retain the UHPI part as the old-LCD bits and the current-UHPI bits have the same location in the System Control registers. And as there was no McSPI, there was no Clkstp2 register. So, the above code modified for C5505 should be somewhat like this:

    /**** Here, before the following code, you must have code initializing RTC, setting an RTC ALarm interrupt. The following section is actually disabling all peripherals except RTC are disabled and system clock SYSCLK is left enabled. This IDLE2 mode will be exited once the RTC alarm interrupt wakes up the CPU  ******/ 

        printf("\nDisabling USB Clk domain\n");
        CSL_USB_REGS->FADDR_POWER |= CSL_USB_FADDR_POWER_SUSPENDM_MASK;

        CSL_SYSCTRL_REGS->CLKSTOP1 |= CSL_SYS_CLKSTOP1_USBCLKSTPREQ_MASK;
        while(!(CSL_SYSCTRL_REGS->CLKSTOP1 &
          CSL_SYS_CLKSTOP1_USBCLKSTPACK_MASK));
        CSL_SYSCTRL_REGS->PCGCR2 |= CSL_SYS_PCGCR2_USBCG_MASK;
        CSL_SYSCTRL_REGS->USBSCR |= CSL_SYS_USBSCR_USBOSCDIS_MASK;

        CSL_SYSCTRL_REGS->CLKSTOP1 |=
          (CSL_SYS_CLKSTOP1_UHPICLKSTPREQ_MASK |
          CSL_SYS_CLKSTOP1_URTCLKSTPREQ_MASK |
          CSL_SYS_CLKSTOP1_EMIFCLKSTPREQ_MASK);
        while(!(CSL_SYSCTRL_REGS->CLKSTOP1 &
             (CSL_SYS_CLKSTOP1_UHPICLKSTPACK_MASK |
            CSL_SYS_CLKSTOP1_URTCLKSTPACK_MASK |
            CSL_SYS_CLKSTOP1_USBCLKSTPACK_MASK |
            CSL_SYS_CLKSTOP1_EMIFCLKSTPACK_MASK)));


        printf("\nDisabling Clk to all preipherals except"
          " Sysclk to clk generator\n");
        CSL_SYSCTRL_REGS->PCGCR1 |= 0x7FFF;
        CSL_SYSCTRL_REGS->PCGCR2 |= 0xFF;

        CSL_CPU_REGS->IFR0 |= 0xFBFC;
        CSL_CPU_REGS->IFR1 |= 0x07FF;

        CSL_RTC_REGS->RTCINTREG |= CSL_RTC_RTCINTREG_EXTINTEN_MASK;

      CSL_SYSCTRL_REGS->RSCR = 0x0001;
      CSL_RTC_REGS->RGKR_LSW = 0xF1E0;
      CSL_RTC_REGS->RGKR_MSW = 0x95A4;

        printf("\nSystem is in IDLE2 mode. "
               "You may measure the power now..."
           "\n Expect The Alarm event and subsequent exit from "
             " the IDLE state at the time mentioned above");
        CSL_IDLECTRL_REGS->ICR |= (CSL_IDLE_ICR_HWAI_MASK | CSL_IDLE_ICR_CPUI_MASK);


        asm("\tIDLE                      ;====> CODE AUTO-GENERATED by CSL");

        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");
        asm("\tNOP");

     while(!alarm_event_intr); //wait for the alarm interrupt

    ........
    ......
    ....
    ...

     

    /**** Also, have an RTC ALARM ISR defined, as shown below *****/

    void rtc_alarmEvt(void)
    {
        CSL_FINST(CSL_RTC_REGS->RTCINTFL, RTC_RTCINTFL_ALARMFL, SET);
     alarm_event_intr=1;
     printf("\nRTC Alarm Interrupt has been generated\n\n");
    }

    Best Regards.

  • Thanks.  I have a couple more questions regarding low power mode on the C5505.  I can open a separate thread if that is preferred--just let me know.

    1. I'm trying to enter the lowest possible power state in my application.  Is there any significant difference between executing:

    CSL_SYSCTRL_REGS->PCGCR1 |= CSL_SYS_PCGCR1_SYSCLKDIS_MASK;

    and instead writing to the ICR register and executing the "IDLE" instruction?  If I'm already planning on idling all domains in the ICR and disabling all clocks in the PCGCR, these seem to be the same to me.

    2. In my C5505 application, I'm using a 12 MHz oscillator on CLKIN so I can run the CPU at 150 MHz.  With CLKSEL set to 1, is there any limitation on which power modes I can enter?

  • Yes please. It would be better to start a new thread on the same, from the C5505 IDLE code snippet section above.

    Would post my comments on the new post.

    Best Regards.