infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 4 of 4

Thread: XMC1302 Low Power Modes

  1. #1
    New Member New Member Elzaar is on a distinguished road
    Join Date
    Apr 2018
    Posts
    3
    Points
    40

    XMC1302 Low Power Modes

    Hi,
    I build an QR Flyback with an XMC1302 but I need reduce the power consumption as far as possible during startup.
    The Aux Cap is charged by a current source (~15mA), but im not able to get lower then ~4mA.

    What i woud like to do is:
    1. Startup:
    scale down clock to 100kHz <-> 1MHz
    setup timer to generate an wakeup isr after 5 <-> 25 ms
    go to deep sleep

    2. Sleep Loop
    start ADC, check Aux Voltage
    Vaux > Setvalue ? Running : Sleep Loop

    3. Running
    scale up clock to 32MHz / 64MHz
    Init peripheral
    start Flyback (softstart)

    Running mode is working just fine, control loop, light load / full load jumps, vally skipping, etc.

    To check the power consumption i use this test code
    Code:
    int main(void){
      uint32_t TimerId_SysTick_1s;
      uint32_t TimerId_SysTick_10ms;
      uint32_t timer_status;
      DAVE_STATUS_t status;
    
      //pre Init IO for Debugging
      DIGITAL_IO_Init(&POWERLINE_MODUL_EN_pin);
      DIGITAL_IO_SetOutputHigh(&POWERLINE_MODUL_EN_pin);
    
      //init cpu Clock
      CLOCK_XMC1_Init(&CLOCK_XMC1_0);
    
      //gate every peripheral by API
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_VADC);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_CCU80);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_CCU40);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_USIC0);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_BCCU0);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_POSIF0);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_MATH);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_WDT);
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_RTC);
    
      //gate every peripheral by Reg
      SCU_CLK->CGATSET0 = 0x07FFUL;		                        // Gate Off all peripherals
      WR_REG(SCU_CLK->CLKCR, SCU_CLK_CLKCR_CNTADJ_Msk, SCU_CLK_CLKCR_CNTADJ_Pos,(0x3FFU));
    
    
      COMPARATOR->ANACMP0 |= COMPARATOR_ANACMP0_CMP_LPWR_Msk;	// Put Comparator into low power mode
      COMPARATOR->ANACMP0 &= ~(COMPARATOR_ANACMP0_CMP_EN_Msk);	// Disable ACMP0
      COMPARATOR->ANACMP1 &= ~(COMPARATOR_ANACMP1_CMP_EN_Msk);	// Disable ACMP1
      COMPARATOR->ANACMP2 &= ~(COMPARATOR_ANACMP2_CMP_EN_Msk);	// Disable ACMP2
    
      //reduce peripheral Clock
      XMC_SCU_CLOCK_SetFastPeripheralClockSource(XMC_SCU_CLOCK_PCLKSRC_MCLK);
    
      //scale down cpu clock
      CLOCK_XMC1_SetMCLKFrequency(125);
    
      SCU_CLK->PWRSVCR |= SCU_CLK_PWRSVCR_FPD_Msk;		         // make sure flash powers down during deep sleep
      PPB->SCR |= PPB_SCR_SLEEPDEEP_Msk;		                 // Setup for Deep Sleep instead of normal sleep
    
      __disable_irq();   				                 //disable all interrupts
    
      //debugging
      DIGITAL_IO_SetOutputLow(&POWERLINE_MODUL_EN_pin);
    
      while(1){
        if(sleep_en){
          __WFI();
        }
        DIGITAL_IO_ToggleOutput(&POWERLINE_MODUL_EN_pin);
      }
    
    
    //======================================================================
    //============= Running Mode 
    //======================================================================
    
      status = DAVE_Init();           /* Initialization of DAVE APPs  */
    
      if(status != DAVE_STATUS_SUCCESS){
        XMC_DEBUG("DAVE APPs initialization failed\n");
        while(1U){}
      }
    
      NetzPLL_Init();								//init Mains PLL
      NetzMonitor_Init();							//init Mains Monitor
      Fly_Control(1); 								//init Flyback
    Click image for larger version

Name:	startup_debugging.png
Views:	6
Size:	51.9 KB
ID:	3545

    How can i further reduce the current consumtion? Or where is my misstake?

    Thanks a lot for your support!

    Best Regards,
    Sascha
    Last edited by Elzaar; Jul 26th, 2018 at 02:28 AM.

  2. #2
    New Member New Member Elzaar is on a distinguished road
    Join Date
    Apr 2018
    Posts
    3
    Points
    40
    Good Morning,
    to make the question more simpel.
    What do i have to do to put the uC into the deepest sleep mode?

  3. #3

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    377
    Hi,

    The following code places the device in the lowest power mode (~250uA according to data sheet)
    Code:
      // The clock of the peripherals that are not needed during sleep state can be gated before entering sleep state
      XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_MATH);
    
      // Enable FLASH power down during SLEEP and DEEPSLEEP mode
      XMC_SCU_CLOCK_EnableFlashPowerDown();
    
      // Make sure that SLEEPDEEP bit is set
      SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
    
      // Return to SLEEP mode after handling the wakeup event
      SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk;
    
      // in deep-sleep state, the PCLK and MCLK will
      // be switched to a slow standby clock and DCO1 will be put into power-down mode
      // It is recommended to slow down the PCLK and MCLK before entering deep sleep
      // mode to prevent a sudden load change that could cause a brownout reset.
      XMC_SCU_CLOCK_SetFastPeripheralClockSource(XMC_SCU_CLOCK_PCLKSRC_MCLK);
      XMC_SCU_CLOCK_SetMCLKFrequency(125);
    
      /* Placeholder for user application code. The while loop below can be replaced with user application code. */
      while(1U)
      {
    	// Put system in DEEPSLEEP state
    	__WFI();
      }
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  4. #4
    New Member New Member Elzaar is on a distinguished road
    Join Date
    Apr 2018
    Posts
    3
    Points
    40
    Hi, and thanks for your help.
    I found the main issu ... they placed the alternativ LDO and not the low power LDO.

    What woud be the best wakeup source to generate a 10ms wackup tick?
    - RTC (min sleep time 1s or am i wrong?)
    - CCU4 Slice
    - CCU8 Slice (needs more power then CCU4)
    - PIN IRQ on the aux voltage feed back pin?
    - System Timer (no running in deepsleep mode?)

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.