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 / 2156
2155  |  2157
Subject: 
legOS ... really a stack question
Newsgroups: 
lugnet.robotics
Date: 
Sat, 2 Jan 1999 20:49:14 GMT
Viewed: 
1307 times
  
I'm still having reliability problems with legOS when
using the task management routines. However, I think
the problem has more to do with the stack than the
tm routines. I think the problem is related to the
direct-motor routines and the entries in h8300.rcx file.

I noticed that when I have more than a couple of
tasks and one of them uses the direct-motor fuctions
the program flakes out.  Looking at the direct-motor.c
I noticed that it uses the following asm instruction:

   mov.b r6l, @0xf0000:16

I'm not an assembler language programmer, so correct me
if I'm wrong.  I'm assuming that this moves one byte from
the low word of register 6 into address location 0xf000.

Then I noticed that in the h8300.rcx file the stack
starts at 0xfefc.  I'm assuming this is the top of
the stack and that it should grow downward towards the
heap which ends at 0xcc00.  Let's just ignore the stack
and the heap colliding for now.

If both of my assumptions above are correct won't the
direct-motor routines stomp the stack.

I changed the topram entry in my h8300.rcx to be 0xef00 instead
of 0xfefc.  This made the program run without any problems.
Was I just lucky or are my assumptions correct?



Message has 3 Replies:
  Re: legOS ... really a stack question
 
(...) Hmmm ... good point. 0xf000 is memory mapped I/O for the motors, IIRC. Not sure whats above there, but I wouldn't be surprised to hear it isn't a good place to store things. I'd guess that setting the stack to 0xeffe should be equally good. (...) (25 years ago, 2-Jan-99, to lugnet.robotics)
  Re: legOS ... really a stack question
 
(...) Looking at my memory map, it appears that there is space for the stack in on-chip memory between fdc0 and ff7e (or thereabouts). That's just about 450 bytes. If you need more stack space than that, you'll need to move the stack to off-chip (...) (25 years ago, 2-Jan-99, to lugnet.robotics)
  Re: legOS ... really a stack question
 
(...) Correct, that is where the motor driver chips live. It isn't actually RAM. (...) The _stack symbol defined by the linker is normally used by crt0 to set the initial stack pointer. In this case, the stack pointer isn't changed by legOS (...) (25 years ago, 3-Jan-99, to lugnet.robotics)

10 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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