To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 2368
2367  |  2369
Subject: 
RE: [long] Interrupt programming, buggy code
Newsgroups: 
lugnet.robotics.rcx
Date: 
Tue, 2 Mar 2004 16:04:08 GMT
Reply-To: 
<rhempel@bmts.com&saynotospam&>
Viewed: 
3435 times
  
Having fun yet :-)

There are a few things you might want to keep in mind when
writing ISRs for the RCX...

First, avoid calling into the ROM from an interrupt handler.
You never know how long they take, and you may
in fact be hitting another OCIA interrupt while you're in the
ROM code.

Second, clear the OCIA flag just before you exit the ISR, not at
the beginning. This avoids receiving another interrupt while
you're processing the first one...

Third, some of the ROM routines have a bug that occurs when the
stack pointer is right on a 256 byte boundary. I can't remember
which ones, exactly... :-(

Fourth, update the LCD in the main routine.

Good luck!

--------------------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.hempeldesigngroup.com/lego/pbForth>

Buy "Extreme Mindstorms: an Advanced Guide to Lego Mindstorms"
<http://www.amazon.com/exec/obidos/ASIN/1893115844/hempeldesigngrou>
--------------------------------------------------------------------
Reply to:      rhempel at bmts dot com
--------------------------------------------------------------------



Message is in Reply To:
  [long] Interrupt programming, buggy code
 
Hi all, I am currently programming the Lego RCX at low-level (plain C) using the GCC cross-compiler for Hitachi H8/300 and Kekoa Proudfoot's LibRCX. In fact, I'm designing exercises for students that learn micro-controller programming. Therefore, I (...) (21 years ago, 2-Mar-04, to lugnet.robotics.rcx)

7 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