Subject:
|
Re: Can the Run button be reprogrammed?
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Thu, 10 Feb 2005 00:15:26 GMT
|
Viewed:
|
5762 times
|
| |
| |
In lugnet.robotics.rcx, Ralph Hempel wrote:
> > BrickOS does allow you to configure how the buttons are used. The RUN and Power
> > buttons are read in the BrickOS "firmware", so you'd need to change the kernal, if
> > you want to do other things with them, but it is very possible.
>
> Not to put too fine a point on it, but RUN, PRGM and VIEW are read from
> an I/O port, while the ON/OFF button is tied to an interrupt line.
>
> That's what lets you wake the RCX up from a deep sleep, which you can't
> do with the other buttons.
>
> Ralph
Ultimate Robolab provides very easy access to the RCX buttons. With a few
icons you can reprogram any of them. Here a nice example :
http://www.convict.lu/Jeunes/ultimate_stuff/reprogram_run_button.gif
Anytime you press the Run-button in this example, you'll here a sweep down
system sound.
This is the philosophy of Ultimate Robolab : with minor efforts, the RCX
is yours.
Note that normally pressing the RUN-button during program execution
generates an interrupt and causes the RCX microcontroller to jump to a
special RUN-button interrupt handler. The On/Off-button does not produce
any interrupt while the firmware is running (the button only is regularly
checked about its state). But, at a shut-down, things do change : in that
case the On/Off interrupt is configured after the disabling of the
RUN-button interrupt.
By the way : in rare cases this particular interrupts-flipping contributes to an
aweful crash of the RCX. Several times people from the Luxemburg Museum of
Natural History, who are the actual owners of our LEGO robot GASTON, reported
that kids manipulated the robot in a way to produce this mysterious crash :
having continuously pressed the ON/OFF and the RUN-buttons with running
GASTON-program -based on the standard RCX firmware- the "Front"-RCX fell into a
state, which first was interpreted as "they killed the RCX": nothing worked
anymore, even taking off the batteries does not help. The RCX seemed dead. In
fact, after a certain time only, may be several minutes, depending on the RCX
issue, the RCX recovered. What happened?
First we tried to reproduce the crash. Hmm, difficult... But after numerous
tests it became obvious : probably due to pending interrupts -yes, they exist
with the H8 - it is possible that some unexpected functions are executed causing
the RCX to only partially shut down and go to sleep with H8 Port 5 pin 2 set to
High at the wrong moment. Normally this code is executed only right before
calling the sleep command. By some miracle however -name it Murphy**2- the code
is executed without the sleep, or more likely with a sleep followed by an
immediate rewaking. Anyway, the fatal result is that Port5,2 is High, which
means that the RCX has reduced the power supply. Especially the RAM isn't
powered anymore and the H8 is lost in an endless wait state.
You can easily reproduce the crash by setting @FFBA,2 to HIGH. If the display
is cleared with RCX1.5, it might need quite a long time before the capacitors
are empty.
Are there other hypothesis for this crash?
|
|
Message is in Reply To:
| | Re: Can the Run button be reprogrammed?
|
| (...) Not to put too fine a point on it, but RUN, PRGM and VIEW are read from an I/O port, while the ON/OFF button is tied to an interrupt line. That's what lets you wake the RCX up from a deep sleep, which you can't do with the other buttons. Ralph (20 years ago, 9-Feb-05, to lugnet.robotics.rcx)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|