Skip to main content
Visitor II
August 16, 2006
Question

USB suspend mode

  • August 16, 2006
  • 2 replies
  • 861 views
Posted on August 16, 2006 at 14:58

USB suspend mode

    This topic has been closed for replies.

    2 replies

    Visitor II
    August 11, 2006
    Posted on August 11, 2006 at 14:42

    Hi all,

    do you know if there's an issue, i just would like to respect USB standard during suspend mode and draw less than 500µA.

    So in ''usb_pwr.c'' (in Suspend() and Resume()) I can handle power management and clock source .

    I would like to stop external oscillator by gpio, go in low power mode (ie. LPWFI or STOP) without RTC 32kHz quartz on board (maybe I should add it), and I would like to be wakeup by USB (XTI line 1).

    I wonder what does it mean the Free Running Pll, but it seems to be my last chance (see attached picture).

    Although there is no FreeRunningClock in SlowClock_Typedef:

    void LPWFI(SlowClock_Typedef clock,FunctionalState VRstate)

    in advance thx.

    ________________

    Attachments :

    an2100page10.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtTE&d=%2Fa%2F0X0000000aQQ%2F2XFBVMt_L4pykeUn2.awJElmLQFvgXPfhGeqDQ_qzVU&asPdf=false
    Visitor II
    August 16, 2006
    Posted on August 16, 2006 at 14:58

    I found in last release of USB lib. some info, but not sure of it.

    In USB_PWR.c during suspend a function call to Enter_LowPowerMode

    and during resume_init a function call to Leave_LowPowerMode.

    I've tried it but nothing happened, the micro don't got any clock.

    void Enter_LowPowerMode(void)

    {

    /* RCCU->CCR |= RCCU_CKAF_SEL_Mask;

    RCCU->CFR &=~0x1; //PLL not sys clock

    RCCU->PLL1CR &=~0x80; //Free running off

    GPIO_Config(GPIO0,0x4010,GPIO_OUT_PP);

    GPIO_Config(GPIO1,0x8400,GPIO_OUT_PP);

    GPIO_WordWrite(GPIO0,0x0);

    FLASHR->CR0|=0x8000; //disable the flash during the LPWFI

    PCU->PWRCR |=0x8000; //disable MVR during WFI mode

    PCU->PWRCR |=0x0010;

    RCCU->CCR |=0x2; //select the 32KHz as peripherl clock during LPWFI

    RCCU->CCR |=0x1;

    GPIO_Config (GPIO0, 0x1000,GPIO_HI_AIN_TRI); //Disable External oscillator P0.12

    RCCU->SMR &=0xFE; // enter LPWFI*/

    }

    void Leave_LowPowerMode(void)

    {

    /* GPIO_BitWrite(GPIO0,12,0); */ /*Enable External oscillator*/

    /* GPIO_Config(GPIO0,0x1000,GPIO_OUT_PP);

    Set_System();

    Set_USBClock();*/

    }