M68Hc11 Pcbug11 User'S Manual: December 1996
M68Hc11 Pcbug11 User'S Manual: December 1996
M68PCBUG11/D
REV 3
December 1996
Freescale Semiconductor, Inc...
M68HC11 PCbug11
USER'S MANUAL
Motorola reserves the right to make changes without further notice to any products herein to
improve reliability, function, or design. Motorola does not assume any liability arising out of the
application or use of any product or circuit described herein; neither does it convey any license
under its patent rights nor the rights of others. Motorola products are not designed, intended, or
authorized for use as components in systems intended for surgical implant into the body, or other
applications intended to support or sustain life, or for any other application in which the failure of
Freescale Semiconductor, Inc...
the Motorola product could create a situation where personal injury or death could occur. Should
Buyer purchase or use Motorola products for any such unintended or unauthorized application,
Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and
distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney
fees arising out of, directly or indirectly, any claim of personal injury or death associated with
such unintended or unauthorized use, even if such claim alleges that Motorola was negligent
regarding the design or manufacture of the part. Motorola is a registered trademark of Motorola,
Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
CONTENTS
M68PCBUG11/D iii
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
CONTENTS
iv M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
CONTENTS
M68PCBUG11/D v
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
CONTENTS
A.1 INTRODUCTION............................................................................................................A-1
A.2 CIRCUIT DIAGRAM AND COMPONENTS LIST ........................................................A-1
vi M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
CHAPTER 1
GENERAL INFORMATION
1.1 INTRODUCTION
M68HC11 PCbug11 is a software package for easy access to and simple experimentation with
Freescale Semiconductor, Inc...
M68HC11 microcontroller unit (MCU) devices. PCbug11 lets you program any member of the
M68HC11 MCU family and examine the behavior of internal peripherals under specific
conditions. In addition, you may run your own programs on the MCU; breakpoint processing and
trace processing are available.
This manual explains how to install and run PCbug11, version 3.24, as well as how to correct
common problems. (A user who has a later version of PCbug11 should check for any version
information notes attached to the end of this manual. Such notes contain information about any
changes from the information of the main text.)
Motorola supplies the software on a 360-Kbyte, IBM PC compatible master disk. You must
install this software on the hard disk of your computer, per paragraph 1.2.1.
Optionally, if your computer does not have a hard disk, you may run PCbug11 from
a flexible disk, per paragraph 1.2.2.
M68PCBUG11/D 1-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
In these instructions, drive A is the flexible disk drive and drive C is the hard disk. Follow these
steps to install the software on a hard disk:
1. Insert the master disk in drive A.
2. Make drive C the default drive (if it is not so already) by typing
C: [RETURN]
3. Create a new subdirectory by typing
md \PCBUG11 [RETURN]
Freescale Semiconductor, Inc...
This completes software installation. You may run PCbug11 from anywhere in the hard-disk
directory structure by using the DOS PATH command to include the C:\PCBUG11 subdirectory
in your path. (See DOS documentation for details on the PATH command.)
These instructions are for a computer that has two flexible disk drives. Drive A is a 360-Kbyte
flexible disk drive. Drive B is the second flexible disk drive. You need a freshly formatted disk,
which will become your work disk.
This completes software installation. You may run PCbug11 from the work disk in drive A.
1-2 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
PCbug11 is sophisticated software that takes many possible options. The computer port used, the
crystal used, and any macros used determine which options are possible for a specific MCU.
Freescale Semiconductor, Inc...
To run the software, enter the startup command. The simplest run command is for an
MC68HC11A8, MC68HC11A1, or MC68HC11A0 MCU, with the XIRQ and PD0 pins
connected:
PCBUG11 -XA
To run other MCUs of the M68HC11 family, alter the final one or two characters of this run
command, per Table 1-1. (As most M68HC11 MCUs have E9 type bootloaders, the -XE option
is the more frequently appropriate.) An X in the run command means that the XIRQ and PD0
pins must be connected (do not use the X option if PCbug11 is used with an EVBU board).
NOTE
The default number base of PCbug11 is 10. To change the default
base to 16, enter the command CONTROL BASE HEX. To
change the default base to 2, enter the command CONTROL
BASE BIN. To change the default base back to 10, enter the
command CONTROL BASE DEC. The CONTROL command
explanation, in Chapter 3, gives more information.
M68PCBUG11/D 1-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
MC68HC11A0, PCBUG11 -A
MC68HC11A1, or or
MC68HC11A8 PCBUG11 -XA
MC68HC11D3 or PCBUG11 -D
Freescale Semiconductor, Inc...
MC68HC711D3
MC68HC11E0, PCBUG11 -E
MC68HC11E1, or
MC68HC11E9, PCBUG11 -XE
MC68HC11E20,
MC68HC11F1,
MC68HC11G5,
MC68HC11G7,
MC68HC11L6, or
MC68HC811A2
MC68HC711E9 PCBUG11 -E
MC68HC11K4, PCBUG11 -K
MC68HC711K4,
MC68HC11N4, or
MC68HC11P2
Hardware status appears on the computer screen. This screen consists of four major areas, or
windows:
1. Main window. This window is the upper half of the screen. If you have a color screen,
the main window has white text on a blue background. This window displays the most
information about PCbug11 operation: command results, memory contents, assembly
opcodes, macros, and so forth.
2. Register window. This window is in the center of the screen. If you have a color
screen, the register window has white or yellow text on a red background. This
window shows the last recorded contents of the processor registers. Note that register
window values update only upon startup or user request. PCbug11 commands let you
modify the contents of the registers.
1-4 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
3. Status window. This window is at the center right of the screen. If you have a color
screen, the status window has white text on a purple background. This window shows
the MCU in use; the MCU state (running, stopped, tracing); the status of the RS232
RTS line, and the current user-set interrupt vectors.
4. Command window. This window is at the bottom left of the screen. If you have a
color screen, the command window has white text on a black background. Use this
window for entering and reading commands to PCbug11. The command cursor (the »
character) is at the bottom line of this window; commands you enter appear after the
command cursor. Previous commands and the latest error message also appear in the
command window.
Freescale Semiconductor, Inc...
If your screen does not show these windows, the program is not running correctly. A DOS error
message or a PCbug11 error message indicates the problem. See paragraph 1.3.3 or Appendix B
for guidance on corrective action. If your screen does show these four windows, proceed to
paragraph 1.3.4 to try some simple commands.
There are two additional, temporary windows, which appear superimposed over the
main window:
1. Error window. This window indicates any errors or incorrectly operating
communications to the MCU. If you have a color screen, the error window has red
text on a black background. To clear the error window immediately, press any key.
(Or wait five seconds and the error window clears itself.)
2. Help window. This window displays help information requested via the HELP
command. If you have a color screen, the help window has white text on a black
background. To scroll through the help information, use the up-arrow, down-arrow,
page-up, and page-down keys. To clear the help window, press the ESC key.
If the software did not start up correctly, the register screen shows rows of characters X instead
of values, and one or more error messages appear in the command window. Appendix B explains
the full meaning of such an error message.
M68PCBUG11/D 1-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
In the case of an initial startup, however, the most likely problems are a poor communications link
or an incorrect hardware setting. Make sure that:
• A 5-volt signal is supplied correctly to the user hardware.
• An 8 MHz crystal is installed in the circuit.
• The communications cable is wired correctly.
• The MCU is in bootstrap mode and is reset.
• The cable is connected to the COM1 port of the computer (or the guidance of
paragraph 2.2 is followed if the cable is connected to the COM2 port).
Freescale Semiconductor, Inc...
After checking these items, try again to start the system. If numerical values appear in the register
window and there are no error messages, PCbug11 is working correctly. Proceed to the simple
commands of paragraph 1.3.4.
This paragraph explains a few simple commands that demonstrate PCbug11 operation. (Paragraph
3.2 explains the full PCbug11 command set.)
<CTRL>R This command tests communications between the user hardware and the
computer. If communications are operating correctly, the response
Communications synchronized
appears in the main window. Otherwise, the response
Communications fault
appears in the main window.
RESTART This command reloads the communications program and starts afresh, so it
is appropriate any time there is an indication of a communications fault. Be
sure to reset the MCU before typing in RESTART. Note, however, that
this command may lead to the loss of any program in processor RAM.
QUIT This command terminates a PCbug11 session. After you type in QUIT, a
message requests confirmation that you really do want to end the session.
Respond affirmatively, and the session ends.
RD This command displays register contents, letting you read the values.
Should rows of the character X appear instead of values, an error message
identifies the problem.
1-6 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
The PCbug11 design, however, takes advantage of the sophistication of the PC. The
microcomputer need run only a simple program, so the hardware platform also can be simple.
PCbug11 carries out emulator functions via serial communication with the PC.
The monitor communicates with the MCU through a low-level program called a talker. PCbug11
includes different talkers to support different MCUs and different operating modes. All talkers
communicate between the SCI port of the MCU and the serial port of the PC. Each talker
occupies less than 256 bytes of MCU memory space and operates under interrupt. Some talkers
use internal MCU RAM: this approach is the boot method. Other talkers use internal EPROM or
other ROM: this approach is the ROMed method.
In the boot method, the PC downloads the talker into MCU internal RAM for each PCbug11
startup. Such a download happens via the special bootstrap mode of the MCU. In this mode, the
MCU automatically can download a program into its internal RAM and then run the program.
This makes it possible to alter internal values, program memory, read and write to chip ports, and
perform other functions. This simple approach requires no external hardware except a power
supply, an oscillator, and an RS-232C interface. The limitation of the boot method is its use of
about 240 bytes of internal RAM, which may be a problem for some users.
In the ROMed method, the PC synchronizes communication with a talker already running on the
MCU. This means that the appropriate talker must be programmed into internal or external MCU
memory before the user runs PCbug11. The simplest example of using the ROMed method is
placing the talker in external memory and running the talker every time the MCU is powered up.
If the talker is loaded into the MCU's internal EEPROM, no external memory is required.
M68PCBUG11/D 1-7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
GENERAL INFORMATION
As a talker is interrupt driven, residing in the same memory map as user software, the RESET,
XIRQ, and SWI vectors must be reserved for talker code. Note, however, that the SCI vector
may be used instead of the XIRQ vector, to give maskable control to PCbug11.
interrupts or changes interrupt vectors. In the standard approach, the XIRQ pin causes
an interrupt whenever the user needs communications. This gives the user reasonably
free use of interrupts that set the I bit. But the user must be careful when using
breakpoint or trace operations, which also set the I bit. The user also must protect the
interrupt vectors from alteration; changes to these vectors cause loss of
communication with the program.
3. PCbug11 implements trace and breakpoint operations by placing a software interrupt
at the trace or breakpoint location. This means that PCbug11 must be able to modify
the code at such locations: the code must be in (internal or external) RAM or
EEPROM. The monitor cannot operate trace or breakpoints in ROM. This restriction
also applies to FLASH memory, which is not byte programmable. Note that PCbug11
makes use of a little software overhead to handle correctly any user-defined SWI.
(Breakpoints and tracing are not available with D3 or D0 MCUs.)
1-8 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 SOFTWARE
CHAPTER 2
USING PCBUG11 SOFTWARE
2.1 INTRODUCTION
This chapter introduces the user to several possibilities for using PCbug11 software. This
Freescale Semiconductor, Inc...
discussion also covers the runtime command structure and common pitfalls to avoid.
If your circuit uses an 8 MHz crystal, the standard for PCbug11, do not use the <baudrate>
parameter in the runtime command. In this case, the PC communications rate is 9600 baud, and
the download rate for a -<name> talker is 7812 baud.
For a circuit that uses an alternative crystal, the <baudrate> parameter is required:
• For a <boottype> talker, the <baudrate> value is the download rate for the talker. This
value must be to 7812 as the frequency (in MHz) of your crystal is to 8. That is,
• For a <ROMtype> talker, the <baudrate> value is the communications rate for the PC
and MCU. This value must be to 9600 as the frequency (in MHz) of your crystal is to
8. That is,
M68PCBUG11/D 2-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 SOFTWARE
| Indicates or.
? The query option. Enter this option to see a short form of the
runtime command syntax, if you need a reminder.
<baudrate> The baudrate for the PC and MCU if your circuit does not use
an 8 MHz crystal. Paragraph 2.2.1 explains more about this
parameter.
2-2 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 SOFTWARE
As the package runs under interrupt, it is possible to have a program running, but still be able to
read registers, write to registers, and even write to memory. A careful user can even modify the
M68PCBUG11/D 2-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 SOFTWARE
program being run. Note that during modification of a program or registers, the running program
waits for processing of the interrupt caused by PCbug11.
You may set breakpoints in the software, so the MCU stops whenever it reaches that point in the
code. The trace command lets you step through code to examine the execution of instructions,
and see the results in registers and in the condition code register (CCR).
PCbug11 lets the user modify and assemble code into EEPROM as if it were RAM. Although the
MCU has an elaborate routine for programming this memory, PCbug11 handles such
programming in a manner transparent to the user. To make this possible, the user must first use
the EEPROM command to define the area of internal EEPROM. Do not, however, specify
Freescale Semiconductor, Inc...
external EEPROM in this way, as the talker automatically handles slow external memories. There
is a significant difference in response times between writing to EEPROM and writing to RAM.
If you program the CONFIG register, remember that the contents of this register usually are not
readable until after MCU reset. Note that if the MCU is reset in bootstrap mode, certain
automatic functions place the part in an appropriate operating mode. If the MCU has a security
mode, clearing the NOSEC bit protects the internal RAM, internal EEPROM, and the internal
CONFIG register. This means that if the part is reset in bootstrap mode, the value of the NOSEC
bit will be 1.
Follow these guidelines to use interrupts with the hardware. Real-time and other such interrupts
are permitted when the I bit (RTII for the real-time interrupt) is clear and the appropriate
interrupt mask is set. An interrupt sets the interrupt I flag. A CLI or RTI instruction clears this
flag; note however, that the flag for an interrupt source remains set. For a real-time interrupt, this
is RTIF; an exit from a real-time interrupt service routine that leaves RTIF set causes another
interrupt immediately. This means that communications with PCbug11 could stop making sense or
that communications could cease (due to stack overflow).
When real-time measurements or calculations are in progress, remember that reading registers or
memory causes interrupts that interfere with logical program operation. This could upset results,
generating wrong answers. Such wrong answers are particularly likely when the processor is
waiting for the logical value on a port pin to change before carrying out some action. If the
change occurs while PCbug checks the processor status, the change could be lost or upset.
Remember that the MCU does its own self-examination; this self-examination does not affect
programs that perform off-line calculations or other functions.
2-4 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 SOFTWARE
PCbug11 implements breakpoints and traces via software interrupts (SWIs). When program
execution arrives at a breakpoint, an interrupt is generated; the internal talker handles this
interrupt. If the user directly uses the SWI, the SWI vector is called. If the SWI is a true
breakpoint, the PC so informs the user. While this common emulator arrangement is effective, it is
limited to use with RAM or EEPROM; ROM does not accomodate breakpoints or traces. There
is another problem if you reset or restart the MCU while all breakpoints are still set: the SWIs
remain in memory (especially EEPROM), displacing other opcodes. To prevent such a situation,
either clear all breakpoints before resetting or restarting the MCU, or reload your code
immediately after a reset or restart.
In bootstrap mode, PCbug11 puts its talker in MCU internal RAM. Overwriting any of the talker
Freescale Semiconductor, Inc...
software could cause loss of operations or communications with the MCU. Accordingly, you
should not place any user code or data in the same area as the talker.
This rule applies as well to the interrupt vector area of RAM. Interrupt vectors are redirected
from bootstrap ROM; they indicate that communications are required. If the stack is not initialized
to a suitable value, the interrupt vectors could be altered accidentally. For example, if you
initialized the stack to $FF, the first interrupt vector received would overwrite the redirected
vectors, causing loss of communications with the MCU. (Disabling bootstap ROM also causes
communications to fail.)
You may cause problems if you put a G command in a macro, followed by other commands that
modify memory associated with the program. As there is no way to know where the program is in
its execution, a macro may modify memory before or during the program's memory operation.
(Remember that PCbug11 commands operate under interrupts that temporarily halt the program.)
For example, such a situation could change the correct order of value storage in a memory
location, leading to incorrect operation or inaccurate results. To prevent such a problem, do not
use the G command together with a memory modify command in macros.
Also note that different boot talkers initialize the stack to different values, according to the
availability of RAM. These default values are:
Be careful about moving from one processor to another, when the stack pointer value is different.
M68PCBUG11/D 2-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 SOFTWARE
Freescale Semiconductor, Inc...
2-6 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
CHAPTER 3
USING PCBUG11 COMMANDS
3.1 INTRODUCTION
This chapter provides full details about all PCbug11 monitor commands. The first information of
Freescale Semiconductor, Inc...
this chapter explains command-line editing. A table then summarizes all the monitor commands.
Complete information about each command follows, in alphabetical order.
Key Function
<CTRL> End Deletes from the cursor position to the end of the line.
M68PCBUG11/D 3-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
The four lines above the command line serve as a trace of the last four commands. The fifth line
above the command line shows breakpoints and the last error encountered.
For MS-DOS batch files, an error code can be checked via ERRORLEVEL after
PCbug11 terminates.
Command Description
ASM addr [mne|dir](1)(2) Call symbolic macro line assembler, with option to
auto-insert mnemonic or directive
3-2 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
Command Description
FIND byte|word addr1 addr2 Find all occurrences of byte or word between addr1
and addr2
FIND mnemonic addr1 addr2 Find all occurrences of mnemonic between addr1 and
addr2
LOADM [filename [macroname]] Load macro definitions from default or user file
MOVE addr1 addr2 addr3 Move MCU memory between addr1 and addr2 to
addr3
M68PCBUG11/D 3-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
3-4 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
Command Description
RESET [addr] MCU hardware reset with existing or new reset vector
VERF SET addr1 addr2 value Verify that memory contains the value
M68PCBUG11/D 3-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
1. Commands that operate similarly to the same commands of Motorola M68C11 EVM systems.
2. Commands that operate similarly to the same commands of Motorola CDS8 systems.
3. Special key operations
Freescale Semiconductor, Inc...
3-6 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
The assembler is a single-pass version of ASMHC11 2.6, supporting the same mnemonics and
directives. Symbols can be defined within ASM via the standard Motorola syntax. Alternatively,
symbols from an equate file may be loaded via the INCL operand. At least one space must
separate the > prompt and the mnemonic; otherwise PCbug11 treats the mnemonic as a label.
Freescale Semiconductor, Inc...
These keys have special editing roles for the ASM command:
Up arrow Decrement program counter by one
Down arrow Increment program counter by one
Enter Move program counter to the next instruction boundary
Esc Exit ASM and return to the command line
Other editing keys have the same roles for ASM as they do for other commands.
PCbug11 lets you specify an optional mnemonic or directive on the command line. If you do so,
the ASM command automatically inserts the mnemonic or directive, then immediately returns to
the command line. This permits mnemonic insertion or directive execution from within a macro,
without any user input.
Usage:
ASM $100 Assemble from memory address $100
ASM $100 INCA Insert the INCA instruction at memory address $100
M68PCBUG11/D 3-7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
3-8 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user change the serial baud rate of the PC. This command accesses the
computer hardware directly, permitting a wider range of baud rates than the MODE command
can select. After PCbug11 executes the rate change, the new baud rate appears on the screen.
Values beyond 9600 are available; the maximum baud rate is 38,400.
Usage:
BAUD Display current serial baud rate
BAUD 19200 Change baud rate to 19,200
Freescale Semiconductor, Inc...
NOTES
To maintain talker contact, first set the MCU baud rate to the new
value. Do this either by changing the appropriate talker code or by
using the MS command to change the MCU baud rate register
dynamically.
The default bootstrap download baud rate is 7812; the default
talker communication baud rate is 9600. You may specify different
rates when you start PCbug11 from the MS-DOS command line.
Thus, PCbug11 and talker codes work without modific-ation with
different MCU crystal frequencies. For example, to start an
MC68HC11A8 with a 4 MHz crystal, use the command PCBUG11
-A 3906. This tells PCbug11 to use half the default values for both
download and talker communication.
Changing the baud rate affects the minimum EEPROM
programming time, as the EEPROM programming algorithm relies
on the serial data transfer time.
M68PCBUG11/D 3-9
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command forces an 8- or 16-bit value into address addr1 of MCU memory. If addr2 also is
specified, BF forces the value into the block of memory from address addr1 through address
addr2. If addr1 is in an EEPROM block, an EEPROM algorithm stores the value (the difference
is transparent to the user). This command includes automatic verification of the memory fill.
Usage:
BF $1000 $AA Assign value $AA to address $1000
Freescale Semiconductor, Inc...
NOTE
To set the memory value to $00, do not specify the $00 in the most
significant byte of a 16-bit value. PCbug11 interprets such a
specification as an 8-bit value, leading to incorrect MCU memory
addressing.
3-10 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
BL Display breakpoints
This command displays the list of current breakpoints. The hexadecimal address of each
breakpoint appears on the screen, followed (in parentheses) by the name of any defined macro.
Usage:
BL Display addresses of all user-defined breakpoints
M68PCBUG11/D 3-11
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays breakpoints or sets an entry in a breakpoint table. Breakpoints are set in
MCU memory only when the user starts execution of code via the G command. Before passing
control to user code, PCbug11 places an SWI instruction at every breakpoint address in the
breakpoint table. PCbug11 also handles user-placed SWIs (though using some overhead), if the
user SWI vector is downloaded from an S-record file via the LOADS command, and if there are
no breakpoints at the user SWI instructions. Note that when PCbug11 first starts, it treats the
Freescale Semiconductor, Inc...
If you use the BR command to set a breakpoint and you specify a macro in the macroname
option, that macro starts when code execution reaches the breakpoint. (If no such macro has
been defined, PCbug11 ignores this optional command entry.)
If you use the BR command to display breakpoints and you specify the associated macro in the
macroname option, the macro name (in parentheses) follows the breakpoint in the display. If the
macro specified is not currently defined, the macro name follows the breakpoint in the display, but
with a question-mark indicator. If no such macro is defined, the indicator "—" follows the
breakpoint in the display.
Usage:
BR Display addresses of all user-defined breakpoints
BR $C0F1 $C045 Set breakpoints at MCU addresses $C0F1 and $C045
BR $C023 DISPREG Set breakpoint at MCU address $C023; execute macro DISPREG
when execution reaches this breakpoint
3-12 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command directs the monitor to execute the MCU code at addr. (The MCU code must end
with an RTS instruction.) The CALL command has the same effect as the MCU instruction JSR
<addr>; the CALL command does not affect the current state of the monitor.
Usage:
CALL $100 Execute the subroutine at address $100
Freescale Semiconductor, Inc...
Related command: G, S
M68PCBUG11/D 3-13
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command removes all macro names and definitions (including the TRACE macro) from the
current library. The CLRM command does not affect libraries stored on disk via the SAVEM
command.
Usage:
CLRM Clear macro names and definitions from the library
Freescale Semiconductor, Inc...
3-14 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command clears the main window of the screen, and clears any error or
breakpoint messages.
Usage:
CLS Clear the screen main window
M68PCBUG11/D 3-15
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command, without the parameter option, lists all the PCbug11 parameters that the user can
modify. With a parameter specified, this command changes the parameter value. The usage
paragraph, below, shows the available parameters.
At startup, PCbug11 determines if hardware access in the communications port is possible. If so,
it uses this mode and enables direct RTS line control. If not, PCbug11 uses BIOS calls to the
COM port. The RTS line can be programmed as a write-protect logic level for systems with
Freescale Semiconductor, Inc...
COM1 is the default communications port; the user can change this by adding port=2 to the
command line (as in PCBUG11 -XA port=2). PCbug11 sets up PPROG and EPROG values, to
the same address if the part operates that way. Note that the code presumes that the bit positions
of these registers are those of the 711E9 MCU.
Usage:
CONTROL HARDWARE Access serial COM port directly through hardware
CONTROL BIOS Access serial COM port through BIOS calls
CONTROL RTS Control RTS directly
CONTROL PROTECT Use RTS to provide memory write-protection
CONTROL TIMEOUT value Specify value of serial COM timeout during input
CONTROL COM1 Use COM1 port
CONTROL COM2 Use COM2 port
CONTROL ERRMSG 0 Disable display of memory error messages
CONTROL ERRMSG 1 Enable display of memory error messages
CONTROL LAST Toggle the last error message window on or off
CONTROL PPROG address Change the EEPROM register address
CONTROL EPROG address Change the EPROM register address
A special use of the CONTROL command is the BASE option, which lets you change the
PCbug11 default number base. At startup, the PCbug11 default number base is 10. To change the
default base or return to base 10, follow these examples:
CONTROL BASE HEX Change default base to 16
CONTROL BASE DEC Change default base back to 10
CONTROL BASE BIN Change default base to 2
3-16 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command disassembles MCU memory, showing disassembled code in the main window. If
you specify both addr1 and addr2 values, DASM disassembles code from addr1 to addr2. If you
specify only the addr1 value, DASM starts at addr1, disassembling 15 bytes of code (plus any
additional bytes needed to finish an instruction). A special case of using only the addr1 parameter
is to give it the current value of the program counter. In this case, DASM disassembles one line of
code.
Freescale Semiconductor, Inc...
Screen display of disassembled code stops when the screen is filled. To continue the display, press
any key except ESC. To terminate disassembly, press the ESC key.
Using the DASM command is a convenient way to trace program code when using a trace macro.
Such a macro should contain the command DASM *.
Usage:
DASM $B3 Disassembles MCU addresses $B3—$C2
DASM $BF00 $BFFF Disassembles MCU addresses $BF00—$BFFF
M68PCBUG11/D 3-17
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays the contents of memory, from startaddr through endaddr. If the command
does not include an endaddr value, PCbug11 displays the contents of 15 memory loactions,
starting with startaddr.
Usage:
DB $1000 Display contents of memory addresses $1000—$100F
DB $C000 $CFFF Display contents of memory addresses $C000—$CFFF
Freescale Semiconductor, Inc...
3-18 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command is reserved for developmental use. Do not use DEBUG as a label.
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-19
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command explicitly defines a symbol and specifies the symbol value. The symbol consists of
case-sensitive letters (abc does not equal ABC). The symbol value is a specific value or the
address of the memory location that contains the value. Such symbols can be more obviously
significant than numerical values in some contexts. PCbug11 reads such a symbol as if reading the
value. A disassembly listing shows the symbol, not the value, for better readability.
Usage:
DEFINE PORTA $1000 Define symbol PORTA = $1000
Freescale Semiconductor, Inc...
3-20 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user create a command sequence (a macro) that can be executed merely by
typing the name of the macro. As many as 10 parameters can be passed to a command macro.
Within the macro, the required parameter is specified by the operator @N, where N is a single-
digit number, 0—9. The syntax and use of pass parameters is the same as in Motorola assemblers.
The macrnam can be any sequence of alphanumeric characters except reserved words. More than
one macro is allowed at the same time; macros can be nested in as many as five levels. Macros are
held in macro libraries, which can be saved on disk, then reloaded as needed.
Freescale Semiconductor, Inc...
Use the main window for the macro definition. The definition may include the names of other
macros. To end the definition, press the ENTER/RETURN key on a blank line. A defined macro
can be edited within PCbug11 via the EDITM command. The macro also can be edited via a
standard text editor once the file has been saved. This is because PCbug11 saves macros in a
special text format (see LOADM). (Using the text editor is another way to define a macro, if the
definition is in the special text format.)
NOTE
If the specified macro name already exists, the new macro definition
overwrites the old.
The reserved parameter name TRACE lets the user define a macro that is executed at the
completion of every T (trace) command.
The reserved parameter name AUTOSTART lets the user define a macro that is executed
automatically during PCbug11 startup. To enable this autostart feature, use the SAVEM
command to save the macro library that contains the AUTOSTART macro. Then, from MS-DOS,
specify the macro library name as the last parameter on the command line. For example, from
PCbug11:
DEFM AUTOSTART
(Type macro definitions in main window, then press the ESC key.)
SAVEM STARTUP
QUIT (To quit PCbug11)
M68PCBUG11/D 3-21
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
Usage:
DEFM CONFIG Define macro called CONFIG
DEFM TRACE Define macro to be executed after the T command
DEFM AUTOSTART Define macro for automatic execution on PCbug11startup
Freescale Semiconductor, Inc...
3-22 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command deletes a macro definition, freeing memory space for other use.
Usage:
DELM CONFIG Delete CONFIG macro name and definition
DELM TRACE Delete macro name and definition used by the T command
DELM AUTOSTART Delete autostart macro
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-23
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays the contents of the current directory, or of the directory
specified by the mask parameter.
Usage:
DIR Display contents of the current directory
DIR *.MCR Display all current-directory files that have the extension .MCR
(macros)
Freescale Semiconductor, Inc...
3-24 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command causes PCbug11 to shell to MS-DOS. If this command includes a specified
command parameter, PCbug11 shells to MS-DOS and executes the command. Then program
control returns to PCbug11.
If this command does not have a specified command parameter, program control remains in DOS.
The simple way to return to PCbug11 is to type EXIT at the DOS prompt. Optionally, to carry
out other actions while returning to PCbug11, the user can run the program PCBUGRTN.EXE.
Freescale Semiconductor, Inc...
Usage:
DOS COPY *.TXT a:/V Shell to DOS, execute command, and return to PCbug11
M68PCBUG11/D 3-25
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user edit a macro already defined and loaded into PCbug11. As many as 10
lines of the macro appear on the screen. Table 3-4 lists the EDITM edit keys.
To move from line to line, press an arrow key. There is no direct command to delete a line; after
the edit, PCbug11 automatically removes lines that contain no characters. Similarly, PCbug11
removes any leading spaces from lines.
If the named macro does not exist, the EDITM command creates the macro as a null macro. If the
Freescale Semiconductor, Inc...
user edits a null macro, only the first (blank) line of the macro appears.
Key Function
Alphanumeric If the insert function is on, inserts the new character before the
current character. If the insert function is off, replaces the current
character with the new.
F3 Stops the edit, saving changes in the macro library. (The ALT-E and
ALT-Q key combinations do the same thing.)
Usage:
EDITM macro1 Starts edit of the macro macro1
3-26 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user transparently perform memory modify operations on the MCU
internal EEPROM, including the CONFIG register. Once the user enters this command with
startaddr and endaddr address values, the appropriate EEPROM programming algorithm handles
all memory write operations within that range.
If the user enters the EEPROM command without any parameter values, PCbug11 displays
memory address ranges to which the EEPROM algorithm applies. Using this command with an
Freescale Semiconductor, Inc...
address for just the startaddr parameter enables a write to that address to use the EEPROM
algorithm. Giving the startaddr parameter the value 0 is a special case: this clears all EEPROM
address ranges.
NOTE
Make sure that the startaddr—endaddr range does not include the
PPROG register; otherwise this command does not work.
Usage:
EEPROM Display memory address ranges to which the EEPROM algorithm
applies
EEPROM 0 Clear all EEPROM address ranges
EEPROM $103F Enable a write to address $103F to use the EEPROM algorithm
EEPROM $B600 $B6FF Enable writes within the range $B600—$B6FF to use the
EEPROM algorithm
M68PCBUG11/D 3-27
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user specify EEPROM erase and write programming time, within the range
minimum-delay to 255 mS. The value of minimum-delay is approximately 120 divided by the
serial baud rate; for a 9600 baud rate, minimum-delay is 12 mS.
NOTE
This command also applies to EPROM programming time; the
EPROM DELAY command applies to both EPROM and
Freescale Semiconductor, Inc...
Usage:
EEPROM DELAY 20 Set the erase and write time delay to 20 mS
EEPROM DELAY Display the current time delay
3-28 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user enable or disable the EEPROM byte erase-before-programming
function. The default value is enabled. The BULK option specifies bulk erasure of the EEPROM,
$B600—$B7FF, or at a specified address.
NOTES
The erase-before-programming function should be enabled before
Freescale Semiconductor, Inc...
Usage:
EEPROM ERASE Display EEPROM erase-before-write state
EEPROM ERASE DISABLE Disable erase-before-write function
EEPROM ERASE ENABLE Enable erase-before-write function
EEPROM ERASE BULK Bulk erase EEPROM array, starting at $B600
EEPROM ERASE BULK $E000 Bulk erase EEPROM array, starting at $E000
M68PCBUG11/D 3-29
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user transparently perform memory modify operations on the MCU
internal EPROM. Once the user enters this command with startaddr and endaddr address values,
the appropriate EPROM programming algorithm handles all memory write operations within that
range.
If the user enters the EPROM command without any parameter values, PCbug11 displays
memory address ranges to which the EPROM algorithm applies. Using this command with an
Freescale Semiconductor, Inc...
address for just the startaddr parameter enables a write to that address to use the EPROM
algorithm. Giving the startaddr parameter the value 0 is a special case: this clears all EPROM
address ranges.
This command affects the instructions ASM, LOADS, MOVE, MS, NOBR, and T.
NOTE
In general, the EPROM command only operates if an external
programming voltage is applied. The programming voltage should
not be present before Vcc is present or after Vcc is removed.
Usually, the programming voltage is applied to the XIRQ pin; this
prohibits use of an XIRQ talker. Consult the M68HC11 data or
information sheet before using PCbug11 with EPROM
programming.
Usage:
EPROM Display memory address range to which the EPROM algorithm
applies
EPROM 0 Clear all EPROM address ranges
EPROM $D000 $FFFF Enable writes within address range $D000—$FFFF to use the
EPROM algorithm
3-30 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user specify EPROM erase and write programming time, within the range
minimum-delay to 255 mS. The value of minimum-delay is approximately 120 divided by the
serial baud rate; for a 9600 baud rate, minimum-delay is 12 mS.
NOTE
This command also applies to EEPROM programming time; the
EEPROM DELAY command applies to both EEPROM and
Freescale Semiconductor, Inc...
Usage:
EPROM DELAY 20 Set the erase and write time delay to 20 mS
EPROM DELAY Display the current time delay
M68PCBUG11/D 3-31
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command searches through the specified memory address range for as many as four
consecutive byte or word values. The addresses of the occurrences appear in the main window. A
byte parameter value must be in the range $00—$FF; a word parameter value must be in the
range $100—$FFFF. If the pattern contains leading zeros, the first parameter after FIND must be
the byte count of the pattern searched for.
Usage:
Freescale Semiconductor, Inc...
FIND $AA $E000 $E3FF Find all occurrences of $AA in range $E000—$E3FF
FIND $AA55 $B600 $B7FF Find all occurrences of $AA55 in range $B600—$B7FF (that
is, in M68C11A1 EEPROM)
FIND 2 $0012 $F800 $FFFF Find all occurrences of $0012 in range $F800—$FFFF
FIND 3 $00 $1234 $C000 $DFFF Find all occurrences of $001234 in range $C000—
$DFFF
3-32 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command searches through the specified memory address range for as many as four
characters of specific assembler code. The wild-card operator (?) in the mnemonic parameter
forces a search for the opcode only. If the mnemonic addressing mode is not an indexed one, the
symbol #, <, or > must begin the operand value. These symbols mean immediate, direct, and
extended, respectively.
Freescale Semiconductor, Inc...
NOTE
Different commands have different wild-card operators. For this
command, the wild-card operator is the question mark ( ? ).
Usage:
FIND LDAA >$1234 $E000 $E200 Find all occurrences of LDAA >$1234 in range
$E000—$E200
FIND LDAB $34,X $C230 $C560 Find all occurrences of LDAB $34,X in range
$C230—$C560
FIND LDX #? $F000 $F2FF Find all occurrences of immediate load X opcode in range
$F000—$F2FF
M68PCBUG11/D 3-33
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command directs the MCU to start execution of user code at the value in the current
program counter, or at the address specified in the addr parameter.
Usage:
G Start program execution at current program counter
G $B600 Start program execution at address $B600
Freescale Semiconductor, Inc...
3-34 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays help information in a temporary help window. If there is no value for the
command parameter, the default information is a general help display. If there is a command
parameter value, the information pertains to that command. Use the up-arrow, down-arrow, page-
up and page-down keys to scroll through the help window. To clear the help window, press the
ESC key.
Usage:
HELP Display general help file
HELP RS Display help file for RS command
M68PCBUG11/D 3-35
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
Usage:
KLE Clear last error message or breakpoint from window
3-36 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command loads a library file of previously defined macros; the filename parameter specifies
the library file. The macros must have been stored on disk via the SAVEM command, or must
have been created via a text editor. PCbug11 checks the format of the file against the macro rules.
If the format of the specified file is valid, PCbug11 adds the library file to any existing library.
The macroname parameter specifies immediate execution of a macro in the newly loaded file. The
default extension for loading macro libraries is .MCR.
Freescale Semiconductor, Inc...
where macroname is the name of the macro being defined, and macro-instructions are the
PCbug11 instructions that constitute the macro. Comments, enclosed in braces ( { } ), are
allowed. Note that loading PCbug11 strips out macro comments. The symbol @ passes
parameters into macros. That is, when a macro is called, the first parameter value replaces @0,
the second parameter value replaces @1, and so forth.
Usage:
LOADM Load macro library from default file PCBUG11.MCR
LOADM USERLIB Load macro library from files USERLIB.MCR
LOADM A A Load macro library from file A.MCR, and immediately execute
the macro A
M68PCBUG11/D 3-37
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command loads valid S1 records from the file specified by the filename parameter into MCU
memory. If the command does not have a loadaddr value, PCbug11 loads the records into the
addresses specified in the load-address field of the S-record. The filename parameter lets the user
specify any path or drive letter, according to the rules of MS-DOS. Note that this command
ignores records other than S1 records; it also ignores blank lines. An invalid format line may cause
an error message.
Freescale Semiconductor, Inc...
The loadaddr parameter lets the data be relocated during loading. During loading, to give the
monitor priority, PCbug11 traps these mode-dependent user vectors:
In bootstrap mode:
SWI — for breakpoint and trace processing
In external mode:
RESET — to start the monitor after a hardware reset
SWI — for breakpoint and trace processing
XIRQ — for the external ACIA to provide highest-
priority host communication
All these vectors are available to the user, but their execution requires a slight speed overhead. If
no user breakpoints are defined, user SWI instructions are executed in real time, with no monitor
overhead. Refer to the source listings of the appropriate talker code to determine the effects of
user RESET and XIRQ on specific software.
Usage:
LOADS MYPROG Load the S-record file MYPROG.S19 to the target addresses the
file specifies
LOADS YOURPROG.OUT Load the S-record file YOURPROG.OUT to the target addresses
the file specifies
LOADS HISPROG $E000 Load the S-record file HISPROG.S19 offset to address $E000
3-38 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays all currently defined symbols. The wild-card character ( * ) may only be at
the end of a symbol parameter value.
NOTE
Different commands have different wild-card operators. For this
command, the wild-card operator is the asterisk ( * ).
Usage:
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-39
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays all macro names in the current library, or displays the expanded definition
of a specified macro. If such a definition includes the names of other macros, each nested level is
indented in the screen display.
Usage:
LSTM Display names of all macros in the current directory
Freescale Semiconductor, Inc...
3-40 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays the contents of memory, from startaddr through endaddr. If the command
does not include an endaddr value, PCbug11 displays the contents of 15 memory locations,
starting with startaddr.
Usage:
MD $1000 Display contents of memory addresses $1000—$100F
MD $C000 $CFFF Display contents of memory addresses $C000—$CFFF
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-41
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user modify memory contents, starting at the specified address. After
changing a value, press return to move to the next address. To step through memory without
changing values, press return repeatedly, or press the up-arrow or down-arrow keys. To modify a
memory value without stepping to the next address, include the character = on the command line.
To end the memory-modify operation, press the ESC key or end the command line with a period.
If the memory area already has been defined as EEPROM or EPROM, the modify is
transparent to the user.
Freescale Semiconductor, Inc...
NOTE
The MM command accepts only hexadecimal values. It does not
accept any values after a period.
Usage:
MM $100 Modify memory from address $100
3-42 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command moves memory contents between addr1 and addr2 to addr3, without altering the
contents. If the memory area already has been defined as EEPROM or EPROM, the move is
transparent to the user.
Usage:
MOVE $100 $150 $200 Move $50 bytes from $100 to $200
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-43
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command forces as many as nine 8- or 16-bit values into MCU memory, starting at address
addr. If addr is in an EEPROM block, an EEPROM algorithm stores the value (the difference is
transparent to the user).
NOTE
To set the memory value to $00, do not specify the $00 in the most
significant byte of a 16-bit value. PCbug11 interprets such a
Freescale Semiconductor, Inc...
Usage:
MS $1000 $AA Assign value $AA to address $1000
MS $C000 $1234 $56 Assign values $12, $34, and $56 to addresses $C000, $C001, and
$C002
MS $50 $55AA $FF00 Assign values $55, $AA, $FF, and $00 to addresses $50, $51,
$52, and $53
3-44 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays the string parameter value on the screen. Alternatively, this command
toggles the RTS line (power supply or write-protect control); use the string value ^P for this
alternative role.
Usage:
MSG Display a blank line in the main window
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-45
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command removes the specified breakpoint from the internal breakpoint table. If there is no
address parameter value, this command removes all breakpoints from the table and restores the
SWI vector to its previous state. (This implies that if a user SWI vector previously has been
installed via the LOADS command or was detected upon PCbug11 startup, then user SWIs run in
real time without intervention by PCbug11.)
Usage:
Freescale Semiconductor, Inc...
3-46 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command delays execution of a macro until a specified time elapses, until the user presses a
key, or until the byte value $4B is received on the PC serial port. This lets the target MCU control
the execution of PCbug11 macro commands.
Usage:
PAUSE Suspend macro execution until the user presses a key or until the
value $4B is received on the PC serial port
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-47
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays the PCbug11 startup message, which includes the Motorola
copyright message and the revision number.
Usage:
PRINT Display the revision number
Freescale Semiconductor, Inc...
3-48 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
If this command has no parameter values, it displays the ranges of write-protected memory. If this
command has the parameter value 0, it clears all write-protected memory ranges. If this command
has other parameter values, it inhibits PCbug11 from writing to any internal or external MCU
memory location: any subsequent PCbug11 memory modify attempt causes an error message
instead of a memory modification.
Note, however, that the PROTECT command does not inhibit the user's own MCU code.
Freescale Semiconductor, Inc...
Usage:
PROTECT Displays all write-protected memory address ranges
PROTECT 0 Clears all write-protected memory address ranges
PROTECT $102B Prevents PCbug11 from writing to the BAUD register
PROTECT $FFC0 $FFFF Prevents PCbug11 from changing any MCU vectors
M68PCBUG11/D 3-49
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command terminates the PCbug11 session. If this command includes the Y parameter,
termination happens at once. If this command does not include the Y parameter, a prompt asks for
user confirmation before terminating the session.
Note that termination of the PCbug11 session does not check that breakpoints are cleared or that
macros are saved.
Freescale Semiconductor, Inc...
Usage:
QUIT Terminates PCbug11 session after user confirmation
QUIT Y Terminates PCbug11 session immediately
3-50 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
If this command does not include the T parameter, it displays, in the register window, the current
value of the MCU registers. If this command does include the T parameter, register values appear
in the main window, so the user can see a continuous register trace.
The user may execute this command while the MCU executes user code. Careful use of both
forms of this command let the user freeze the MCU state at a particular point (via RD) while
displaying the newest state (via RD T).
Freescale Semiconductor, Inc...
Usage:
RD Display current MCU register values in the register window
RD T Display register values in the main window
M68PCBUG11/D 3-51
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command directs the MCU to generate a hardware reset. The MCU also starts execution of
user code at the addr value, if this parameter is part of the command (or if a previous RESET
command contained an addr value).
Once the reset occurs, the default implementation of PCbug11 re-initializes the talker code. Then
the MCU idles, if no addr value was specified. If an addr value was specified, talker code jumps
to that address. Note that once a RESET command specifies an addr value, the PC retains that
Freescale Semiconductor, Inc...
The RESET command first instructs the MCU to generate an internal reset, via the clock monitor
fail detector. This internal reset forces the external RESET pin low, stimulating the external
hardware reset. To trip the clock monitor fail detector, PCbug11 downloads and executes this
code in a reserved area of RAM:
STY cme_jmp clock monitor fail jump address
STAA OPTION,X OPTION=$39
STAB TEST1,X TEST1=$3E
STOP
JMP user_start <- in case STOP does not generate clock
monitor enable (CME) reset
where Y = user reset address, X = $1000 (the default I/O register base address for the MCU), and
ACCA = $08 (enables the clock monitor in the OPTION register).
The values passed to ACCB, CCR, and Y depend on the MCU type and operating mode:
• Bootstrap mode: For an A8 MCU only, set ACCB = 0 to clear the DISR bit of the
TEST1 register. For all other MCUs, set ACCB = 4 to force the clock monitor reset
by setting the FCM bit of the TEST1 register. For all devices, set CCR = $40 to
enable the STOP instruction and enable I-bit interrupts. This value also disables XIRQ,
permitting execution of the instruction after STOP if all else fails. The user reset
address is $0000.
• Expanded mode: For all MCUs, the TEST1 register is not accessible, so set ACCB =
$0. Set CCR = $40 to enable the STOP and XIRQ and disable I-bit interrupts. The
user defines the reset address in the appropriate TALKERXX.MAP file.
3-52 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command starts with an internal reset. This internal reset is like an external hardware reset,
except that the MCU uses the COP clock vector instead of the RESET vector (provided that
external capacitance does not delay the rising edge of the reset output signal). Refer to the
M68HC11 data book and user manual for details.
Usage:
RESET Force the MCU to reset and run code from the default address or
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-53
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command performs a complete restart of the monitor. This command is equivalent to the
MS-DOS command PCBUG11 option, but retains command macros. Assembler macros and
symbols are lost.
RESTART is useful should a complete communication failure occur, or if the MCU is given an
external hardware reset in bootstrap mode.
Freescale Semiconductor, Inc...
Usage:
RESTART Restart the monitor with the option specified during first
execution of PCbug11
RESTART -XE Restart the monitor with the -XE option (equivalent to the
command PCBUG11 -XE)
3-54 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets MCU registers be modified in the register window, via the normal keyboard
editing keys. Each register field is in its own section of the window. To move within and between
fields, use these keys:
Up arrow Move back one field
Down arrow Move forward one field
Left arrow Move backwards in current field
Freescale Semiconductor, Inc...
Note that all fields but SXHINZVC can be edited in binary, decimal, or hexadecimal format.
SXHINZVC can be edited in binary format only. At the end of the edit, PCbug11 automatically
runs the RD command to confirm any register changes.
Usage:
RM Begin editing register window
M68PCBUG11/D 3-55
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command lets the user force the value of any one MCU register, updating the register
window. Valid options for the register are: PC, ACCA, ACCB, X, Y, CCR, and SP.
Usage:
RS ACCA $61 Assign value $61 to MCU accumulator A
3-56 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
Usage:
S Stop program execution
M68PCBUG11/D 3-57
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command saves on disk the library of macros created via the DEFM command, appending
the extension .MCR to each file. The macro files are normal text files that may be edited with
standard text editors. But the macros must remain in the special macro format in order to be
reloaded into PCbug11. (The explanation of the LOADM command explains this format.) If the
SAVEM command does not have a filename parameter, PCbug11 uses the default name
PCBUG11.
Freescale Semiconductor, Inc...
NOTE
Be careful about saving a library to the same file the library was
loaded from. As PCbug11 strips out comments, saving the loaded
file back to the same library overwrites the original files with the
no-comment equivalents.
Usage:
SAVEM USERLIB Save macro library in file USERLIB.MCR
SAVEM Save macro library in default file PCBUG11.MCR (equivalent to
command SAVEM PCBUG11)
3-58 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command causes PCbug11 to shell to MS-DOS. If this command includes a specified
command parameter, PCbug11 shells to MS-DOS and executes the command. Then program
control returns to PCbug11.
If this command does not have a specified command parameter, program control remains in DOS.
The simple way to return to PCbug11 is to type EXIT at the DOS prompt. Optionally, to carry
out other actions while returning to PCbug11, the user can run the program PCBUGRTN.EXE.
Freescale Semiconductor, Inc...
(The user may customize the PCBUGRTN.EXE program, as appropriate.) If used, the program
PCBUGRTN.EXE must be stored in the same directory as PCBUG11.EXE.
Usage:
SHELL COPY *.TXT a:/V Shell to DOS, execute command, and return to PCbug11
M68PCBUG11/D 3-59
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command single-step traces program code from the address specified by the addr parameter
to the next logical address. If the command does not have an addr parameter value, tracing begins
from the address in the program counter. This command places an SWI at the next executable
address or addresses. If a command macro called TRACE has been defined, PCbug11 executes
this macro automatically at the completion of the T command.
DASM *
If the next executable instruction involves a branch to the current address, the trace is disabled to
allow the instruction to execute. However, PCbug11 still displays the TRACE state. As the talker
is interrupt driven, this does not cause any monitor problem; all PCbug11 commands remain
available.
Usage:
T Trace program code from program-counter address
T $100 Trace program code from address $100
3-60 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
If this command has no parameter values, it starts a simple terminal emulator at the currently
defined window coordinates. The optional parameter values X1, Y1, X2, and Y2 redefine the
window:
X1 Left column
Y1 Top row
X2 Right column
Freescale Semiconductor, Inc...
Y2 Bottom row
If any parameter value is used, all must be used. Once these values are specified in a TERM
command, they remain in force until replaced in another TERM command.
Usage:
TERM Open terminal emulator at default or at coordinates previously
specified
TERM 0 0 20 20 Open terminal emulator in a window 20 columns by 20 rows, at
the upper left corner of the screen
M68PCBUG11/D 3-61
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays the contents of the specified file. Standard DOS path names apply.
Usage:
TYPE RUNTIME.MCR Display file RUNTIME.MCR, from the current directory
TYPE \TEMP.BIT Display file TEMP.BIT, from the root directory
TYPE ..\LIST.PAS Display file LIST.PAS from the directory above the current
directory
Freescale Semiconductor, Inc...
3-62 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command removes a symbol from the symbol table list. The wild-card character ( * ) may
only be at the end of a symbol parameter value.
NOTE
Different commands have different wild-card operators. For this
command, the wild-card operator is the asterisk ( * ).
Usage:
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-63
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command displays the PCbug11 startup message, which includes the Motorola
copyright message and the revision number.
Usage:
VER Display the revision number
Freescale Semiconductor, Inc...
3-64 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command verifies contents of S1 records in the specified file against MCU memory at the
specified memaddr address. If this command does not have a memaddr address, it verifies the S1
records against MCU memory at the addresses specified in the S1-record load address fields.
The default extension of filename is .S19. The default path is the current working directory, but
the user may specify any path or drive letter according to the rules of MS-DOS. Note that this
command ignores blank lines. An invalid format line may cause an error message.
Freescale Semiconductor, Inc...
Usage:
VERF MYPROG Verify the S-record file MYPROG.S19 at the target addresses
specified in the file
VERF YOURPROG.OUT Verify the S-record file YOURPROG.OUT at the target
addresses specified in the file
VERF HISPROG $E000 Verify the S-record file HISPROG.S19 offset at address $E000
M68PCBUG11/D 3-65
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command verifies erasure of the specified memory range, that is that memory blocks in the
range contain the value $FF. If this command contains only an addr1 value, only the addr1 byte is
checked. After executing this command, PCbug11 lists any memory locations not erased.
Usage:
VERF ERASE $100 Verify that block $100 is erased
VERF ERASE $E000 $FFFF Verify that range $E000—$FFFF is erased
Freescale Semiconductor, Inc...
3-66 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
VERF SET addr1 addr2 value Verify that memory contains the
value
This command verifies that the specified memory range contains the specified single-byte value.
After executing this command, PCbug11 lists any memory locations that do not contain the value.
Usage:
VERF SET $100 $1FF $35 Verify that range $100—$1FF contains the value $35
Freescale Semiconductor, Inc...
M68PCBUG11/D 3-67
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
USING PCBUG11 COMMANDS
This command delays execution of a macro until a specified time elapses, until the user presses a
key, or until the byte value $4B is received on the PC serial port. This lets the target MCU control
the execution of PCbug11 macro commands.
Usage:
WAIT Suspend macro execution until the user presses a key or until the
value $4B is received on the PC serial port
WAIT 1000 Suspend macro execution for 1000 mS
Freescale Semiconductor, Inc...
3-68 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
CHAPTER 4
ADVANCED TOPICS
4.1 INTRODUCTION
This chapter consists of more detail about advanced PCbug11 topics, including
Freescale Semiconductor, Inc...
4.2 MACROS
A useful PCbug11 feature is letting the user execute a common command sequence by typing a
single instruction: a macro.
You may define macros either in PCbug11 or via an external text editor. It is possible to define
more than one macro while using PCbug11. The area where macros are held is the macro library.
Macros have two main elements: names and definitions. A macro name is a sequence of as many
as 80 letters, except for character sequences that form PCbug11 reserved commands. To run a
macro, enter its name, just as you would any PCbug11 command.
A macro definition consists of the commands, in order, that make up the macro. A macro
definition can include other macros: a macro can call another macro (but the macro cannot call
itself). This nesting of macros can be as deep as five levels.
Macro definitions can include as many as 10 parameters. When the macro is called, the parameter
values in the calling statement or command take the place of the parameters in the definitions. The
symbol @, followed by a digit, denotes a parameter in a macro definition: @0 denotes the first
parameter, @1 denotes the second parameter, and so forth, through @9 for the tenth parameter.
M68PCBUG11/D 4-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
The only limit to the PCbug11 macro library is the amount of computer memory. There is no limit
on the number of macros, so long as their collective definitions do not exceed the memory-size
limit. Defining a new macro that has the same name as a previous macro deletes the previous
macro (a warning message alerts the user before PCbug11 carries out the deletion.)
Terminating PCbug11 eliminates the macro library. However, you may store the macro library on
a disk before terminating PCbug11, for reloading the next time you activate PCbug11. Macros are
stored on disk in a special format; PCbug11 generates this format automatically for macros
defined in PCbug11. You may edit stored macros, via a standard text editor, provided you retain
the special format. Reloading a stored macro library adds all macros of that file to the current
macro library.
Freescale Semiconductor, Inc...
There are two ways to define macros. One way is to define the macro within PCbug11: type
DEFM, followed by the name of the new macro. PCbug11 then accepts command lines from the
user, placing these lines in the macro library under the macro name. This is the quickest and
easiest way to define macros.
Another way to define macros is to write definitions in text files, in a standard format. (The
DEFM command explanation, in Chapter 3, shows this format.) The first line of such a macro
must contain DEFM, followed by the macro name. The second line is the one word BEGIN. Any
number of subsequent lines, each containing a command (and possible parameters), follow the
BEGIN line. The last line of the macro is the one word END. Any line of the macro may include a
comment, enclosed in braces ( { } ); PCbug11 ignores comments.
Once defined and loaded, this macro lets the user load, verify, and run a program with one
command. To load and verify the S-record TRYIT.S19, then run the S-record from address
$E000, the user enters only:
RUNIT TRYIT $E000
4-2 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
Automatic macro loading is possible when you run PCbug11 from the DOS prompt. To arrange
this, include the macro= option in the command line. If the specified macro library contains
AUTOSTART, the macro runs before the user begins work.
The autostart macro can receive parameter values passed from the command line. For example,
this AUTOSTART macro verifies that a certain area of MCU memory is erased (that is, contains
the value $FF):
DEFM AUTOSTART
BEGIN
Freescale Semiconductor, Inc...
VERF ERASE @0 @1
END
If this macro is stored in a macro library file called CHECK, the user can verify EEPROM erasure
of an M68HC11E9 MCU by entering this runtime command:
Once PCbug11 starts, the macro AUTOSTART runs automatically, using the
parameter values in parentheses from the runtime command.
A null macro is one that does not contain any commands. A null macro is a useful reminder for
development work, when a macro will be needed, but its exact operation is not yet clear. A null
macro can be run, saved, stored, and deleted, just as any other macro. The definition for such a
null macro is:
DEFM macro1
BEGIN
END
There are two ways to edit a macro. One way is to use the EDITM command, which lets the user
alter a macro from within PCbug11. The EDITM entry of Chapter 3 explains more about such
editing.
The other way to edit a macro is to do so in a text file, using any standard text editor. This
method lets the user include comments in the file. Macros in text files may be regarded as source
files for PCbug11. In fact, PCbug11 uses an interpreter, not a compiler, to run macros, but text
files are easier to maintain than libraries created within PCbug11. Note that the DOS command
lets the user work on macro text files without having to exit and restart PCbug11.
M68PCBUG11/D 4-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
Macros are stored dynamically in the computer memory, so they use only as much memory as
they need. Eventually, the computer may run out of memory. This is the case if PCbug11 no
longer permits definitions or loading of macros. To make room for new macros, the user must
delete some of the present ones from memory. If such macros will be needed again, the user
should save them to a disk file, via the SAVEM command.
There are two ways to delete macros. Use the CLRM command to remove all macros at the same
time. Use the DELM command to delete a single macro.
Freescale Semiconductor, Inc...
Remember that loading a macro that has the same name as a previous macro automatically
replaces the previous macro with the new. This is not the case for macro definitions via the
DEFM command, which confirms that the user wants to replace such a previous macro.
4.3.1 Breakpoints
The user can arrange for a program to stop at a specified location by placing a breakpoint at the
location. Once the program stops, the user can examine registers and memory locations to verify
that the program has performed as expected.
Use the BR command to place a breakpoint; use the NOBR command to remove breakpoints.
The BR command lets you specify a macro to be run automatically when the program reaches the
breakpoint. This feature is helpful if a series of commands is to be executed every time the
breakpoint is reached.
4-4 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
2. PCbug11 must be able to alter the SWI interrupt vector. Consequently, this vector
also must be in alterable memory. The SWI interrupt vector points to an appropriate
interrupt-handling routine in the talker. The SWI instruction forces the program being
run to enter that specified interrupt-handling routine.
Should either the program or the SWI interrupt vector not be in alterable memory,
the breakpoint function of PCbug11 cannot be used.
2. The user enters the G or CALL command to run the program. PCbug11 records the
contents of each breakpoint location, replaces the contents with an SWI instruction,
and runs the program.
3. When the program reaches a breakpoint, the talker routine that handles SWI interrupts
notifies PCbug11 of the interrupt. PCbug11 then replaces all breakpoint SWI
instructions with original memory contents, displays BREAK on the computer screen,
and runs any macro defined for the breakpoint reached.
4. If the user stops the program (via the S command) before the program reaches a
breakpoint, original memory contents replace all breakpoint SWI instructions.
5. When the user deletes all breakpoints (via the NOBR command), PCbug11 replaces
the talker SWI vector with the original SWI vector.
NOTES
From this sequence, it is clear that a system reset before step 5
could leave in memory unreplaced SWI instructions and the talker
SWI vector. If the system must be reset during a breakpoint
operation, be sure to reload the program to restore memory
contents.
M68PCBUG11/D 4-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
4.3.2 Tracing
A user who steps through a program, instruction by instruction, is tracing the program. A user
could implement tracing by placing breakpoints after all assembly commands, but this would be
very time-consuming for the user. PCbug11 implements automatic tracing via its trace (T)
command.
The user may notice that tracing takes longer than other PCbug11 operations. This is because
tracing is complex: for each step, PCbug11 must find the address of the next opcode. This entails
disassembling the opcode at the current address to determine the number of following bytes. The
Freescale Semiconductor, Inc...
process is complicated for a jump opcode, and even more so for a branch opcode. Usually, in
tracing, an SWI replaces the next opcode in the program. For a jump, the destination opcode must
be replaced. For a branch, two opcodes must be replaced: the one following the branch instruction
and the one at the branch destination.
Once the SWI is placed in memory, PCbug11 runs the program. The second instruction is an
SWI, so the program stops. Again, PCbug11 must be able to amend the SWI vector and the
program memory. The user may specify a macro to be executed when a program reaches a trace
SWI. Such a macro may contain any instructions, but must be named TRACE. Typically, a
TRACE macro disassembles the current instruction and reads registers. The TRACE macro can
even contain the trace (T) command; in this case, the program steps through all its instructions
until stopped by the user or until it arrives at a self loop.
A self loop is a program jump or branch to its current location. Tracing is pointless for a self loop,
so the program continues to run, displaying the status TRACING, until the user stops execution
or until the branch condition is met or failed.
An alternative approach is to install the talker in the internal EEPROM of the MCU or in an
external memory. Then, whenever the package is run it is not necessary to download the talker
program to the hardware. Furthermore, as the talker does not reside in RAM, more RAM space
remains available for user programs and data.
4-6 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
To load a talker into EEPROM, first boot up the MCU normally, then define the EEPROM area.
Next, install the talker via the LOADS instruction and verify the installation via the VERF
command. Once verified, the talker is ready for use. Per paragraph 4.6, you should terminate
PCbug11, then run it again, selecting the correct .MAP file instead of the boot option.
TALKEREE is a special talker that already uses the internal EEPROM. Two files must be
available to make TALKEREE available: TALKEREE.S19 and TALKEREE.MAP. The .S19 is
the S-record format of the talker to be installed in EEPROM; this must be in the current user
directory. The .MAP file is a list of addresses that PCbug11 uses for communication with the
board; this file must be in the user's current working directory. (When the boot option is used,
PCbug11 automatically handles this information, so no external .MAP file is required.)
Freescale Semiconductor, Inc...
For example, this macro programs the talker into the EEPROM of an M68HC11E9
MCU:
DEFM AUTOSTART {Run this macro automatically}
BEGIN
MS $1035 0 {Clear BPROT register — not
needed for A8}
EEPROM $B600 $B7FF {Enable EEPROM algorithm}
LOADS TALKEREE {Load talker into EEPROM}
VERF TALKEREE {Verify loading}
QUIT Y {Exit PCbug11}
END
Saving this macro in a file called STARTUP.MCR makes this sequence possible to
run the EEPROM talker:
1. Start up PCbug11 by typing: PCBUG11 -E STARTUP
2. Reset board
3. Start up PCbug11 by typing: PCBUG11 TALKEREE
M68PCBUG11/D 4-7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
NOTES
If any error messages appear when you run the macro, press the
capital S key to stop the macro, and correct the errors.
Using the macro and startup sequence above leaves most of the
RAM free for user programs. The default stack for TALKEREE is
at $3F, so avoid using RAM between $00 and $3F. To move the
stack, modify the source file TALKEREE.ASC by changing the
value of the symbol STACK.
Freescale Semiconductor, Inc...
The interrupt vector jumps are in the $C4 — $FD area of RAM.
The jumps are initialized with safe values for PCbug11. The JMP
instructions may be modified by the user, but the user should not
modify the XIRQ interrupts that PCbug11 uses. User code should
not be in the $C4 — $FD area. It may be a good idea to set up the
necessary interrupt vectors, then run the PROTECT command, per
Chapter 3.
If the board in use includes external memory, you can use the RTS communications port line to
provide a limited write-protection facility. The RTS line carries a standard RS-232 signal that
must be converted to a TTL logic level for use with the MCU. If the signal is directly controllable
(see the CONTROL command explanation in Chapter 3), you can combine the signal logically
with the MCU R/W signal to protect memory. When PCbug11 accesses memory, it forces the
RTS line high, permitting the write to memory. But when the program itself tries to access
memory, the RTS line remains low, preventing such access.
4-8 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
NOTE
Do not connect any Vpp voltage unless Vdd is connected. Doing so
will destroy the chip.
ASMHC11 TALKXX ;B
This searches for the TALKXX.ASC file and creates a download file with the extension .BOO. If
the file actually uses the XIRQ interrupt, rename the file, giving it the extension .XOO.
ROMed talkers are more likely to need user customization. Such a case requires work on two
files:
1. The user must supply or modify the talker file itself, then load the file into external
memory.
2. The user must create and load a mapfile. This mapfile must contain the addresses of
several key talker-program routines.
Use the TALKEREE.MAP and TALKEREE.ASC files as templates for creating new ROMed
talkers. These files illustrate the format conventions.
M68PCBUG11/D 4-9
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
ADVANCED TOPICS
Note that names of constants in the TALKEREE.MAP file may be no longer than 14 characters;
values of constants may not start until column 16.
4-10 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
HARDWARE SUPPORT
APPENDIX A
HARDWARE SUPPORT
A.1 INTRODUCTION
This appendix describes the hardware support that PCbug11 software requires. Note that the
Freescale Semiconductor, Inc...
XIRQ pin should be attached to the PD0/Rx pin on the processor, except when programming
EPROM. This lets the talker software use the highest-level interrupt available for
communications.
The hardware places the part in bootstrap mode. The SCI communications port is translated to
RS-232 voltage levels, via an MC145407 chip. (A user who has an alternative method of
translating voltage levels could replace the MC145407 chip.)
M68PCBUG11/D A-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
HARDWARE SUPPORT
Freescale Semiconductor, Inc...
A-2 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
HARDWARE SUPPORT
Designator Description
C1, C2 Capacitor, 22 pF
C3 Capacitor, 1 µF
C4 Capacitor, 0.1 µF
R1 Resistor, 10 MΩ
R2 Resistor, 4.7 KΩ
R3 Resistor, 10 KΩ
R4 Resistor, 100 Ω
X1 Crystal, 8 MHz
M68PCBUG11/D A-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
HARDWARE SUPPORT
Freescale Semiconductor, Inc...
A-4 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 ERROR MESSAGES
APPENDIX B
PCBUG11 ERROR MESSAGES
B.1 INTRODUCTION
There are four levels of error reporting within PCbug11:
Freescale Semiconductor, Inc...
Paragraphs B.2 through B.5, respectively, explain these categories of error messages.
See Chapter 3 for explanations of the additional error messages pertaining to the
ASM command.
Messages of this level indicate that the command entered was not successful
because:
1. System capabilities were exceeded,
2. Resources needed to carry out the command were not available, or
3. The user tried to go beyond certain program limits.
M68PCBUG11/D B-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 ERROR MESSAGES
When possible, the error message indicates specifically why the operation failed.
Freescale Semiconductor, Inc...
As the operation in progress may be a subset of the command entered, the precise meaning of a
failed operation message may not be straightforward. Accordingly, a supplementary message may
appear just below the register window. (On a color screen, a supplementary message is in yellow.)
A supplemetary message has the form
B-2 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 ERROR MESSAGES
Message Explanation
Breakpoint table is full The attempted breakpoint definition would exceed the
maximum number of breakpoints. To add a new
breakpoint, first delete an existing one.
Can't find .MAP file PCbug11 cannot find the map file associated with the file
specified in the command line. The map file must be in the
user's current working directory.
Can't load <interrupt> The LOADS command failed because PCbug11 could not
vector capture the specified interrupt vector (RESET, SWI, or
XIRQ). This may be due to a problem in the S-record. For
normal operation, PCbug11 may need access to these
vectors.
Error in register value The RM command failed due to entry of a value in the
wrong base.
Memory set error PCbug11 could not set the requested memory location,
possibly because the memory is not working properly.
Another possible cause is memory not enabled as
EEPROM, when that is required. (A supplementary
message indicates the user command that failed.)
Registers unchanged The user pressed the ESC key after running the RM
command. To change registers by this method, press the
RETURN key, not the ESC key.
Too many nested macros The user ran a macro that called other macros, resulting in
macro nesting six or more levels deep. Only nest macros
as deep as five levels.
Warning mixed memory The user tried to program a range that consists of two
range - command aborted types of memory (e.g., EEPROM and RAM). Program
each type of memory separately.
M68PCBUG11/D B-3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 ERROR MESSAGES
Messages of this level indicate that the command entered was not successful because
communication between the computer and the MCU failed.
As the operation in progress may be a subset of the command entered, the precise meaning of a
Freescale Semiconductor, Inc...
B-4 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 ERROR MESSAGES
Message Explanation
Communications fault PCbug11 is not able to establish communication with the MCU.
This message usually appears after a <CTRL>R command.
Comms fault : Memory A write to <address> has not been completed; communications
Freescale Semiconductor, Inc...
write at <address> with the MCU have been lost. This message may appear if the
terminated baud rate is inappropriate, or if the memory write in some other
way caused the MCU to abort normal operation.
Comms fault : <operation> PCbugll lost communications with the MCU during the specified
failed : please retry operation, but re-established communications. Operations
include programming, block write, memory write, memory read,
BREAK processing, memory swap, register read and register
write. If 't/out' is specified then the MCU failed to communicate
within the timeout period. In this case the user may be able to
rectify the problem by increasing the value of the CONTROL
timeout parameter - especially where memory swap is indicated.
Memory read failed : PCbug11 lost communications with the MCU during a memory
please retry read, but re-established communications. (This message could
appear if the user presses the ESC key during a memory read.)
Memory write at <address> PCbug11 could not complete the memory write at the specified
failed : please retry address, but remains in communication with the MCU.
M68PCBUG11/D B-5
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 ERROR MESSAGES
message explanation
Freescale Semiconductor, Inc...
Operand Error The typed operand is incorrect for the typed command.
See Chapter 3 for the correct operands.
Range Error The typed address range exceeds the maximum range for
the command.
B-6 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 ERROR MESSAGES
Freescale Semiconductor, Inc...
M68PCBUG11/D B-7
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 DISK CONTENTS
APPENDIX C
PCBUG11 DISK CONTENTS
Motorola supplies PCbug11 on a 360 Kbyte transmittal disk. Table C-1 lists the files and
directories on this disk.
Note that you may customize or replace the PCBUGRTN.EXE program. The program supplied
Freescale Semiconductor, Inc...
BEGIN
END.
Name Description
TALKSRC Directory of source files and S-records of all talkers that can be
loaded into EEPROM or EPROM and use the SCI interrupt.
TALKSRCX Directory of source files and S-records of all talkers that can be
loaded into EEPROM or EPROM and use the XIRQ interrupt.
1. These files should be in the same directory during use.
M68PCBUG11/D C-1
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PCBUG11 DISK CONTENTS
Freescale Semiconductor, Inc...
C-2 M68PCBUG11/D
For More Information On This Product,
Go to: www.freescale.com