To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 4486
4485  |  4487
Subject: 
Re: RIS memory usage
Newsgroups: 
lugnet.robotics
Date: 
Thu, 8 Apr 1999 21:29:45 GMT
Viewed: 
1261 times
  
Mark Ferris <mdf@teleport.com> wrote:
I'm anxiously awaiting the time when I can buy my Mindstorms package,
but until then I'm spending time learning about it.  One thing that
has gotten me a little confused is how the RCX brick uses memory.  I
keep reading about the memory usage being: 16k ROM, 512 bytes of SRAM
for firmware, and 32k of SRAM for user code and other applications.
Yet I also have run across mention of only 6k being available for user
code, the rest of the 32k being full of firmware.  So which is it?

Being an embedded systems programmer myself, 16k of ROM seems ample
for the OS required, does the Mindstorms OS also spill over into that
much of the 32k of SRAM?

The RCX has a 64k address space.  Here is how it is split up:

Addr  Len   Usage
0000  4000  On-chip ROM
4000  4000  Reserved (for on-chip ROM of other chip models)
8000  7b80  External RAM
fb80  0200  Reserved (for on-chip RAM of other chip models)
fd80  0200  On-chip RAM
ff80  0008  External RAM
ff88  0078  On-chip registers

The on-chip ROM contains drivers for the RCX.
The off-chip RAM holds the firmware and all of its data, plus some ROM data.
The on-chip RAM holds the stack, plus more ROM data.

The H8 specs say you can configure the chip so that the 0400 bytes starting
at fb80 also map to external RAM, but there are issues with placing the
stack in external RAM (which you might not care about).  The issues have to
do with placing the RAM in low-power mode when putting the H8 into sleep
mode.  You will probably want to use low-power mode when putting the H8 to
sleep; if so, the stack must live on-chip RAM when you do this, since the
interrupt handler that runs after coming back from sleep needs to access
the stack, which will not exist if the stack is off-chip and off-chip RAM
is in low-power mode.  Thinking about this, you can probably move over to
on-chip RAM just for the sleep if you're really desparate for the extra 1k
you get by doing this, and are willing to pay the speed hit for off-chip
stack accesses, and are willing to code this up, which may or may not be an
easy task, depending ...

In any event, the ROM expects to use the range of addresses ee5e-efff as
scratch space, and also makes use of the fd80-fdbf range.  The stack fills
downward from the word at ff7e; fdc0 is the last valid stack address.

In the case of the LEGO firmware, the "firmware and all of its data" is
split into 16k of actual code (counting some zero padding) and 6,842 bytes
of data, of which exactly 6k are used for user data (programs, subroutines,
and datalog entries).  The remaining storage space is unused.

In the case of custom firmware, exactly how much you have available to you
depends on whether or not you care to use the routines in ROM and how you
choose to deal with the power issues I mentioned earlier.  You have at
least 27k available in all cases.

-Kekoa



Message is in Reply To:
  RIS memory usage
 
I'm anxiously awaiting the time when I can buy my Mindstorms package, but until then I'm spending time learning about it. One thing that has gotten me a little confused is how the RCX brick uses memory. I keep reading about the memory usage being: (...) (26 years ago, 7-Apr-99, to lugnet.robotics)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
18 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR