How to reduce Power with Testboard XMC1100 for Arduino - Sleeping/Wake Mode‏

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Dear Community,

I am using the following function to save power consumption with my Infineon Test-Board "XMC1100 for Arduino" (http://www.infineon.com/dgdl/Board_Users_Manual_XMC1100_CPU_Card_R2.pdf?fileId=db3a30433da119ff013da...).
The Program is suppose to do the following 2 main actions continously non stop:
a) Send Current_Time for 10 Seconds long
b) After Sleep 47 Seconds (_WFE) ....

I am expecting a significant power consumption reduction within the sleeping Phase.
The program is working very well, but the power consumtion is unfortunately not significantly reduce
Here are my observations:
Observation1: Program is compiled and running well using DAVE DAVE-3.1.10
Observation2: Power Consumption in the WAKEUP Phase (10 Seconds)--> ~ 102mA
Observation3: Power Consumption in the SLEEPING Phase (47 Seconds)--> ~ 98mA
Observation4: Some LEDS are still on, although it is 47 Seconds sleeping
Observation5: When i am reducing the CPU-Takt-Frequency from 32 MHz to 1 MHz, the Power consumption is still about 98 mA

Here are my questions:

Question1: Why is the power consumption so high (~98mA), although the processor is suppose to sleep. I was expecting according to the specification XMC1100 a power <1mA in the sleeping phase?
Question2: How can i adapt the program to reduce the power consumptin in the sleeping Phase significantly (<=1mA)?
Question3: Is the Command __WFE correct? Do I Need additional commands?
Question4: Why is it not possible to automatically wake up by using the Command __WFI ?
Question5: How to power down the XMC1100-periphere (e.g. LED) for Power Saving in the Sleeping Phase?
Question6: why is the power consumption only decreasing from 102 mA to 98 mA even when the Takt-Frequency of CPU-Clock is set to 1 MHz as well as 0.5MHz (instead of 32 MHz)?

Thanks a lot for your support!


Best Regards,

Guy Kouemou

Here is the Test-Code:

/* =========================================================================== *
Author Guy Kouemou, Germany July 2015
//===============================================================================
Test-Program for XMC1100 Infineon Processor Wake UP and Sleep Function
The following Program uses the Real Time Club to alternate between
10 Seconds Wake UP
47 Seconds Sleep
IN the Sleeping Phase a considerable Power Consumtion Reduction Should Happen

void rtc_interrupt(uint32_t CbArg)
{
char msg_buff[80];
char Outbuf1[80]={0};
char Outbuf2[80]={0};
int Awake_Time_In_Seconds=10;
/* data structure to store the current time value */
RTC001_TimeHandle current_time;
// Read the current time
RTC001_Clock_GetTime(&current_time);
//======================================================================================================================
// Write the Data only within Awake_Time_In_Seconds e.g. 10 Seconds
if(current_time.Sec <= Awake_Time_In_Seconds)
{
sprintf(Outbuf1, "XMC1100 Processor is Awake 10 Seconds!!!\r\n");
uart_printf(Outbuf1);
sprintf(msg_buff,"Date(d-m-y):%d-%d-%d,Time %0d:%0d:%0d\r\n",current_time.Days, current_time.Month, current_time.Year, current_time.Hours,current_time.Min,current_time.Sec);
//Send the data
//uart_printf(msg_buff);
uart_printf(msg_buff);
}
//=======================================================================================================================
//================================================================================================
if((current_time.Sec >= Awake_Time_In_Seconds)&&(current_time.Sec <= Awake_Time_In_Seconds+1))
{
sprintf(Outbuf2, "XMC1100 Processor is Sleeping 47 Seconds=========>>>>>> GOSLEEP for 47 Seconds!!!\r\n");
uart_printf(Outbuf2);
}
//=============================================================================================
if((current_time.Sec > Awake_Time_In_Seconds)&&(current_time.Sec < Awake_Time_In_Seconds+47))
{
// Only for test
//sprintf(msg_buff,"Date(d-m-y):%d-%d-%d,Time %0d:%0d:%0d\r\n",current_time.Days, current_time.Month, current_time.Year, current_time.Hours,current_time.Min,current_time.Sec);
//uart_printf(msg_buff);
//================================================================================================
//Begin Sleeping XMC1100 Processor Sleeping Phase
//================================================================================================

volatile u32 idiv = 1;
// __disable_irq(); //disable all interrupts
// SCU_GENERAL->PASSWD = CLK002_DIRECT_ACCESS_ALLOW; // Open the lock that protects privileged bits.
// while(((SCU_GENERAL->PASSWD)&SCU_GENERAL_PASSWD_PROTS_Msk)); // Loop until protection is removed.
//SCU_CLK->CLKCR |= 0x3ff00000UL; // CNTADJ = 0x3ff, For VDDC monitoring
//PPB->SCR |= PPB_SCR_SLEEPDEEP_Msk; // Setup for Deep Sleep instead of normal sleep
PPB->SCR |= PPB_SCR_SLEEPONEXIT_Msk; // Setup for Deep Sleep normal sleep
//PPB->SCR |= PPB_SCR_SEVONPEND_Msk; // Setup for Deep Sleep normal sleep
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
SCU_CLK->CGATSET0 = 0x07FFUL; // Gate Off all peripherals
WR_REG(SCU_CLK->CLKCR, SCU_CLK_CLKCR_CNTADJ_Msk, SCU_CLK_CLKCR_CNTADJ_Pos,(0x3FFU));
while ((SCU_CLK->CLKCR) & 0xC0000000UL); // Wait for VDDC to stabilize
// Ramp down Frequency
idiv = (SCU_CLK->CLKCR & SCU_CLK_CLKCR_IDIV_Msk)>>SCU_CLK_CLKCR_IDIV_Pos;
while (idiv < 255)//while (idiv < 255)
{
idiv = idiv << 2;
if (idiv > 255)//if (idiv > 255)
idiv = 255;//idiv = 255;
WR_REG(SCU_CLK->CLKCR, SCU_CLK_CLKCR_IDIV_Msk, SCU_CLK_CLKCR_IDIV_Pos, idiv);
WR_REG(SCU_CLK->CLKCR, SCU_CLK_CLKCR_CNTADJ_Msk, SCU_CLK_CLKCR_CNTADJ_Pos,(0x3FFU));
while ((SCU_CLK->CLKCR) & 0xC0000000UL); // Wait for VDDC to stabilize
}

// Step Down PCLK to equal MCKL, set RTC to internal clock
SCU_CLK->CLKCR = 0x3ff0FFFFUL; // CNTADJ = 0x3ff, MCLK = PCLK = 125kHz
while ((SCU_CLK->CLKCR) & 0xC0000000UL); // Wait for VDDC to stabilize
SCU_CLK->PWRSVCR |= SCU_CLK_PWRSVCR_FPD_Msk; // make sure flash powers down during deep sleep
// SCU_GENERAL->PASSWD = CLK002_DIRECT_ACCESS_DISALLOW; // Close the lock opened above.

__WFE(); // Execute
// __WFI(); // Go To Deep Sleep
//=======================================================================================================================
}

}
/* @brief User defined function for Alarm interrupt
* This function will send the alarm time to PC Hyper Terminal
*
* @param[in]: CbArg
* @return : void
* */
void Alarm_Interrupt(uint32_t CbArg)
{
/* data structure to store the alarm time value */
RTC001_TimeHandle current_time;
RTC001_Clock_GetTime(&current_time);
char msg_buff2[120];
sprintf(msg_buff2,"*************************\r\nAlarm Time to Wake UP!!!:\r\nDate(d-m-y):%d-%d-%d,Time %0d:%0d:%0d\r\n*****************************\r\n",current_time.Days, current_time.Month, current_time.Year, current_time.Hours,current_time.Min,current_time.Sec);
uart_printf(msg_buff2);
current_time.Min++;
if(current_time.Min > 59)
current_time.Min = 0;
//Reconfigure alarm time for next minute
RTC001_ConfigAlarm(&RTC001_Handle,&current_time,Alarm_Interrupt,0);
}
0 Likes
0 Replies