We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
How are you sure that the data was correctly stored in the first place?
Reply
Unsigned int Store_Data; Store_Data = BSR_Data1 ;
And Reading it as BSR_Data1 = Store_Data ;
By doing this I can read/write the first data alone correct ?
for consecutive data I will use like this
Store_next_data = BSR_Data2;
And read it as BSR_Data2 = Store_next_data;
is this the correct method ??
Is this the correct way of pointing data to Battery RAM .
How do I write/read a complete structure of each 32 bit data on to the Battery RAM ?
Thanks in advance
How to check whether variables stored in first place ??
The method of storing/reading my word-wise data is this correct ?
Guys can you Please help me on this issue as soon as possible.
Regards, Samjith
If BSR_Data1 is a variable in the battery-backed memory, then this is a write, and not a read:
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?
since you do not state clock speed or type if BBRAM, is the write/read timing slow enough to satisfy the requirements of the BBRAM?
This has come up before in other contexts.
Erik
Note that the NXP LPC2368 has internal 2kB battery-backed RAM (if external power is applied to the dedicated supply pin)
Have you checked the voltage of the battery?
Guys Thanks a ton ,
I just checked by Bat Voltage and found to be drained ..
I will come back after checking it with in a day or two.