DPRG
DPRG List  



DPRG: Getting LEDs to light up on port D of BB2

Subject: DPRG: Getting LEDs to light up on port D of BB2
From: Tod Dow todman at icon.net
Date: Wed Jun 2 21:51:09 CDT 1999

Hi my name is Tod Dow and I live in Oklahoma City.  I bought two
Botboard2's a couple of years ago.  One has a MC68HC11A1FN and the other
has the
MC68HC11E1FN.  Both appear to be working as the LED blinks and they make
clicking noises.  I no longer get communication errors through the
serial cable.
I am trying to get my first program to run.  I want to light all leds on
port D as described in the Mobile Robots book by Jones and Flynn.   If
you could point out
my problem I would really appreciate it.  I know there are alot of
variables that could be wrong so I will try to be as complete as
possible.

First Ihook up power
Set to Bootstrap mode
Connect serial cable
Turn power on
Hit reset button

Start PCBUG
Control base hex
loads ledptd.s19
Switch to expanded multiplexed mode
Hit reset then check the pins on port D with a 22k resistor and led.
Only one or two of the leads lights up so I don't think the program is
working.  I also get an
error message after trying to assemble the file.  LEDPTD.ASM is listed
below.  I don't know alot about programing the EEPROM yet so I am trying
to load the
program into the 32k external memory.

LEDPTD.ASM

* This code should light all leds on port d
                    ORG $8000                   ;START PROGRAM AT MEMORY
ADDRESS $8000
PORTD        EQU $1008                   ;LABEL ADDRESS $1008 "PORTD"
                     LDAA #%111100        ;LOAD BINARY NUMBER %111100
INTO ACCUMULATOR A
                    STAA $1009                 ;STORE INTO MEMORY MAPPED
REGISTER DDRD TO SET PD2-5 AS OUTPUT, PD0-1 AS INPUT
                    CLR PORTD                 ; CLEAR PORTD
                    STAA  PORTD              ;STORE %111100 INTO PORTD
SETTING PD2-5 HIGH




LEDPTD.LST FILE
M68HC11 Absolute Assembler   Version 2.70d:\mobot\pcbug\ledptd.ASC


1 A                 * This code should light all leds on port d
2 A           FFEE                   ORG       $FFEE
3 A FFEE 8000                    FDB       $8000
4 A           1008  PORTD      EQU       $1008
5 A FFF0 863C                    LDAA      #%111100
6 A FFF2 B71009               STAA      $1009
7 A FFF5 7F1008                CLR       PORTD
8 A FFF8 863C                    LDAA      #%111100
9 A FFFA B71008               STAA      PORTD
** ERROR 205                     ^

SYMBOL TABLE:  Total Entries=    1

PORTD               1008

Total errors: 1

I have also tried this variation of the program without any luck:
                    ORG $FFEE                  ;NEXT DATA WILL BE STORED
IN THE RESET VECTOR
                     FDB $8000                    ;STORE LOCATION OF
START OF PROGRAM
PORTD        EQU $1008                   ;LABEL ADDRESS $1008 "PORTD"
                     LDAA #%111100        ;SET PD2-5 AS OUTPUT, PD0-1 AS
INPUT
                    STAA $1009                 ;STORE INTO MEMORY MAPPED
REGISTER DDRD
                    CLR PORTD                 ; CLEAR PORTD
                    STAA  PORTD              ;STORE %111100 INTO PORTD
SETTING PD2-5 HIGH


This is a very simple program but I seem to be missing something
important.  Do you see any obvious errors?  If I can get this one
program to run I can start to
modify it and explore the programing environment.

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

More information about the DPRG mailing list