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.

TMS570LS1224: Low Power Mode Examples?

Part Number: TMS570LS1224
Other Parts Discussed in Thread: LAUNCHXL2-TMS57012, , TM4C129ENCPDT

Hi,

My app performs some taks every 10sec. I would like to go into low power mode to decrease power consumption (It will be almost all the time in low power mode.and it should be wake up every 10sec). I read TMS570LS12 TRM and I also saw few threads on e2e.

Currently I am working on LAUNCHXL2-TMS57012. 

For GLCK = 160MHz (all clock domain working) current consumption ~ 145mA (10sec blinking LED).

After my code (below) power consumption decreases to ~75mA: Here is the code:

            /* Wakeup Interrupt: RTI compare 0 */
            vimREG->WAKEMASKCLR0 = 0xFFFFFFFF;
            vimREG->WAKEMASKCLR1 = 0xFFFFFFFF;
            vimREG->WAKEMASKCLR2 = 0xFFFFFFFF;

            vimREG->WAKEMASKSET0 = (0x1 << 2); //rti 2


            /* flash */
            flashWREG->FBAC = (0x0F << 8) | (0x0F);
            flashWREG->FBFALLBACK = 0x00000000U
            | (uint32)((uint32)SYS_SLEEP<< 14U)     /* BANK 7 */
            | (uint32)((uint32)SYS_SLEEP << 2U)     /* BANK 1 */
            | (uint32)((uint32)SYS_SLEEP << 0U);    /* BANK 0 */
            flashWREG->FPAC1 = 0x00000000U;         /* take the pump to sleep */

            /* clocks */
            systemREG1->GHVSRC = 0x00000000;
            systemREG1->VCLKASRC= 0x00000000;
            systemREG1->RCLKSRC = 0x00000000;

            /* - Disable / Enable clock domain */
            systemREG1->CDDIS = 0x0         //RTICLK is enabled for wakeup
            | (uint32)((uint32)1U << 0U )   //GCLKOFF
            | (uint32)((uint32)1U << 1U )   //HCLK OFF
            | (uint32)((uint32)1U << 2U )   //VCLKP OFF
            | (uint32)((uint32)1U << 3U )   //VCLK2 OFF
            | (uint32)((uint32)1U << 4U )   //AVCLK 1 OFF
            | (uint32)((uint32)1U << 5U )   //AVCLK 2 OFF
            | (uint32)((uint32)1U << 8U )   //VCLK3 OFF
            | (uint32)((uint32)1U << 9U )   //VCLK4 OFF
            | (uint32)((uint32)1U << 11U);  //AVCLK 4 OFF

            systemREG1->CSDIS = (uint32)((uint32)1U << 1U)      // OSCIN is enabled
            |(uint32)((uint32)1U << 3U)
            |(uint32)((uint32)1U << 4U)
            |(uint32)((uint32)1U << 5U)
            |(uint32)((uint32)1U << 6U)
            |(uint32)((uint32)1U << 7U);


            //Idle the Cortex-R4 core
            asm( " NOP");
            asm( " NOP");
            asm( " NOP");

            asm( " WFI"); //Wait For Interrupt (WFI) instruction
            asm( " NOP"); //after wake-up, will start from this line
            asm( " NOP");
            asm( " NOP");
            asm( " NOP");
            asm( " NOP");
            asm( " NOP");

I am not sure if everything is ok. What is the power counsumption in low power mode? Shouldn't it be less than ~75mA?

I suppose it should wake up after 10ces (RTI) but it does not work... Could you help me please?

  • Hi Timm,

    The 75mA is too much for the low power mode. You can use ECLK to check the VCLK to make sure the device is in low power mode.

    Please define the wakeup clock source in GHVSRC register.

    Can you wakeup the device using GIO interrupt, SCI or CAN mesage?
  • Hi QJ,

    Thanks for reply.

    I checked ECLK and after the part of my code where I disable clocks domain and clocks sources, clock on the ECLK pin is also gone. So it seems that it is not a problem with turning clocks off.

    When I debug program (using CCS), after turning off clock domains and clock sources in I have get this message:

    Maybe the problem is in the 'flash memory part'. 

            /* flash memory */
            flashWREG->FBAC = (0x0F << 8) | (0x0F);
            flashWREG->FBFALLBACK = 0x00000000U
            | (uint32)((uint32)SYS_SLEEP<< 14U)     /* BANK 7 */
            | (uint32)((uint32)SYS_SLEEP << 2U)     /* BANK 1 */
            | (uint32)((uint32)SYS_SLEEP << 0U);    /* BANK 0 */
            flashWREG->FPAC1 = 0x00000000U;         /* take the pump to sleep */

    After this part, registers looks like this:

    FBnkAcc 00000000000000000000111100001111b (Binary) Bank Access Control Register
    FBnkFallback 00000000000000000011111111111100b (Binary) Bank Fallback Power Register
    FPmpAcc1 00000000000000000000000000000000b (Binary) Pump Access Control Register 1
    FPmpAcc2 00000000000000000000000000000000b (Binary) Pump Access Control Register 2

    I would like to turn off all banks (0, 1 , 7) but it looks like bank 1 is still in active mode... (look at FBnkFallback)...


    I have try to wake up from my this state (~75mA for LaunchPad board) in two ways:
    Firstly, using RTI:         vimREG->WAKEMASKSET0 = 0x00000002; // I suppose it should use RT interrupt (10sec), vim 2 as wake up interrupt.
    Secondly, using GIB interrupt:         vimREG->WAKEMASKSET0 = 0x00000017; //  // GIO vim 23 --> hex 0x17, using button available on board...
    Both methods do not work. Maybe I've missed something.

  • Update:
    I looks like there is no problem with FBnkFallback register. I had some doubts, because I thougt that there were 3 flash banks on board (0, 1, 7), but there are only 2 banks (0, 7). There is difference between TRG and datasheet for TMS570LS1224.

    I still have not found solution.
    I tried to change WAKEMASKSET0 to 0xFFFFFFFF but still it cant wake up. Any ideas what should I do more besides setup this register?

  • Hello Timm,

    Please try this:

    flashWREG->FBAC = (0x10 << 16) | (0x0F << 8) | (0x0F);
    flashWREG->FPAC2 = 0x0;
    flashWREG->FBFALLBACK = 0; // Take Bank 0 and 1 to sleep mode
    flashWREG->FPAC1 = 0; // Take Pump to Sleep
  • Hi QJ,
    I tried your code but nothing has changed.
    Flash Registers (FBAC, FBFALLBACK, FPAC1, FPAC2) after this part of code have the same value as before:

    FBnkAcc 00000000000000000000111100001111b (Binary) Bank Access Control Register [Memory Mapped]
    FBnkFallback 00000000000000000011111111111100b (Binary) Bank Fallback Power Register [Memory Mapped]
    FPmpAcc1 00000000000000000000000000000000b (Binary) Pump Access Control Register 1 [Memory Mapped]
    FPmpAcc2 00000000000000000000000000000000b (Binary) Pump Access Control Register 2 [Memory Mapped]

    As I wrote in the first post, after my 'go sleep' code power consumption is reduced to ~75mA. You suggest it is too much for low power mode. But this value applies to the whole PCB (LAUNCHXL2-TMS57012). In addition to TMS570, there is also e.g. TM4C129ENCPDT onboard.

    I am still not 100% sure, but I am think that I am in low power mode... but I can't back to normal operation...
    If I understand, I should only specify 'wake-up mask' (vimREG->WAKEMASKSET0). In my test application, I am using RTI Compare 0 for LED blinking. My 'wake-up mask' is being set to 0x2. During 'go_sleep' code I am turning off all clocks except RTI (and OSCIN source). Should the TMS570 wake up after the next RTI interruption? Or should I do something more?

  • Hello Timm,

    I thought that your code is for doze low power mode rather than sleep-mode. In your configuration, the RTI clock and OSCIN are active.

    Sorry, I just noticed that there is another active MCU (TM4C129x) on your PCB. 75mA is not consumed by TMS570 only, but the whole PCB. It make sense to me.

    For Doze lower power mode, the device can be waked up by RTI interrupt. 

    Before entering the lower power mode, please enable the RTI compare INT notification and enable the CPU interrupt, then start RTI counter:

    rtiInit();

    gioInit();

    _enable_IRQ();

    //Wakeup Interrupt: GIO and CAN1
    vimREG->WAKEMASKSET0 = 0x0 | 0x02  
                                                      | (0x1 << 9); //GIOA0/1 INT

    rtiSetPeriod(rtiCOMPARE0, 100000);

    rtiEnableNotification(rtiNOTIFICATION_COMPARE0);

    /* Start RTI Counter Block 0 */
    rtiStartCounter(rtiCOUNTER_BLOCK0);

  • QJ,

    I know that I should launch rti part. In my code I enabled RTI compare and CPU interrupt on the beginning. It is in the initialization part of my code.

    My test application work like this:

    1. Blinking led (once every 10sec) // rti counter ---> this part works well
    2. Button press starts the low power mode // in gio notification I set flag (code is executed in main() ) ----> this part works well too. (power consumption for launchpad board drops by ~60mA and clock on ELCK disappears)
    3. .... and then I should wait for the next rti compare notification, but I am waiting few minutes and and nothing happens (power consumption is still on the low level, LED is not blinking any more and I do not see any clock on my oscilocsope (ECLK). It looks like I cannot wake-up...

    Do you have access to LAUNCHXL2-TMS57012? Is it possible to send my code to you to verify where is the problem?
    Or maybe someone else could help?

  • Hello Michal,

    Yes, I have a launchpad. I can do test with your code for you.
  • QJ,
    How can I send to you my code?

    edit. I have just send an email.

  • QJ,
    Did you tried my code on LAUNCHXL2-TMS57012?
  • Hi Timm,

    I tested. The test passed when the memory built-in selftest is disabled. I will post the project to the friend's message, and close this thread.