Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

XMC1302 Low Power Modes

$
0
0
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

Attachment 3545

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

Thanks a lot for your support!

Best Regards,
Sascha
?????

Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>