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 / 5644
5643  |  5645
Subject: 
Re: Sharp GP2D02 and assembly language
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Tue, 23 Feb 1999 20:14:15 GMT
Original-From: 
Thomas Heidel <theidel@NOSPAMadvis.de>
Viewed: 
1028 times
  
Hi,

I have the same problem. For now I don't care since
the GP2D02 is the only thing connected to an digital output.

I am using the following:

Include:

subroutine_get_userval:
       ldab    USERVAL  ; load USERVAL to d register
       clra             ; clear upper byte
       rts              ; return value in d

to Fred's libexbd.asm; read it from an ic-program and pass it
to your gp2d02-routine.

I agree, it is not very nice too, and you can't use it from
an assembler routine either. The alternative way would be to
reserve a byte in pcode_hb.asm (like "beeptone" at 0x26).
Even less sexy :-(
... unless Fred would do it in version 2.8x of pcode.asm ;-)



Thomas.





Barry Brouillette wrote:

Hi,
I've written a short assembly language routine to access the Sharp GP2D02
sensor and it works just great but...  I have one question.

Since I use the expansion board's digital outs to control the sensor I
need to make sure my routine doesn't stomp on any other digtal outs in
the process.  I used Fred's libexbd.asm to see how to do digital outputs.
Apparently, you can't read the output latch back in so he keeps a local
variable USERVAL to keep track of which outputs are set.

My question is this: How can my assembly program access Fred's USERVAL so
that my program can also know what bits are set by Fred's set_digital_out
routine?

I assume that I could simply #include libexpd.asm in my program and use
the resulting .icb file in place of both his libexpbd.icb and my
GP2D02.icb but that seems kludgy to me and difficult to explain when
posting the code.  Any ideas?

Barry



Message is in Reply To:
  Sharp GP2D02 and assembly language
 
Hi, I've written a short assembly language routine to access the Sharp GP2D02 sensor and it works just great but... I have one question. Since I use the expansion board's digital outs to control the sensor I need to make sure my routine doesn't (...) (26 years ago, 23-Feb-99, to lugnet.robotics.handyboard)

2 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