AnsweredAssumed Answered

CM40x does not enter deep sleep mode

Question asked by Mack on Feb 15, 2015
Latest reply on Apr 13, 2015 by Prashant

Hello,

 

To reduce power consumption, I need deep sleep mode.

I have tried to enter deep sleep mode. CM408 seems not to go into deep sleep mode.

My target is CM408F ez-kit.

 

Below is part of my test code. Please advise me if there is something wrong in my code.

 

void main(void)
{
  int i;
  ADI_PWR_RESULT result;
 
  adi_initComponents();

  power_init();
 
  ConfigSoftSwitches();
 
  *pREG_PORTE_DIR = (ADI_GPIO_PIN_6 | ADI_GPIO_PIN_7);
  *pREG_PORTE_DATA_SET = ADI_GPIO_PIN_6;
  
  while(1){
    result = adi_pwr_SetPowerMode(ADI_PWR_MODE_FULL_ON);
    result = adi_pwr_SetFreq(CORE_MAX/2, SYSCLK_MAX/2);
   
    *pREG_PORTE_DATA_SET     = ADI_GPIO_PIN_6;
    *pREG_PORTE_DATA_CLR     = ADI_GPIO_PIN_7;
   
    for(i=0;i<10;i++){
       *pREG_PORTE_DATA_TGL = ADI_GPIO_PIN_6 | ADI_GPIO_PIN_7;
       delay(1000000);
       delay(1000000);
    }
   
    result = adi_pwr_SetPowerMode(ADI_PWR_MODE_ACTIVE);
    for(i=0;i<4;i++){
      *pREG_PORTE_DATA_TGL = ADI_GPIO_PIN_6 | ADI_GPIO_PIN_7;
       delay(1000000);
       delay(1000000);
    }
   
    *pREG_DPM0_CTL = *pREG_DPM0_CTL | 0x04;

    *pREG_PORTE_DATA_SET     = ADI_GPIO_PIN_6 | ADI_GPIO_PIN_7;
    for(i=0;i<10;i++){
      *pREG_PORTE_DATA_TGL = ADI_GPIO_PIN_6 | ADI_GPIO_PIN_7;
       delay(500000);
       delay(500000);
    }
   
    for(i=0;i<10;i++) delay(1000000);

 

/*-------------  Deep sleep mode  ---------------*/
   
    while(*pREG_CGU0_STAT & 0x1);
    *pREG_DPM0_WAKE_POL = 0x08;
    *pREG_DPM0_WAKE_EN = 0x08;
     
    *pREG_DPM0_CTL = *pREG_DPM0_CTL | 0x08;
   __no_operation();
  
/*------------------------------------------------*/
  
  };
}

 

Best Regards,

Mack

Attachments

Outcomes