|
Hi All,
If this is old news, ignore it...
I just figured out this weekend (thanks Kekoa) that the H8/300 stack
pointer (r7) and the power-down function in the RCX have a close
relationship.
The stack pointer MUST be in the on-chip RAM area (0xFD80 to 0xFF7F)
before calling the RCX shutdown_power() function. This is because the
shutdown_power() funtion (I think) deselects the external RAM to put
it into a low-power mode before putting the CPU itself to sleep.
If r7 is pointing outside of the on-chip RAM, then it cannot be
retrieved and the RCX will hang, and in such a nasty way that you
will have to remove the batteries for about 5 minutes - not a few
seconds like normally.
This is especially important for users of legOS and pbFORTH since we
are likely to allocate task stacks or put the stack pointer outside of the
small 512 byte stack area.
Cheers,
Ralph Hempel - P.Eng
------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.bmts.com/~rhempel/lego/pbFORTH/default.html>
------------------------------------------------------
Reply to: rhempel at bmts dot com
------------------------------------------------------
|
|
Message has 1 Reply:
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|