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 / 444
443  |  445
Subject: 
Main ROM routine
Newsgroups: 
lugnet.robotics
Date: 
Wed, 11 Nov 1998 08:45:44 GMT
Original-From: 
Kekoa Proudfoot <kekoa@Graphics.Stanford.EDU>
Viewed: 
2698 times
  
I have finally found the time to decode the obvious ROM routine, the OCIA
handler, which is triggered by the timer every 1/1000 second.

See http://graphics.stanford.edu/~kekoa/rcx/#Rom, search for the second
occurance of:

36ba - OCIA handler

Also be sure to see the lists of data values higher up, as I have assigned
meanings to data addresses there, but not necessarily below.

I have yet to do the obvious next step, which is to process related
interrupt handlers.

Interesting notes:

To do preemptive multitasking the correct way - without wasting another
timer and without reprogramming any timers - override the OCIA interrupt
vector at fda2.  Call the original handler in ROM to get the original
functionality, and then add your afterward too.

High-level sound processing is implemented in this routine.  Tables in
[3f46, 3fc2) describe the sounds using three arrays per sound.  The first
(e.g. 3f5c-3f66) contains pitch values, terminated with a 01.  In this
first array, 00 indicates silence, increasing numbers are lower pitched.
The second contains durations, in 1/100 sec.  The third contains control
bytes, which select a timer and divider value.  See the H8 specs, page
281.  The bits [3:0] of the control byte are [CKS2,CKS1,CKS0,ICKS0].  Set
bites [7:4] of the control byte to zero.

You can hack new sounds if you like, by carefully tweaking the
functionality of the OCIA handler.

All other timer-based things are done in this routine, including firmware
task wake-up, sensor sampling, and motor PWM.

To adjust the PWM, you need to override the motor part of the OCIA routine,
which is hardcoded to rotate a single byte per motor, using the LSB to
modulate two control bits stored elsewhere using a 1 ms waveform.  Servo
control will therefore be slightly more difficult to do, as servos require
accurate pulses in the 1-2 ms range, if I remember correctly.

More later.

-Kekoa



1 Message 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