Sign in

Not a member? | Forgot your Password?

Search rabbit-semi

Search tips

Subscribe to rabbit-semi

Free PDF Downloads

Advanced Linux Programming

What Every Programmer Should Know About Memory

Introduction to Embedded Systems

C++ Tutorial

Embedded Systems - Theory and Design Methodology

Microcontroller Programming and Interfacing

Introduction to Microcontrollers


More Free PDF Downloads

Discussion Groups

See Also

ElectronicsDSPFPGA

Discussion Groups | Rabbit-Semi | 3.3 V-- Battery-Back up for Static RAM in RCM3010?

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

3.3 V-- Battery-Back up for Static RAM in RCM3010? - pra_shant3000 - May 11 14:06:00 2005

Hi Friends,

Is there any 3.3V battery backup facility for SRAM of RCM3010?
I think, 3.3V battery backup is only available for RTC, in RCM3010.
I need a RCM module with battery backed facility for SRAM.
Please, tell me ,such RCM modules with 3.3V battery backup for
both SRAM & RTC. Also tell me ,what extra hardware & control signals
are required to give a battery back up for SRAM & RTC.

With regards,

Prashant.




_____________________________
 Free pdf download: What Every Programmer Should Know About Memory.


Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Mike van Meeteren - May 11 14:21:00 2005

At 06:06 PM 5/11/2005 +0000, you wrote:
>
>Hi Friends,
>
> Is there any 3.3V battery backup facility for SRAM of RCM3010?
>I think, 3.3V battery backup is only available for RTC, in RCM3010.
>I need a RCM module with battery backed facility for SRAM.
> Please, tell me ,such RCM modules with 3.3V battery backup for
>both SRAM & RTC. Also tell me ,what extra hardware & control signals
>are required to give a battery back up for SRAM & RTC.

3010 has battery backed ram, I use it. Only hardware you need is a 3v
battery, holder, and 1.4K resistor, hooked to the VBAT_EXT pin on the core
module.




Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Geoff Swan - May 11 17:17:00 2005

Mike van Meeteren wrote:
> At 06:06 PM 5/11/2005 +0000, you wrote:
> >
> >Hi Friends,
> >
> > Is there any 3.3V battery backup facility for SRAM of RCM3010?
> >I think, 3.3V battery backup is only available for RTC, in RCM3010.
> >I need a RCM module with battery backed facility for SRAM.
> > Please, tell me ,such RCM modules with 3.3V battery backup for
> >both SRAM & RTC. Also tell me ,what extra hardware & control signals
> >are required to give a battery back up for SRAM & RTC.
>
> 3010 has battery backed ram, I use it. Only hardware you need is a 3v
> battery, holder, and 1.4K resistor, hooked to the VBAT_EXT pin on the core
> module.
>

What's the 1.4K resistor for?




_____________________________
 Free pdf download: Advanced Linux Programming.


Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Mike van Meeteren - May 11 17:32:00 2005

At 07:17 AM 5/12/2005 +1000, you wrote:
>What's the 1.4K resistor for?

Not sure, but they put one on the development boards. I've put one on
every board I've ever designed. I suppose it could be to current limit it,
I don't know. It makes a convenient place to measure current draw though
(although you do need a GOOD multimeter for that).

-Mike




Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Ross Lyn - May 11 17:40:00 2005

I think it is good design practice with lithium batteries to always have a
current limit resistor in series as close to the battery as possible. That
way a board short is less likely to result in exploding lithium. I know
most lithium batteries have sufficient internal impedance to stop this
happening, but I have worked with some hi energy types that could self
ignite. Once burning these things can combust for hours, even under water!

-----Original Message-----
From: rabbit-semi@rabb... [mailto:rabbit-semi@rabb...] On
Behalf Of Mike van Meeteren
Sent: Thursday, 12 May 2005 9:32 a.m.
To: rabbit-semi@rabb...
Subject: Re: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in
RCM3010?

At 07:17 AM 5/12/2005 +1000, you wrote:
>What's the 1.4K resistor for?

Not sure, but they put one on the development boards. I've put one on every
board I've ever designed. I suppose it could be to current limit it, I
don't know. It makes a convenient place to measure current draw though
(although you do need a GOOD multimeter for that).

-Mike

Yahoo! Groups Links
-- --
--
--



_____________________________
 Free pdf download: Advanced Linux Programming.


Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Geoff Swan - May 11 17:52:00 2005

Mike van Meeteren wrote:

> At 07:17 AM 5/12/2005 +1000, you wrote:
> >What's the 1.4K resistor for?
>
> Not sure, but they put one on the development boards. I've put one on
> every board I've ever designed. I suppose it could be to current limit it,
> I don't know. It makes a convenient place to measure current draw though
> (although you do need a GOOD multimeter for that).
>
> -Mike
>

In other words it's not really needed.
I've used a 100R resistor for current limiting in the case where the RCM
fails and shorts the battery. 1.4k seems high.




Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Andy - May 12 5:31:00 2005

Hi All,

I have been following this subject with interest. I have been trying to
get the SRAM on RCM3300 to retain its content when the power is
switched off.

I am using RCM3300 prototyping board for development, which already has
a battery connected to the VBAT-EXT pin on the RCM3300 module. The
battery is 3.0 V.

In my software I used protected keyword when declaring variables that I
want to back-up. However, the SRAM seems to lose its content when I
unplugged the power. The RTC seems to retain the time, when power is
removed.

I attached sample test code below. What did I do wrong?

********************************************************************

#use rcm33xx.lib

protected char nvram[16];
protected char ch;

main()
{
unsigned long Clock;
struct tm Time;

brdInit();

_sysIsSoftReset();

printf( "Content of nvram after power-up: %s\n", nvram );
printf( "Content ch after power-up: %d\n", ch );

ch = 123;
strcpy( nvram, "New content");

printf( "Content of nvram: %s\n", nvram );
printf( "Content of ch: %d\n", ch );

while(1){
costate{
// wait 1 second before displaying time
waitfor( DelaySec( 1 ) ) ;

Clock = read_rtc();
mktm( &Time, Clock );

printf( "Time: %02d:%02d:%02d\n", Time.tm_hour,
Time.tm_min, Time.tm_sec );
}
}
}

**************************************************************** --- Mike van Meeteren <mike@mike...> wrote:
> At 06:06 PM 5/11/2005 +0000, you wrote:
> >
> >Hi Friends,
> >
> > Is there any 3.3V battery backup facility for SRAM of RCM3010?
> >I think, 3.3V battery backup is only available for RTC, in RCM3010.
> >I need a RCM module with battery backed facility for SRAM.
> > Please, tell me ,such RCM modules with 3.3V battery backup for
> >both SRAM & RTC. Also tell me ,what extra hardware & control
> signals
> >are required to give a battery back up for SRAM & RTC.
>
> 3010 has battery backed ram, I use it. Only hardware you need is a
> 3v
> battery, holder, and 1.4K resistor, hooked to the VBAT_EXT pin on the
> core
> module.
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html




Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Geoff Swan - May 12 5:52:00 2005

Andy,

What measurement do you get for the voltage on the RCM3300 module from
the battery when the power is switched off? Is your battery connected
directly to the RCM3300 vbatt pin or via a resistor?

Andy wrote:

> Hi All,
>
> I have been following this subject with interest. I have been trying to
> get the SRAM on RCM3300 to retain its content when the power is
> switched off.
>
> I am using RCM3300 prototyping board for development, which already has
> a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> battery is 3.0 V.
>
> In my software I used protected keyword when declaring variables that I
> want to back-up. However, the SRAM seems to lose its content when I
> unplugged the power. The RTC seems to retain the time, when power is
> removed.
>
> I attached sample test code below. What did I do wrong?
>
> ********************************************************************
>
> #use rcm33xx.lib
>
> protected char nvram[16];
> protected char ch;
>
> main()
> {
> unsigned long Clock;
> struct tm Time;
>
> brdInit();
>
> _sysIsSoftReset();
>
> printf( "Content of nvram after power-up: %s\n", nvram );
> printf( "Content ch after power-up: %d\n", ch );
>
> ch = 123;
> strcpy( nvram, "New content");
>
> printf( "Content of nvram: %s\n", nvram );
> printf( "Content of ch: %d\n", ch );
>
> while(1){
> costate{
> // wait 1 second before displaying time
> waitfor( DelaySec( 1 ) ) ;
>
> Clock = read_rtc();
> mktm( &Time, Clock );
>
> printf( "Time: %02d:%02d:%02d\n", Time.tm_hour,
> Time.tm_min, Time.tm_sec );
> }
> }
> }
>
> **************************************************************** > --- Mike van Meeteren <mike@mike...> wrote:
>
>>At 06:06 PM 5/11/2005 +0000, you wrote:
>> >
>> >Hi Friends,
>> >
>> > Is there any 3.3V battery backup facility for SRAM of RCM3010?
>> >I think, 3.3V battery backup is only available for RTC, in RCM3010.
>> >I need a RCM module with battery backed facility for SRAM.
>> > Please, tell me ,such RCM modules with 3.3V battery backup for
>> >both SRAM & RTC. Also tell me ,what extra hardware & control
>>signals
>> >are required to give a battery back up for SRAM & RTC.
>>
>>3010 has battery backed ram, I use it. Only hardware you need is a
>>3v
>>battery, holder, and 1.4K resistor, hooked to the VBAT_EXT pin on the
>>core
>>module.
>>
> >
>
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html >
>
> Yahoo! Groups Links >




_____________________________
 Free pdf download: Introduction to Embedded Systems.


Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Andy - May 12 6:02:00 2005

Hi Geoff,

The voltage across VBAT_EXT & GND is 3.003V when no power is connected. I am using Rabbit RCM3300 prototyping board. Looking at the schematic
http://www.zworld.com/documentation/schemat/090-0188.pdf, the battery
is connected via a 1.3K resistor.

Regards,
Andy

--- Geoff Swan <gswan3@gswa...> wrote:
> Andy,
>
> What measurement do you get for the voltage on the RCM3300 module
> from
> the battery when the power is switched off? Is your battery connected
>
> directly to the RCM3300 vbatt pin or via a resistor?
>
> Andy wrote:
>
> > Hi All,
> >
> > I have been following this subject with interest. I have been
> trying to
> > get the SRAM on RCM3300 to retain its content when the power is
> > switched off.
> >
> > I am using RCM3300 prototyping board for development, which already
> has
> > a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> > battery is 3.0 V.
> >
> > In my software I used protected keyword when declaring variables
> that I
> > want to back-up. However, the SRAM seems to lose its content when I
> > unplugged the power. The RTC seems to retain the time, when power
> is
> > removed.
> >
> > I attached sample test code below. What did I do wrong?
> >
> >
> ********************************************************************
> >
> > #use rcm33xx.lib
> >
> > protected char nvram[16];
> > protected char ch;
> >
> > main()
> > {
> > unsigned long Clock;
> > struct tm Time;
> >
> > brdInit();
> >
> > _sysIsSoftReset();
> >
> > printf( "Content of nvram after power-up: %s\n", nvram );
> > printf( "Content ch after power-up: %d\n", ch );
> >
> > ch = 123;
> > strcpy( nvram, "New content");
> >
> > printf( "Content of nvram: %s\n", nvram );
> > printf( "Content of ch: %d\n", ch );
> >
> > while(1){
> > costate{
> > // wait 1 second before displaying time
> > waitfor( DelaySec( 1 ) ) ;
> >
> > Clock = read_rtc();
> > mktm( &Time, Clock );
> >
> > printf( "Time: %02d:%02d:%02d\n", Time.tm_hour,
> > Time.tm_min, Time.tm_sec );
> > }
> > }
> > }
> >
> > ****************************************************************
> >
> >
> > --- Mike van Meeteren <mike@mike...> wrote:
> >
> >>At 06:06 PM 5/11/2005 +0000, you wrote:
> >> >
> >> >Hi Friends,
> >> >
> >> > Is there any 3.3V battery backup facility for SRAM of RCM3010?
> >> >I think, 3.3V battery backup is only available for RTC, in
> RCM3010.
> >> >I need a RCM module with battery backed facility for SRAM.
> >> > Please, tell me ,such RCM modules with 3.3V battery backup for
> >> >both SRAM & RTC. Also tell me ,what extra hardware & control
> >>signals
> >> >are required to give a battery back up for SRAM & RTC.
> >>
> >>3010 has battery backed ram, I use it. Only hardware you need is a
> >>3v
> >>battery, holder, and 1.4K resistor, hooked to the VBAT_EXT pin on
> the
> >>core
> >>module.
> >>
> >>
> >
> >
> >
> >
> > Yahoo! Mail
> > Stay connected, organized, and protected. Take the tour:
> > http://tour.mail.yahoo.com/mailtour.html
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
>
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html




_____________________________
 Free pdf download: Advanced Linux Programming.


FW: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Ross Lyn - May 12 6:08:00 2005


I don't think its the battery. Try the program you wrote without the
"protected" statement.

char nvram[16];
char ch;

-----Original Message-----
From: rabbit-semi@rabb... [mailto:rabbit-semi@rabb...] On
Behalf Of Andy
Sent: Thursday, 12 May 2005 10:02 p.m.
To: rabbit-semi@rabb...
Subject: Re: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in
RCM3010?

Hi Geoff,

The voltage across VBAT_EXT & GND is 3.003V when no power is connected. I am using Rabbit RCM3300 prototyping board. Looking at the schematic
http://www.zworld.com/documentation/schemat/090-0188.pdf, the battery is
connected via a 1.3K resistor.

Regards,
Andy

--- Geoff Swan <gswan3@gswa...> wrote:
> Andy,
>
> What measurement do you get for the voltage on the RCM3300 module from
> the battery when the power is switched off? Is your battery connected
>
> directly to the RCM3300 vbatt pin or via a resistor?
>
> Andy wrote:
>
> > Hi All,
> >
> > I have been following this subject with interest. I have been
> trying to
> > get the SRAM on RCM3300 to retain its content when the power is
> > switched off.
> >
> > I am using RCM3300 prototyping board for development, which already
> has
> > a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> > battery is 3.0 V.
> >
> > In my software I used protected keyword when declaring variables
> that I
> > want to back-up. However, the SRAM seems to lose its content when I
> > unplugged the power. The RTC seems to retain the time, when power
> is
> > removed.
> >
> > I attached sample test code below. What did I do wrong?
> >
> >
> ********************************************************************
> >
> > #use rcm33xx.lib
> >
> > protected char nvram[16];
> > protected char ch;
> >
> > main()
> > {
> > unsigned long Clock;
> > struct tm Time;
> >
> > brdInit();
> >
> > _sysIsSoftReset();
> >
> > printf( "Content of nvram after power-up: %s\n", nvram );
> > printf( "Content ch after power-up: %d\n", ch );
> >
> > ch = 123;
> > strcpy( nvram, "New content");
> >
> > printf( "Content of nvram: %s\n", nvram );
> > printf( "Content of ch: %d\n", ch );
> >
> > while(1){
> > costate{
> > // wait 1 second before displaying time
> > waitfor( DelaySec( 1 ) ) ;
> >
> > Clock = read_rtc();
> > mktm( &Time, Clock );
> >
> > printf( "Time: %02d:%02d:%02d\n", Time.tm_hour,
> > Time.tm_min, Time.tm_sec );
> > }
> > }
> > }
> >
> > ****************************************************************
> >
> >
> > --- Mike van Meeteren <mike@mike...> wrote:
> >
> >>At 06:06 PM 5/11/2005 +0000, you wrote:
> >> >
> >> >Hi Friends,
> >> >
> >> > Is there any 3.3V battery backup facility for SRAM of RCM3010?
> >> >I think, 3.3V battery backup is only available for RTC, in
> RCM3010.
> >> >I need a RCM module with battery backed facility for SRAM.
> >> > Please, tell me ,such RCM modules with 3.3V battery backup for
> >> >both SRAM & RTC. Also tell me ,what extra hardware & control
> >>signals
> >> >are required to give a battery back up for SRAM & RTC.
> >>
> >>3010 has battery backed ram, I use it. Only hardware you need is a
> >>3v battery, holder, and 1.4K resistor, hooked to the VBAT_EXT pin on
> the
> >>core
> >>module.
> >>
> >>
> >
> >
> >
> >
> > Yahoo! Mail
> > Stay connected, organized, and protected. Take the tour:
> > http://tour.mail.yahoo.com/mailtour.html
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
>
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html
Yahoo! Groups Links
-- --
--
--
--




Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Scott Henion - May 12 9:34:00 2005

At 04:31 AM 5/12/2005, you wrote:

>Hi All,
>
>I have been following this subject with interest. I have been trying to
>get the SRAM on RCM3300 to retain its content when the power is
>switched off.
>
>I am using RCM3300 prototyping board for development, which already has
>a battery connected to the VBAT-EXT pin on the RCM3300 module. The
>battery is 3.0 V.
>
>In my software I used protected keyword when declaring variables that I
>want to back-up. However, the SRAM seems to lose its content when I
>unplugged the power. The RTC seems to retain the time, when power is
>removed.
>
>I attached sample test code below. What did I do wrong?

The 3200, 3300 and 3800 have fast and slow ram. The fast RAM is not backed
up, the slow RAM is. By default all variables go in the fast RAM. Modules
that don't have fast RAM have all variables backed up by default.

Look at the "bbram" keyword. There is a sample in:
..\Samples\RestartVars\BatteryRAM\bbvars.c

<Scott>
------

| Scott G. Henion| shenion@shen... |
| Consultant | Stone Mountain, GA |
| SHDesigns | PGP Key 0xE98DDC48 |
| http://www.shdesigns.org |
------
today's fortune
mophobia, n.:
Fear of being verbally abused by a Mississippian. --
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 5/12/2005




Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Andy - May 13 6:54:00 2005

Thanks to Scott and every one else who replied to my post.

I managed to get the SRAM on the RCM3300 to retain its content by using
the "Compile Code and BIOS to FLASH and Run in RAM" compiler switch and
bbram keyword. Using the other compiler switches does not seem to
enable the BBROOTDATA area.

Regards,
Andy --- Scott Henion <shenion@shen...> wrote:
> At 04:31 AM 5/12/2005, you wrote:
>
> >Hi All,
> >
> >I have been following this subject with interest. I have been trying
> to
> >get the SRAM on RCM3300 to retain its content when the power is
> >switched off.
> >
> >I am using RCM3300 prototyping board for development, which already
> has
> >a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> >battery is 3.0 V.
> >
> >In my software I used protected keyword when declaring variables
> that I
> >want to back-up. However, the SRAM seems to lose its content when I
> >unplugged the power. The RTC seems to retain the time, when power is
> >removed.
> >
> >I attached sample test code below. What did I do wrong?
>
> The 3200, 3300 and 3800 have fast and slow ram. The fast RAM is not
> backed
> up, the slow RAM is. By default all variables go in the fast RAM.
> Modules
> that don't have fast RAM have all variables backed up by default.
>
> Look at the "bbram" keyword. There is a sample in:
> ..\Samples\RestartVars\BatteryRAM\bbvars.c
>
> <Scott>
> ------
>
> | Scott G. Henion| shenion@shen... |
> | Consultant | Stone Mountain, GA |
> | SHDesigns | PGP Key 0xE98DDC48 |
> | http://www.shdesigns.org |
> ------
> today's fortune
> mophobia, n.:
> Fear of being verbally abused by a Mississippian. > --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 5/12/2005 >
__________________________________



_____________________________
 Free pdf download: Introduction to Embedded Systems.


Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Nathan Johnston - May 15 19:26:00 2005

What do you mean by “Using the other compiler switches does not seem to enable the BBROOTDATA area”?

 

I recently needed to (re-)investigate how bbram worked again so I might as well share my findings seeing as there is no documentation available on this…

 

The amount of bbram is controlled by BBROOTDATASIZE in the bios. If you increase this you will end up losing some root data space due to how this space is mapped into the logical address range. The rest of the battery backed (“slow”) SRAM is available in xmem, however only physical addresses above 0x80000 (in RCM3200 anyway) are battery backed. In more recent versions of Dynamic C (above 8.30?) there is an _xalloc function that allows you to specify whether you want the xmem area being allocated to be battery backed or not. For earlier versions you just need to be smart with your xalloc/avail calls.

 

The memory_usage.c sample program is really good tool to see what is going on when you start playing with this stuff…

 

Regards,

Nathan

 

-----Original Message-----
From: r...@yahoogroups.com [mailto:r...@yahoogroups.com] On Behalf Of Andy
Sent:
Friday, 13 May 2005 8:55 PM
To: r...@yahoogroups.com
Subject: Re: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in RCM3010?

 

Thanks to Scott and every one else who replied to my post.

I managed to get the SRAM on the RCM3300 to retain its content by using
the "Compile Code and BIOS to FLASH and Run in RAM" compiler switch and
bbram keyword. Using the other compiler switches does not seem to
enable the BBROOTDATA area.

Regards,
Andy  --- Scott Henion <s...@shdesigns.org> wrote:
> At 04:31 AM 5/12/2005, you wrote:
>
> >Hi All,
> >
> >I have been following this subject with interest. I have been trying
> to
> >get the SRAM on RCM3300 to retain its content when the power is
> >switched off.
> >
> >I am using RCM3300 prototyping board for development, which already
> has
> >a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> >battery is 3.0 V.
> >
> >In my software I used protected keyword when declaring variables
> that I
> >want to back-up. However, the SRAM seems to lose its content when I
> >unplugged the power. The RTC seems to retain the time, when power is
> >removed.
> >
> >I attached sample test code below. What did I do wrong?
>
> The 3200, 3300 and 3800 have fast and slow ram. The fast RAM is not
> backed
> up, the slow RAM is. By default all variables go in the fast RAM.
> Modules
> that don't have fast RAM have all variables backed up by default.
>
> Look at the "bbram" keyword. There is a sample in:
> ..\Samples\RestartVars\BatteryRAM\bbvars.c
>
> <Scott>
> ------
>
> | Scott G. Henion| s...@shdesigns.org |
> |   Consultant   |   Stone Mountain, GA  |
> |   SHDesigns    |   PGP Key 0xE98DDC48  |
> |     http://www.shdesigns.org           |
> ------
> today's fortune
> mophobia, n.:
>          Fear of being verbally abused by a Mississippian.
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 5/12/2005
>
>
>            
__________________________________






Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Andy - May 16 6:25:00 2005

When I compiled the sample code bbvars.c using the "Code and BIOS in
Flash", it looked like the BBROOTDATASIZE was set to 0. Hence, the
variables are stored in non-bb SRAM.

In your experience working with BBRAM, have you come across the
follwoing problem?

In my code I have a (global) struct. I pass the address of the struct
to a function. When I tried to assigned a value to a member of the
struct in the function I got "Run Time Error: Erroneous Pointer
Assignment". For example:

struct Data{

--- Nathan Johnston <nathanj@nath...> wrote:
> What do you mean by "Using the other compiler switches does not seem
> to
> enable the BBROOTDATA area"?
>
> I recently needed to (re-)investigate how bbram worked again so I
> might
> as well share my findings seeing as there is no documentation
> available
> on this...
>
> The amount of bbram is controlled by BBROOTDATASIZE in the bios. If
> you
> increase this you will end up losing some root data space due to how
> this space is mapped into the logical address range. The rest of the
> battery backed ("slow") SRAM is available in xmem, however only
> physical
> addresses above 0x80000 (in RCM3200 anyway) are battery backed. In
> more
> recent versions of Dynamic C (above 8.30?) there is an _xalloc
> function
> that allows you to specify whether you want the xmem area being
> allocated to be battery backed or not. For earlier versions you just
> need to be smart with your xalloc/avail calls.
>
> The memory_usage.c sample program is really good tool to see what is
> going on when you start playing with this stuff...
>
> Regards,
> Nathan
>
> -----Original Message-----
> From: rabbit-semi@rabb...
> [mailto:rabbit-semi@rabb...]
> On Behalf Of Andy
> Sent: Friday, 13 May 2005 8:55 PM
> To: rabbit-semi@rabb...
> Subject: Re: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in
> RCM3010?
>
> Thanks to Scott and every one else who replied to my post.
>
> I managed to get the SRAM on the RCM3300 to retain its content by
> using
> the "Compile Code and BIOS to FLASH and Run in RAM" compiler switch
> and
> bbram keyword. Using the other compiler switches does not seem to
> enable the BBROOTDATA area.
>
> Regards,
> Andy > --- Scott Henion <shenion@shen...> wrote:
> > At 04:31 AM 5/12/2005, you wrote:
> >
> > >Hi All,
> > >
> > >I have been following this subject with interest. I have been
> trying
> > to
> > >get the SRAM on RCM3300 to retain its content when the power is
> > >switched off.
> > >
> > >I am using RCM3300 prototyping board for development, which
> already
> > has
> > >a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> > >battery is 3.0 V.
> > >
> > >In my software I used protected keyword when declaring variables
> > that I
> > >want to back-up. However, the SRAM seems to lose its content when
> I
> > >unplugged the power. The RTC seems to retain the time, when power
> is
> > >removed.
> > >
> > >I attached sample test code below. What did I do wrong?
> >
> > The 3200, 3300 and 3800 have fast and slow ram. The fast RAM is not
> > backed
> > up, the slow RAM is. By default all variables go in the fast RAM.
> > Modules
> > that don't have fast RAM have all variables backed up by default.
> >
> > Look at the "bbram" keyword. There is a sample in:
> > ..\Samples\RestartVars\BatteryRAM\bbvars.c
> >
> > <Scott>
> > ------
> >
> > | Scott G. Henion| shenion@shen... |
> > | Consultant | Stone Mountain, GA |
> > | SHDesigns | PGP Key 0xE98DDC48 |
> > | http://www.shdesigns.org |
> > ------
> > today's fortune
> > mophobia, n.:
> > Fear of being verbally abused by a Mississippian.
> >
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.308 / Virus Database: 266.11.9 - Release Date:
> 5/12/2005
> >
> >
> >
> __________________________________
> > ________________________________
>
> > .
>

__________________________________________________






Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Andy - May 16 6:37:00 2005

Oops, Yahoo decided to send my reply before I finished writing it.

Let me start again.

In my code I have a (global) struct. I pass the address of the struct
to a function. When I tried to assign a value to a member of the
struct in the function I got "Run Time Error: Erroneous Pointer
Assignment".

//Sample code

typedef struct _importantData{
char Text[10];
word Val;
}IMPORTANT_DATA;

bbram IMPORTANT_DATA ImpData; void Initialise( IMPORTANT_DATA *pData )
{
pData->Val = 100;
} void main()
{
Initialise( &ImpData );
}

This does not happen if ImpData is declared without "bbram" keyword.

Can anyone explain what's going on here?

Regards,
Andy
--- Nathan Johnston <nathanj@nath...> wrote:
> What do you mean by "Using the other compiler switches does not seem
> to
> enable the BBROOTDATA area"?
>
> I recently needed to (re-)investigate how bbram worked again so I
> might
> as well share my findings seeing as there is no documentation
> available
> on this...
>
> The amount of bbram is controlled by BBROOTDATASIZE in the bios. If
> you
> increase this you will end up losing some root data space due to how
> this space is mapped into the logical address range. The rest of the
> battery backed ("slow") SRAM is available in xmem, however only
> physical
> addresses above 0x80000 (in RCM3200 anyway) are battery backed. In
> more
> recent versions of Dynamic C (above 8.30?) there is an _xalloc
> function
> that allows you to specify whether you want the xmem area being
> allocated to be battery backed or not. For earlier versions you just
> need to be smart with your xalloc/avail calls.
>
> The memory_usage.c sample program is really good tool to see what is
> going on when you start playing with this stuff...
>
> Regards,
> Nathan
>
> -----Original Message-----
> From: rabbit-semi@rabb...
> [mailto:rabbit-semi@rabb...]
> On Behalf Of Andy
> Sent: Friday, 13 May 2005 8:55 PM
> To: rabbit-semi@rabb...
> Subject: Re: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in
> RCM3010?
>
> Thanks to Scott and every one else who replied to my post.
>
> I managed to get the SRAM on the RCM3300 to retain its content by
> using
> the "Compile Code and BIOS to FLASH and Run in RAM" compiler switch
> and
> bbram keyword. Using the other compiler switches does not seem to
> enable the BBROOTDATA area.
>
> Regards,
> Andy > --- Scott Henion <shenion@shen...> wrote:
> > At 04:31 AM 5/12/2005, you wrote:
> >
> > >Hi All,
> > >
> > >I have been following this subject with interest. I have been
> trying
> > to
> > >get the SRAM on RCM3300 to retain its content when the power is
> > >switched off.
> > >
> > >I am using RCM3300 prototyping board for development, which
> already
> > has
> > >a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> > >battery is 3.0 V.
> > >
> > >In my software I used protected keyword when declaring variables
> > that I
> > >want to back-up. However, the SRAM seems to lose its content when
> I
> > >unplugged the power. The RTC seems to retain the time, when power
> is
> > >removed.
> > >
> > >I attached sample test code below. What did I do wrong?
> >
> > The 3200, 3300 and 3800 have fast and slow ram. The fast RAM is not
> > backed
> > up, the slow RAM is. By default all variables go in the fast RAM.
> > Modules
> > that don't have fast RAM have all variables backed up by default.
> >
> > Look at the "bbram" keyword. There is a sample in:
> > ..\Samples\RestartVars\BatteryRAM\bbvars.c
> >
> > <Scott>
> > ------
> >
> > | Scott G. Henion| shenion@shen... |
> > | Consultant | Stone Mountain, GA |
> > | SHDesigns | PGP Key 0xE98DDC48 |
> > | http://www.shdesigns.org |
> > ------
> > today's fortune
> > mophobia, n.:
> > Fear of being verbally abused by a Mississippian.
> >
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.308 / Virus Database: 266.11.9 - Release Date:
> 5/12/2005
> >
> >
> >
> __________________________________
> > ________________________________
>
> > .
>
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html





Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Prashant Y - May 16 13:34:00 2005

Hi,
 
     Thanks for giving a sample code  . 
 
With regards,
 
Prashant.

Andy <a...@yahoo.com> wrote:
Hi All,

I have been following this subject with interest. I have been trying to
get the SRAM on RCM3300 to retain its content when the power is
switched off.

I am using RCM3300 prototyping board for development, which already has
a battery connected to the VBAT-EXT pin on the RCM3300 module. The
battery is 3.0 V.

In my software I used protected keyword when declaring variables that I
want to back-up. However, the SRAM seems to lose its content when I
unplugged the power. The RTC seems to retain the time, when power is
removed.

I attached sample test code below. What did I do wrong?

********************************************************************

#use rcm33xx.lib           

protected char nvram[16];
protected char ch;

main()
{
    unsigned long Clock;
    struct tm Time;

    brdInit();

    _sysIsSoftReset();

    printf( "Content of nvram after power-up: %s\n", nvram );
    printf( "Content ch after power-up: %d\n", ch );

    ch = 123;
    strcpy( nvram, "New content");

    printf( "Content of nvram: %s\n", nvram );
    printf( "Content of ch: %d\n", ch );

    while(1){
          costate{
            // wait 1 second before displaying time
            waitfor( DelaySec( 1 ) ) ;

            Clock = read_rtc();
              mktm( &Time, Clock );

            printf( "Time: %02d:%02d:%02d\n", Time.tm_hour,
Time.tm_min, Time.tm_sec );
         }
    }
}

****************************************************************--- Mike van Meeteren <m...@fastec.com> wrote:
> At 06:06 PM 5/11/2005 +0000, you wrote:
>  >
>  >Hi Friends,
>  >
>  >   Is there any 3.3V battery backup facility for SRAM of RCM3010?
>  >I think, 3.3V battery backup is only available for RTC, in RCM3010.
>  >I need a RCM module with battery backed facility for SRAM.
>  >   Please, tell me ,such RCM modules with 3.3V battery backup for
>  >both SRAM & RTC. Also tell me ,what extra hardware & control
> signals
>  >are required to give a battery back up for SRAM & RTC.
>
> 3010 has battery backed ram, I use it.  Only hardware you need is a
> 3v
> battery, holder, and 1.4K resistor, hooked to the VBAT_EXT pin on the
> core
> module.

           
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html

__________________________________________________



Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Nathan Johnston - May 16 19:43:00 2005

Andy,

 

BBROOTDATASIZE will be set to 0 because you are using an RCM3010 which doesn’t have fast SRAM, so the bbram keyword is just (well supposed to be -> see next paragraph) ignored. The RCM3010 shouldn’t even let you combine to flash run in RAM, i.e. it should give you an error saying it is not supported with this RCM. For an RCM3010 all you need to do is ensure VBAT is properly connected, then define your variables as static…

 

You have discovered a bbram bug which I reported to ZWorld last August, and they acknowledged it was a bug. It was with Dynamic C 8.61. I would hope they have fixed it in more recent versions but I have not tested it. Out of interest, what version of Dynamic C are you using?

 

This is the program I sent to ZWorld which highlights the bug (and shows work around).

 

Regards,

Nathan

 

 

//Demonstrates problem copying bbram struct members using pointers

 

struct testStruct

{

            char charVar;

};

 

bbram static struct testStruct bbramTest, bbramTest2;

struct testStruct nonbbramTest;

 

void main()

{

            //bbram static struct testStruct *src, *dst;            //Tried this incase pointers to bbram must be static but still same problem

   struct testStruct *src, *dst;

 

   //Set variable to some initial value

   bbramTest.charVar = 1;

 

   //Copy from bbram to non bbram (no pointers)

   nonbbramTest.charVar = bbramTest.charVar;

 

   //Copy from non bbram to bbram (no pointers)

   bbramTest.charVar = nonbbramTest.charVar;

 

   //Repeat process above using pointers

   src = &bbramTest;

   dst = &nonbbramTest;

 

   //Copy bbram into non bbram using pointers

   dst->charVar = src->charVar;

 

   src = &nonbbramTest;

   dst = &bbramTest;

 

   //Copy non bbram into bbram using pointers

   //** Gives erroneous pointer assignment exception! **

   dst->charVar = src->charVar;

 

   src = &bbramTest;

   dst = &bbramTest2;

 

   //Copy bbram into bbram using pointers

   //** Gives erroneous pointer assignment exception! **

   dst->charVar = src->charVar;

}

-----Original Message-----
From: r...@yahoogroups.com [mailto:r...@yahoogroups.com] On Behalf Of Andy
Sent:
Monday, 16 May 2005 8:37 PM
To: r...@yahoogroups.com
Subject: RE: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in RCM3010?

 

Oops, Yahoo decided to send my reply before I finished writing it.

Let me start again.

In my code I have a (global) struct. I pass the address of the struct
to a function. When I tried to assign a value to a member of the
struct in the function I got "Run Time Error: Erroneous Pointer
Assignment".

//Sample code

typedef struct _importantData{
  char Text[10];
  word Val;
}IMPORTANT_DATA;

bbram IMPORTANT_DATA ImpData; void Initialise( IMPORTANT_DATA *pData )
{
  pData->Val = 100;
} void main()
{
  Initialise( &ImpData );
}

This does not happen if ImpData is declared without "bbram" keyword.

Can anyone explain what's going on here?

Regards,
Andy
--- Nathan Johnston <n...@dominion.net.au> wrote:
> What do you mean by "Using the other compiler switches does not seem
> to
> enable the BBROOTDATA area"?

> I recently needed to (re-)investigate how bbram worked again so I
> might
> as well share my findings seeing as there is no documentation
> available
> on this...

> The amount of bbram is controlled by BBROOTDATASIZE in the bios. If
> you
> increase this you will end up losing some root data space due to how
> this space is mapped into the logical address range. The rest of the
> battery backed ("slow") SRAM is available in xmem, however only
> physical
> addresses above 0x80000 (in RCM3200 anyway) are battery backed. In
> more
> recent versions of Dynamic C (above 8.30?) there is an _xalloc
> function
> that allows you to specify whether you want the xmem area being
> allocated to be battery backed or not. For earlier versions you just
> need to be smart with your xalloc/avail calls.

> The memory_usage.c sample program is really good tool to see what is
> going on when you start playing with this stuff...

> Regards,
> Nathan

> -----Original Message-----
> From: r...@yahoogroups.com
> [mailto:r...@yahoogroups.com]
> On Behalf Of Andy
> Sent:
Friday, 13 May 2005 8:55 PM
> To: r...@yahoogroups.com
> Subject: Re: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in
> RCM3010?

> Thanks to Scott and every one else who replied to my post.
>
> I managed to get the SRAM on the RCM3300 to retain its content by
> using
> the "Compile Code and BIOS to FLASH and Run in RAM" compiler switch
> and
> bbram keyword. Using the other compiler switches does not seem to
> enable the BBROOTDATA area.
>
> Regards,
> Andy 
>
>
> --- Scott Henion <s...@shdesigns.org> wrote:
> > At
04:31 AM 5/12/2005, you wrote:
> >
> > >Hi All,
> > >
> > >I have been following this subject with interest. I have been
> trying
> > to
> > >get the SRAM on RCM3300 to retain its content when the power is
> > >switched off.
> > >
> > >I am using RCM3300 prototyping board for development, which
> already
> > has
> > >a battery connected to the VBAT-EXT pin on the RCM3300 module. The
> > >battery is 3.0 V.
> > >
> > >In my software I used protected keyword when declaring variables
> > that I
> > >want to back-up. However, the SRAM seems to lose its content when
> I
> > >unplugged the power. The RTC seems to retain the time, when power
> is
> > >removed.
> > >
> > >I attached sample test code below. What did I do wrong?
> >
> > The 3200, 3300 and 3800 have fast and slow ram. The fast RAM is not
> > backed
> > up, the slow RAM is. By default all variables go in the fast RAM.
> > Modules
> > that don't have fast RAM have all variables backed up by default.
> >
> > Look at the "bbram" keyword. There is a sample in:
> > ..\Samples\RestartVars\BatteryRAM\bbvars.c
> >
> > <Scott>
> > ------
> >
> > | Scott G. Henion| s...@shdesigns.org |
> > |   Consultant   |  
Stone Mountain, GA  |
> > |   SHDesigns    |   PGP Key 0xE98DDC48  |
> > |     http://www.shdesigns.org           |
> > ------
> > today's fortune
> > mophobia, n.:
> >          Fear of being verbally abused by a Mississippian.
> >
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.308 / Virus Database: 266.11.9 - Release Date:
> 5/12/2005
> >
> >
> >
>
>
>            
> __________________________________
>
>
>
> ________________________________
>
> > .
>            
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html




_____________________________
 Free pdf download: Introduction to Embedded Systems.


Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Andy - May 16 20:37:00 2005

Hi Nathan,

Thanks for the reply.

I am actually doing my development on RCM3300 using DC 8.51. I had a
brief look in the BIOS.C and it seems that the BBROOTDATASIZE is only
set to 0x1000, when the following compiler switches are defined.

---------------
#if (FAST_RAM_COMPILE && (RUN_IN_RAM_CS == 0x2)) // Only if we have a
battery-backed RAM on CS1
#define BBROOTDATASIZE 0x1000 // Size of battery-backed data
#define BBROOTDATAORG STACKORG-0x1 // battery-backed root data org

...

#else
#define BBROOTDATASIZE 0x0 // Default to zero (does not exist)
#endif
------------------

There is a patch for DC 8.51 on Z-World website, but not for DC 8.61.
I assume the bug is still not fixed.

I also found out the work-around like you said in your reply. It is
just a bit of a hassle to go through tens of thousand of lines to make
the changes, when the code was already stable. Well, at least there is
a work-around.

Regards,
Andy --- Nathan Johnston <nathanj@nath...> wrote:

> Andy,
>
> BBROOTDATASIZE will be set to 0 because you are using an RCM3010
> which
> doesn't have fast SRAM, so the bbram keyword is just (well supposed
> to
> be -> see next paragraph) ignored. The RCM3010 shouldn't even let you
> combine to flash run in RAM, i.e. it should give you an error saying
> it
> is not supported with this RCM. For an RCM3010 all you need to do is
> ensure VBAT is properly connected, then define your variables as
> static...
>
> You have discovered a bbram bug which I reported to ZWorld last
> August,
> and they acknowledged it was a bug. It was with Dynamic C 8.61. I
> would
> hope they have fixed it in more recent versions but I have not tested
> it. Out of interest, what version of Dynamic C are you using?
>
> This is the program I sent to ZWorld which highlights the bug (and
> shows
> work around).
>
> Regards,
> Nathan > //Demonstrates problem copying bbram struct members using pointers
>
> struct testStruct
> {
> char charVar;
> };
>
> bbram static struct testStruct bbramTest, bbramTest2;
> struct testStruct nonbbramTest;
>
> void main()
> {
> //bbram static struct testStruct *src, *dst;
> //Tried this incase pointers to bbram must be static but still same
> problem
> struct testStruct *src, *dst;
>
> //Set variable to some initial value
> bbramTest.charVar = 1;
>
> //Copy from bbram to non bbram (no pointers)
> nonbbramTest.charVar = bbramTest.charVar;
>
> //Copy from non bbram to bbram (no pointers)
> bbramTest.charVar = nonbbramTest.charVar;
>
> //Repeat process above using pointers
> src = &bbramTest;
> dst = &nonbbramTest;
>
> //Copy bbram into non bbram using pointers
> dst->charVar = src->charVar;
>
> src = &nonbbramTest;
> dst = &bbramTest;
>
> //Copy non bbram into bbram using pointers
> //** Gives erroneous pointer assignment exception! **
> dst->charVar = src->charVar;
>
> src = &bbramTest;
> dst = &bbramTest2;
>
> //Copy bbram into bbram using pointers
> //** Gives erroneous pointer assignment exception! **
> dst->charVar = src->charVar;
> }
> -----Original Message-----
> From: rabbit-semi@rabb...
> [mailto:rabbit-semi@rabb...]
> On Behalf Of Andy
> Sent: Monday, 16 May 2005 8:37 PM
> To: rabbit-semi@rabb...
> Subject: RE: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in
> RCM3010?
>
> Oops, Yahoo decided to send my reply before I finished writing it.
>
> Let me start again.
>
> In my code I have a (global) struct. I pass the address of the struct
> to a function. When I tried to assign a value to a member of the
> struct in the function I got "Run Time Error: Erroneous Pointer
> Assignment".
>
> //Sample code
>
> typedef struct _importantData{
> char Text[10];
> word Val;
> }IMPORTANT_DATA;
>
> bbram IMPORTANT_DATA ImpData; > void Initialise( IMPORTANT_DATA *pData )
> {
> pData->Val = 100;
> } > void main()
> {
> Initialise( &ImpData );
> }
>
> This does not happen if ImpData is declared without "bbram" keyword.
>
> Can anyone explain what's going on here?
>
> Regards,
> Andy >
> --- Nathan Johnston <nathanj@nath...> wrote:
> > What do you mean by "Using the other compiler switches does not
> seem
> > to
> > enable the BBROOTDATA area"?
> >
> > I recently needed to (re-)investigate how bbram worked again so I
> > might
> > as well share my findings seeing as there is no documentation
> > available
> > on this...
> >
> > The amount of bbram is controlled by BBROOTDATASIZE in the bios. If
> > you
> > increase this you will end up losing some root data space due to
> how
> > this space is mapped into the logical address range. The rest of
> the
> > battery backed ("slow") SRAM is available in xmem, however only
> > physical
> > addresses above 0x80000 (in RCM3200 anyway) are battery backed. In
> > more
> > recent versions of Dynamic C (above 8.30?) there is an _xalloc
> > function
> > that allows you to specify whether you want the xmem area being
> > allocated to be battery backed or not. For earlier versions you
> just
> > need to be smart with your xalloc/avail calls.
> >
> > The memory_usage.c sample program is really good tool to see what
> is
> > going on when you start playing with this stuff...
> >
> > Regards,
> > Nathan
> >
> > -----Original Message-----
> > From: rabbit-semi@rabb...
> > [mailto:rabbit-semi@rabb...]
> > On Behalf Of Andy
> > Sent: Friday, 13 May 2005 8:55 PM
> > To: rabbit-semi@rabb...
> > Subject: Re: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM
> in
> > RCM3010?
> >
> > Thanks to Scott and every one else who replied to my post.
> >
> > I managed to get the SRAM on the RCM3300 to retain its content by
> > using
> > the "Compile Code and BIOS to FLASH and Run in RAM" compiler switch
> > and
> > bbram keyword. Using the other compiler switches does not seem to
> > enable the BBROOTDATA area.
> >
> > Regards,
> > Andy
> >
> >
> > --- Scott Henion <shenion@shen...> wrote:
> > > At 04:31 AM 5/12/2005, you wrote:
> > >
> > > >Hi All,
> > > >
> > > >I have been following this subject with interest. I have been
> > trying
> > > to
> > > >get the SRAM on RCM3300 to retain its content when the power is
> > > >switched off.
> > > >
> > > >I am using RCM3300 prototyping board for development, which
> > already
> > > has
> > > >a battery connected to the VBAT-EXT pin on the RCM3300 module.
> The
> > > >battery is 3.0 V.
> > > >
> > > >In my software I used protected keyword when declaring variables
>
=== message truncated ===

Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html




_____________________________
 Free pdf download: Advanced Linux Programming.


Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Nathan Johnston - May 16 20:46:00 2005

Andy,

 

Those “compiler switches” are looked after for you. Basically it’s checking that your using a RCM that has fast SRAM and that you’re compiling to flash, run in RAM.

 

This thread seems to have gone down a couple of paths. If you are the person working with the RCM3010 I would not recommend you do your development on an RCM with fast RAM because you will waste a lot of time with battery backed issues that won’t affect you with the RCM3010…

 

Regards,

Nathan

 

-----Original Message-----
From: r...@yahoogroups.com [mailto:r...@yahoogroups.com] On Behalf Of Andy
Sent:
Tuesday, 17 May 2005 10:37 AM
To: r...@yahoogroups.com
Subject: RE: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in RCM3010?

 

Hi Nathan,

Thanks for the reply.

I am actually doing my development on RCM3300 using DC 8.51. I had a
brief look in the BIOS.C and it seems that the BBROOTDATASIZE is only
set to 0x1000, when the following compiler switches are defined. 

---------------
#if (FAST_RAM_COMPILE && (RUN_IN_RAM_CS =0x2))      // Only if we have a
battery-backed RAM on CS1
  #define BBROOTDATASIZE 0x1000      // Size of battery-backed data
  #define BBROOTDATAORG STACKORG-0x1      // battery-backed root data org

...

#else
  #define BBROOTDATASIZE 0x0      // Default to zero (does not exist)
#endif
------------------

There is  a patch for DC 8.51 on Z-World website, but not for DC 8.61.
I assume the bug is still not fixed.

I also found out the work-around like you said in your reply. It is
just a bit of a hassle to go through tens of thousand of lines to make
the changes, when the code was already stable. Well, at least there is
a work-around.

Regards,
Andy --- Nathan Johnston <n...@dominion.net.au> wrote:

> Andy,

> BBROOTDATASIZE will be set to 0 because you are using an RCM3010
> which
> doesn't have fast SRAM, so the bbram keyword is just (well supposed
> to
> be -> see next paragraph) ignored. The RCM3010 shouldn't even let you
> combine to flash run in RAM, i.e. it should give you an error saying
> it
> is not supported with this RCM. For an RCM3010 all you need to do is
> ensure VBAT is properly connected, then define your variables as
> static...

> You have discovered a bbram bug which I reported to ZWorld last
> August,
> and they acknowledged it was a bug. It was with Dynamic C 8.61. I
> would
> hope they have fixed it in more recent versions but I have not tested
> it. Out of interest, what version of Dynamic C are you using?

> This is the program I sent to ZWorld which highlights the bug (and
> shows
> work around).

> Regards,
> Nathan


> //Demonstrates problem copying bbram struct members using pointers

> struct testStruct
> {
>             char charVar;
> };

> bbram static struct testStruct bbramTest, bbramTest2;
> struct testStruct nonbbramTest;

> void main()
> {
>             //bbram static struct testStruct *src, *dst;
> //Tried this incase pointers to bbram must be static but still same
> problem
>    struct testStruct *src, *dst;

>    //Set variable to some initial value
>    bbramTest.charVar = 1;

>    //Copy from bbram to non bbram (no pointers)
>    nonbbramTest.charVar bbramTest.charVar;

>    //Copy from non bbram to bbram (no pointers)
>    bbramTest.charVar nonbbramTest.charVar;

>    //Repeat process above using pointers
>    src = &bbramTest;
>    dst = &nonbbramTest;

>    //Copy bbram into non bbram using pointers
>    dst->charVar src->charVar;

>    src = &nonbbramTest;
>    dst = &bbramTest;

>    //Copy non bbram into bbram using pointers
>    //** Gives erroneous pointer assignment exception! **
>    dst->charVar src->charVar;

>    src = &bbramTest;
>    dst = &bbramTest2;

>    //Copy bbram into bbram using pointers
>    //** Gives erroneous pointer assignment exception! **
>    dst->charVar src->charVar;
> }
> -----Original Message-----
> From: r...@yahoogroups.com
> [mailto:r...@yahoogroups.com]
> On Behalf Of Andy
> Sent:
Monday, 16 May 2005 8:37 PM
> To: r...@yahoogroups.com
> Subject: RE: [rabbit-semi] 3.3 V-- Battery-Back up for Static RAM in
> RCM3010?

> Oops, Yahoo decided to send my reply before I finished writing it.
>
> Let me start again.
>
> In my code I have a (global) struct. I pass the address of the struct
> to a function. When I tried to assign a value to a member of the
> struct in the function I got "Run Time Error: Erroneous Pointer
> Assignment".
>
> //Sample code
>
> typedef struct _importantData{
>   char Text[10];
>   word Val;
> }IMPORTANT_DATA;
>
> bbram IMPORTANT_DATA ImpData;
>
>
> void Initialise( IMPORTANT_DATA *pData )
> {
>   pData->Val = 100;
> }
>
>
> void main()
> {
>   Initialise( &ImpData );
> }
>
> This does not happen if ImpData is declared without "bbram" keyword.
>
> Can anyone explain what's going on here?
>
> Regards,
> Andy
>
>
>
> --- Nathan Johnston <n...@dominion.net.au> wrote:
> > What do you mean by "Using the other compiler switches does not
> seem
> > to
> > enable the BBROOTDATA area"?
> > 
> > I recently needed to (re-)investigate how bbram worked again so I
> > might
> > as well share my findings seeing as there is no documentation
> > available
> > on this...
> > 
> > The amount of bbram is controlled by BBROOTDATASIZE in the bios. If
> > you
> > increase this you will end up losing some root data space due to
> how
> > this space is mapped into the logical address range. The rest of
> the
> > battery backed ("slow") SRAM is available in xmem, however only
> > physical
> > addresses above 0x80000 (in RCM3200 anyway) are battery backed. In
> > more
> > recent versions of Dynamic C (above 8.30?) there is an _xalloc
> > function
> > that allows you to specify whether you want the xmem area being
> > allocated to be battery backed or not. For earlier versions you
> just
> > need to be smart with your xalloc/avail calls.
> > 
> > The memory_usage.c sample program is really good tool to see what
> is
> > going on when you start playing with this stuff...
> > 
> > Regards,
> > Nathan
> > 
> > -----Original Message-----
> > From: r...@yahoogroups.com
> > [mailto:r...@yahoogroups.com]
> > On Behalf Of Andy
> > Sent:
Friday, 13 May 2005 8:55 PM
> > To: r...@yahoogroups.com
> > Subject: Re: [rabbit-semi] 3.3 V--
Battery-Back up for Static RAM
> in
> > RCM3010?
> > 
> > Thanks to Scott and every one else who replied to my post.
> >
> > I managed to get the SRAM on the RCM3300 to retain its content by
> > using
> > the "Compile Code and BIOS to FLASH and Run in RAM" compiler switch
> > and
> > bbram keyword. Using the other compiler switches does not seem to
> > enable the BBROOTDATA area.
> >
> > Regards,
> > Andy 
> >
> >
> > --- Scott Henion <s...@shdesigns.org> wrote:
> > > At
04:31 AM 5/12/2005, you wrote:
> > >
> > > >Hi All,
> > > >
> > > >I have been following this subject with interest. I have been
> > trying
> > > to
> > > >get the SRAM on RCM3300 to retain its content when the power is
> > > >switched off.
> > > >
> > > >I am using RCM3300 prototyping board for development, which
> > already
> > > has
> > > >a battery connected to the VBAT-EXT pin on the RCM3300 module.
> The
> > > >battery is 3.0 V.
> > > >
> > > >In my software I used protected keyword when declaring variables
>
=== message truncated ===
           
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html





Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Prashant Y - May 17 13:09:00 2005

Hi,

Excellent, your code is working perfectly on
RCM3010. I tried your code. RCM3010 is having only
slow SRAM. I succeed to restore the variables even
after the power failure. I used "Protected" keyword &
_sysIsSoftreset(). Thanks for a sample code.
Could you tell me about, How many no. of variable I
can restore in the battery back up SRAM?
In RABBITBIOS.c it is mentioned as BBRAMDATASIZE is
Zero. Please, tell me HOW many variables I can
restore from the battery back up SRAM? Is there any
setting to do this?

With regards,

Prashant.
--- Prashant Y <pra_shant3000@pra_...> wrote:
> Hi,
>
> Thanks for giving a sample code .
>
> With regards,
>
> Prashant.
>
> Andy <ajpriv@ajpr...> wrote:
> Hi All,
>
> I have been following this subject with interest. I
> have been trying to
> get the SRAM on RCM3300 to retain its content when
> the power is
> switched off.
>
> I am using RCM3300 prototyping board for
> development, which already has
> a battery connected to the VBAT-EXT pin on the
> RCM3300 module. The
> battery is 3.0 V.
>
> In my software I used protected keyword when
> declaring variables that I
> want to back-up. However, the SRAM seems to lose its
> content when I
> unplugged the power. The RTC seems to retain the
> time, when power is
> removed.
>
> I attached sample test code below. What did I do
> wrong?
********************************************************************
>
> #use rcm33xx.lib
>
> protected char nvram[16];
> protected char ch;
>
> main()
> {
> unsigned long Clock;
> struct tm Time;
>
> brdInit();
>
> _sysIsSoftReset();
>
> printf( "Content of nvram after power-up: %s\n",
> nvram );
> printf( "Content ch after power-up: %d\n", ch );
>
> ch = 123;
> strcpy( nvram, "New content");
>
> printf( "Content of nvram: %s\n", nvram );
> printf( "Content of ch: %d\n", ch );
>
> while(1){
> costate{
> // wait 1 second before displaying time
> waitfor( DelaySec( 1 ) ) ;
>
> Clock = read_rtc();
> mktm( &Time, Clock );
>
> printf( "Time: %02d:%02d:%02d\n",
> Time.tm_hour,
> Time.tm_min, Time.tm_sec );
> }
> }
> }
****************************************************************
>
>
> --- Mike van Meeteren <mike@mike...> wrote:
> > At 06:06 PM 5/11/2005 +0000, you wrote:
> > >
> > >Hi Friends,
> > >
> > > Is there any 3.3V battery backup facility for
> SRAM of RCM3010?
> > >I think, 3.3V battery backup is only available
> for RTC, in RCM3010.
> > >I need a RCM module with battery backed facility
> for SRAM.
> > > Please, tell me ,such RCM modules with 3.3V
> battery backup for
> > >both SRAM & RTC. Also tell me ,what extra
> hardware & control
> > signals
> > >are required to give a battery back up for SRAM
> & RTC.
> >
> > 3010 has battery backed ram, I use it. Only
> hardware you need is a
> > 3v
> > battery, holder, and 1.4K resistor, hooked to the
> VBAT_EXT pin on the
> > core
> > module.
> >
> >
> Yahoo! Mail
> Stay connected, organized, and protected. Take the
> tour:
> http://tour.mail.yahoo.com/mailtour.html >
> ---------------------------------
> Yahoo! Groups Links
>
> To > __________________________________________________
>
__________________________________





Re: 3.3 V-- Battery-Back up for Static RAM in RCM3010? - Scott Henion - May 17 17:01:00 2005

At 12:09 PM 5/17/2005, you wrote:

>Hi,
>
> Excellent, your code is working perfectly on
>RCM3010. I tried your code. RCM3010 is having only
>slow SRAM. I succeed to restore the variables even
>after the power failure. I used "Protected" keyword &
>_sysIsSoftreset(). Thanks for a sample code.
> Could you tell me about, How many no. of variable I
>can restore in the battery back up SRAM?
> In RABBITBIOS.c it is mentioned as BBRAMDATASIZE is
>Zero. Please, tell me HOW many variables I can
>restore from the battery back up SRAM? Is there any
>setting to do this?
>
>With regards,

On the 3010 all RAM is battery backed. You don't need the protected keyword
or use _sysIsSoftReset(). I use it on boards without it.

The protected is used to restore multi-byte variables if the system is
reset in the middle of an update. It slows code down as it has to make 2
copies of the data. I prefer to use simpler measures.

All of RAm is battery backed on the 3010. Even memory xalloc()'ed. I use
87k of battery-backed data on a RCM2200 (128k RAM). Same code runs on the
3010 or 3700.

The is a bios option to clear RAM on start up. This is normally disabled.
Otherwise, all RAM on boards witout fast RAM is untouched on a reset.
<Scott>

------
| Scott G. Henion| shenion@shen... |
| Consultant | Stone Mountain, GA |
| SHDesigns | PGP Key 0xE98DDC48 |
| http://www.shdesigns.org/rabbit/ |
------ --
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.11 - Release Date: 5/16/2005



_____________________________
 Free pdf download: What Every Programmer Should Know About Memory.