To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 7616
7615  |  7617
Subject: 
Speed.asm problem...
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Tue, 14 Mar 2000 23:11:18 GMT
Viewed: 
1453 times
  
Hello, I am currently using speed.icb/shaft.c (IC v3.2 library files) to
count clicks on optical encoders for my two drive wheels using the Pulse
accumulator and the IC3 interrupt. I noticed that there was an inconsistency
in the _unassembled_  speed.asm file as noted below:

file speed.asm:
<snip>

TFLG1    EQU     $1023

  ORG MAIN_START

subroutine_initialize_module:        /* This module runs whenever a reset
occurs */

     ldd #IC3_interrupt_handler      /* Get 16-bit address of interrupt
handler */
     std $FFEA                       /* Store in IC3 interrupt vector
location */
     cli                             /* Enable interrupts globally */
     rts                             /* Return from initialzie_module
subroutine */


variable_left_clicks:       /* Create right_clicks, a variable accessible by
IC */
     fdb 0                           /* Fill double byte (16 bits).
right_clicks = 0 */

IC3_interrupt_handler:
     ldd variable_left_clicks      /* Get the value in right_clicks */
     addd #1                         /* Add one more encoder count */
     std variable_right_clicks       /* Store back to right_clicks */
     ldaa #%00000001                 /* Clear the IC3 flag by writing a one
*/
     staa TFLG1                      /* Store in TFLG1 to clear IC3 flag */
     rti                             /* Return from interrupt */


<snip>

It appears that the interrupt handler loads "left_clicks" increments it by
1, and then stores it in "right_clicks". This doesn't seem right. Has anyone
noticed this before? Is this the assembled (.icb) version different?


John



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