Newsgroups: comp.robotics
Path: brunix!sgiblab!sgigate.sgi.com!olivea!spool.mu.edu!howland.reston.ans.net!cs.utexas.edu!uunet!butch!NewsWatcher!user
From: farnham@lmsc.lockheed.com (Greg Farnham)
Subject: 68HC11 programming
Message-ID: <farnham-140294132949@129.197.52.35>
Followup-To: comp.robotics
Sender: news@butch.lmsc.lockheed.com
Organization: CIEM
Date: Mon, 14 Feb 1994 21:30:34 GMT
Lines: 61

I need a little help debugging a 68HC11 board.

Here is some background.
I am using a BotBoard (2"x3" 68HC11 board in single chip mode) the board
has a 68HC11A1 (512 bytes EEPROM begining at $b600).  In addition, I have a
TI equivalent of the SGS L293D motor driver chip which is being used to
drive the 2 motors of the DinoTrack (from Radio Shack).

I am using 2 separate power supplies for logic and motor driving, both are
4 AA alkalines.

With the help of an inverting buffer, the motor driver chip is connected to
the top 4 bits of Port B.
B4(16) - Right Motor Enable
B5(32) - Right Motor Direction 0=forward, 1=backward
B6(64) - Left Motor Enable
B7(128) - Left Motor Direction 0=forward, 1=backward

With this configuration, the following values output to port B ($1004) have
the following effect.

16 - Right Motor Forward
64 - Left Motor Forward
80 - Both Right and Left Motors Forward
240 - Both Motors Backward
etc, etc, etc

I can successfully control these motors from within PCBUG.  For example, I
type "ms $1004 80" and both motors go forward.  I type "ms $1004 0" and
they both stop.

I wrote a simple assembly program to turn on the right motor, delay, turn
on the left motor and delay.   I compile it with asmhc11 and download it
with PCBUG (eeprom erase bulk, loads test).   The program loads
successfully and can be disassembled(@ $b600) using the asm command in
PCBUG.

Finally, the problem.  
When I run the progam either by typing call $b600 or by removing the rs232
and resetting with the reset jumper on, the program doesn't behave
properly.  It doesn't turn the right motor on.  It turns the left motor on,
delays and then turns both motors on.

Am I missing something simple?  Does anyone have any suggestions?

One question I have is the reset vector (two bytes at $FFFE and $FFFF). 
When I look at the 68HC11 it shows the value $E000.  If thats where it
starts executing at reset, how does it get to $b600 (start of eeprom)?


_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Greg Farnham      InterNet: farnham@lmsc.lockheed.com  _/
_/  Of Course,  all comments are mine, not the company's  _/
_/                                                        _/
_/ IMPROVEMENT CANNOT TAKE PLACE WITHOUT CHANGE           _/
_/                                                        _/
_/ Lockheed Missiles and Space co.                        _/
_/ O/74-12 B/150                                          _/
_/ 1111 Lockheed Way.                                     _/
_/ Sunnyvale, CA   94089-3504   Voice: (408) 742-4234     _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
