Skip to main content
Visitor II
October 12, 2006
Question

SRAM low power mode

  • October 12, 2006
  • 2 replies
  • 824 views
Posted on October 12, 2006 at 06:14

SRAM low power mode

    This topic has been closed for replies.

    2 replies

    ebarkerAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    I have a Keil MCBSTR912 board and a REVA STR912 board and am having the same problem on both.

    I hook a battery to the processor VBATT pin, and remove the power from the board. When you hook power back up, it reboots and clears the memory variables when I think it shouldn't.

    So it doesn't look like the VBATT SRAM thing is working. Any suggestions ??

    #include ''91x_lib.h''

    #include ''main.h''

    GPIO_InitTypeDef GPIO_InitStructure;

    static unsigned char display_byte;

    static int delaycnt;

    int main()

    {

    // //////////////////////////////////////////////////////////////////////////////////////////////////////

    SCU_APBPeriphClockConfig(__GPIO7, ENABLE);

    // GPIO7 goes to the LEDs

    GPIO_DeInit(GPIO7);

    GPIO_StructInit(&GPIO_InitStructure);

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;

    GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;

    GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

    GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable;

    GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1;

    GPIO_Init(GPIO7, &GPIO_InitStructure);

    // //////////////////////////////////////////////////////////////////////////////////////////////////////

    SCU_APBPeriphClockConfig(__RTC,ENABLE);

    RTC_DeInit();

    RTC_SRAMBattPowerCmd(ENABLE);

    // //////////////////////////////////////////////////////////////////////////////////////////////////////

    while (1)

    {

    for (delaycnt = 0; delaycnt < 500000; delaycnt++); // sleep

    GPIO_Write(GPIO7, display_byte++);

    }

    }

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hi,

    Check if the compiler initialize the ram.

    I'm using IAR. In the init code the allocated memory is filled with 0

    if the variable is not initilized.

    I think that your variables are zeroed during the init sequence.