PCBUG11 Primer

Copyright: This document is copyright 1994 by
Thomas P. Dickens (thomas.p.dickens@boeing.com), written for the direct use of my students at Henry
Cogswell College. It may be distributed freely in verbatim form
provided that no fee is collected for its distribution (other
than reasonable reproduction costs) and that this copyright
notice is included. Enjoy...

Purpose:

The purpose of this document is to provide you
with minimum working information about the Motorola PCBUG11
monitor program, directed for use with the Motorola 68HC11E1
micro controller. It is NOT intended to teach you assembly
programming, HC11 internals, or to be a complete a reference for
PCBUG11. The information is compiled from Motorola's
"PCbug11 User's Manual", Motorola document number
M68PCBUG11/D2, second edition, September 1992.

Contents:

Files required

Invoking PCBUG11

The few commands needed to work

Startup files

Hardware setup

Sample PCBUG11 session

1) Files required: These can be found on
various electronic bulletin boards. I am using version 3.24a,
1991. I don't have a record of version numbers and differences.

PCBUG11.EXE The PCBUG11 program executable.

PCBUGTRN.EXE User-definable return program.

CODES.P11 Mnemonic tables for
assembly/disassembly.

OFFSETS.P11 Mnemonic tables for
assembly/disassembly.

TALK??.BOO Talkers using SCI interrupt.

TALK??.XOO Talkers using SCI interrupt.

PCBUG11.HLP PCBUG11 help information.

All of these files should reside in the same
directory.

2) Invoking PCBUG11: If you just type PCBUG11,
you will be prompted for different options including chip type
and which PC serial port (1 or 2) you are using (see secion 6,
Sample PCBUG11 session, for the series of prompts and basic
answers). You will then see the complete command line to use next
time to get the same options. I usually take this line and put it
in a 1-line .bat file, called PCBUGE1.BAT or PCBUGA1.BAT for the
different chips types (see section 4).

3) The few commands needed to work:

In my sessions with PCBUG11, there are only a
handful of commands I use regularly. I will detail those here.
Refer to the PCBUG11 help file (PCBUG11.HLP) for information on
the other commands.

I know PCBUG11 offers other advanced
capabilities, but my these get the job done. And when combined
with startup files to set my options, it makes for an easy to use
environment.

4) Startup files:

To make PCBUG11 as easy to use as possible I
have configured a few startup files. This way I can forget how to
use PCBUG11, and when I need it a couple of weeks later I can
still use it.

====== File: PCBUGE1.BAT ======

pcbug11 -e port=2 macro=startup

====== End-Of-File ======

====== File: STARTUP.MCR ======

DEFM AUTOSTART

BEGIN

CONTROL BASE HEX

EEPROM B600 B7FF

EEPROM DELAY 12

LOADS E1MM

END

====== End-Of-File ======

====== File: E1MM.ASM ======

* Clear the BPROT register to allow writing
into EEPROM space.

ORG $1035

FCB $00

====== End-Of-File ======

Note: E1MM.ASM must be assembled using AS11.EXE
to generate E1MM.S19.

With these files in the same directory as my
PCBUG11 files, all I enter is 'PCBUGE1' and PCBUG11 will come up
ready to talk to an E1 chip, in HEX mode, with the EEPROM range
and delay set, and the HC11 BPROT register cleared. Without the
BPROT register cleared, the HC11 will not accept any data in it's
EEPROM.

5) Hardware setup: The 68HC11 is designed to
communicate to a host computer using serial communications. This
can easily hook up to a PC running AS11 and PCBUG11. To convert
from 5 volt TTL logic to RS-232 voltage levels, a MAX-232 or
MAX-233 chip can be used. Their differences are; the 233 chip
costs more, but does not require external capacitors. The MAX-233
chip can be wired inside of a hood of a 25-pin connector to save
space.

6) Sample session: We will create code to do a
slow binary count on port B of the HC11. Monitor the port B pins
with LEDs (with current-limiting resistors of course) or other
methods to see the port.

6.1) Create an assembly language program:

====== File: COUNT_B.ASM ======

* This code will perform a binary count on Port B

PortB EQU $1004

ORG $B600 ; Start of HC11E1 EEPROM

clr PortB ; set port B to zero

Main inc PortB ; Add 1 to port B

ldx #$4000

Delay dex ; X = X - 1

bne Delay

bra Main

====== End-Of-File ======

6.2) Assemble the code: This generates the file
COUNT_B.ASM

C:\AS11 COUNT_B.ASM

6.3) Connect your HC11 to your PC. Power on the
HC11 circuit in BootStrap mode. It should now be waiting to hear
from the PC.

6.4) Start PCBUG11

C:\PCBUG11

Answer the prompts to get into the program:

Is the talker installed on your board? (Y/N) : N

Do you wish to use the XIRQ interrupt? (Y/N) : N

MCU boot talkers available (list of HC11 CPUs)

Which device are you using? : D (PC types in -E)

Do you wish to load a macro automatically? (Y/N) : N

PC communications Port 1. COM1 2. COM2

Which communications port are you using? : 2 (depends on your PC)

Are you using an 8 MHz crystal? (Y/N) : Y

At this point PCBUG11 should initialize the
HC11 and present you the prompt: