This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Battery RAM

Controller : LPC2368(ARM 7)

Issue : Battery RAM values not storing . Junk values getting stored on it.

Hi People ,

I am using LPC2368 (ARM7) . I am facing the following issue with the
Battery backup RAM .

My Pclk for Battery backup RAM is Pclk = Cclk / 4 ;

And I am storing data as shown below


#define BATTERY_RAM_BASE_ADDRESS 0xE0084000

/* ALLOCATION */

#define BSR_Data1 (*(volatile unsigned
long*)(BATTERY_RAM_BASE_ADDRESS 0x000))
#define BSR_Data2 (*(volatile unsigned long
*)(BATTERY_RAM_BASE_ADDRESS + 0x004))
#define BSR_Data3 (*(volatile unsigned long
*)(BATTERY_RAM_BASE_ADDRESS + 0x008))

As Static Battery RAM can be accessed only word-wise(32bit only)

Note : The Battery RAM is a 2 kbyte static RAM residing on the APB bus.
The address range is
0xE008 4000 to 0xE008 47FF. The SRAM can be accessed word-wise (32-bit)
only.

And I store it as ,


Unsigned int Store_Data;

Store_Data = BSR_Data1 ;

And Reading it as

BSR_Data1 = Store_Data ;

Is this the Correct way ?

Because after a day all the data that I store is getting erased.

Thanks in advance, Pls help me out guys on this issue.

Regards,
Samjith Wasim . A

Parents
  • If BSR_Data1 is a variable in the battery-backed memory, then this is a write, and not a read:

    And Reading it as
    
    BSR_Data1 = Store_Data ;
    

    To test if the memory works, you should write a significant amount of data - together with a checksum, CRC or similar, and then power off the unit and wait for a while. Then power up and read out the values - the checksum should still be correct.

    Have you remembered to connect the VBAT signal to a battery or super-cap?

Reply
  • If BSR_Data1 is a variable in the battery-backed memory, then this is a write, and not a read:

    And Reading it as
    
    BSR_Data1 = Store_Data ;
    

    To test if the memory works, you should write a significant amount of data - together with a checksum, CRC or similar, and then power off the unit and wait for a while. Then power up and read out the values - the checksum should still be correct.

    Have you remembered to connect the VBAT signal to a battery or super-cap?

Children