DPRG
DPRG List  



FW: GP2D02 code for the HC12B32

Subject: FW: GP2D02 code for the HC12B32
From: Jordan, Robert L. (MCI) Robert.L.Jordan at mci.com
Date: Thu Feb 11 17:03:57 CST 1999

BJ 
FILE  DPRG GROUP BUY /IRRANGER
BJ
erich at erich.seanet.com

- -----Original Message-----
>From: Ted Griebling [mailto:erich at erich.seanet.com] 
Sent: Wednesday, February 10, 1999 9:52 PM
To: srs-list at wipd.com
Subject: GP2D02 code for the HC12B32


Well, One disadvantage of getting the Sharp GP2DO2 sensor before everyone
else (I'll be distributing them to those who ordered at the next meeting)
is that I don't get the luxury of gleaning off other's work.  I had to do
some homework for myself. 

I have posted (on my web page below) the assembly code I wrote to interface
the sensors with the 68HC12B32 microcontroller. This code is not optimized
at all. Based on the HC11 code written by Tom Dickens, it is intended to be
for example purposes only--illustrating the timing requirements when using
a controller faster than a HC11 or basic stamp. The output of the sensor
(range to an object) is stored as the duty cycle in one of the PWM
channels. On an oscilloscope, the sensor output is represented as a nice
variable pulse width. I am really impressed with this sensor's
functionality and it's cute, modular package. There is a lot of potential
in these little brown rectangles. 

Although, I was a little frustrated at how much effort it took me to get
this code to work, while looking at other examples that say something like
"then you simply shift the bits in." Everything finally started to work
when I understood the implications of the fact that the B32 board is
running significantly faster than the controllers in the other examples.
Enclosed in code, are ranges for the required wait loops, for anyone who
may want to play with the values.

Have fun, Ted

**************************************************************
Erich T Griebling (Ted)                 erich at erich.seanet.com
(206)547-2394                    http://www.seanet.com/~erich/
3938 Bagley Ave N, Seattle WA 98103
**************************************************************

- ------_=_NextPart_000_01BE5612.D0BACA18
Content-Type: application/ms-tnef
Content-Transfer-Encoding: base64

eJ8+IgQXAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy
b3NvZnQgTWFpbC5Ob3RlADEIAQkABAACAAAAAAAAAAEIAAUABAAAAAAAAAAAAAEFgAMADgAAAM8H
AgALABcAAwA5AAQAOgEBIIAD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VUEJVWS9JUlJBTkdFUkJKRVJJ
Q0hARVJJQ0hTRUFORVRDT00tLS0tLU9SSUdJTkFMTUVTU0FHRS0tLS0tRlJPTTpURURHUklFQkxJ
TkdNQUlMVE86RVIAAAAAAgF/AAEAAAA/AAAAPEU3MjhGRUY4NDZFOUQxMTE5Mjg0MDAwMEY4MDMz
M0YzMDE2ODIxRjRAY29zZXhjaDAwNS5tY2l0LmNvbT4AALUe

- ------_=_NextPart_000_01BE5612.D0BACA18--


- --------------31604E2C296ACD62E4BCB664--

------------------------------


More information about the DPRG mailing list