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
the Motorola product could create a situation where personal injury or death may 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.
This manual provides the necessary information for using the M68EVB912B32 Evaluation
Board (the EVB), an evaluation, debugging, and code-generation tool for the MC68HC912B32
Microcontroller Unit (MCU) devices. The manual includes:
• A general description of the EVB
• Configuration and setup instructions
• Startup and operating instructions
• Detailed descriptions of the operating firmware’s command set
• A detailed hardware-reference section
• Appendices containing reference data
Additional reference items, such as schematic diagrams and parts lists, are shipped as part of the
EVB package.
1.2 GENERAL DESCRIPTION AND FEATURES
The EVB is an economical tool for designing and debugging code for, and evaluating the
operation of, the MC68HC192B32 MCU. By providing the essential MCU timing and I/O
circuitry, the EVB simplifies user evaluation of prototype hardware and software.
The board consists of a 5.15 by 3.4 inch (13.1 by 8.64 cm) double-sided printed circuit board
(PCB) that provides the platform for interface and power connections to the MC68HC912B32
MCU chip.
Figure 1-1 shows the EVB’s layout and locations of the major components, as viewed from the
component side of the board.
Hardware features of the low-cost EVB include:
• Double-sided PCB
• Single-supply +3 to +5 Vdc power input (P5)
• RS-232C interface
• BDM IN and BDM OUT connectors for remote debugging of a user’s target system
68EVB912B32UM/D1-1
GENERAL INFORMATION
• Header footprints for access to all MCU pins
• 16-MHz crystal for 8-MHz bus operation
• Headers for jumper selection of and connection to hardware options:
− RS-232 isolation (W1, W2))
− EVB mode selection (W3, W4)
− MCU mode selection (W5, W6)
− Vpp/Vdd selection (W7)
− Vpp input (W8)
− BDM IN (W9)
− BDM OUT Vdd/reset disconnects (W10, W11)
− BDM OUT (W12)
− Low-Voltage Inhibit (LVI) reset (W15)
− EXTAL source control and access (W16)
(1)
• Four 2x20 header connectors for access to the MCU’s I/O lines (P2, P3, P4, and P6)
• Prototype expansion area for customized interfacing with the MCU
• Low-profile reset push-button switch (S1)
• Low-voltage inhibit protection (U3)
(1)
For full details of the jumper settings, refer to Table 4-1.
Firmware features include:
• The D-Bug12 monitor/debugger program, resident in on-chip Flash EEPROM
• Full support for either dumb-terminal or host-computer terminal interface
• Single-line assembler/disassembler
• File-transfer capability from a host computer to RAM or EEPROM, allowing off-
board code generation
• Ability to program EEPROM on either the host EVB or a compatible target system
68EVB912B32UM/D1-2
GENERAL INFORMATION
Figure 1-1. EVB Layout and Component Placement
68EVB912B32UM/D1-3
GENERAL INFORMATION
Figure 1-2. EVB Solder Side View
1.3 FUNCTIONAL OVERVIEW
The EVB is factory-configured to execute D-Bug12, the Flash EEPROM-resident monitor
program, without further configuration by the user. It is ready for use with an RS-232C terminal
for writing and debugging user code. Follow the setup instructions in Chapter 2 to prepare for
operation.
The EVB can also be jumper-configured to:
• run a program directly out of EEPROM
• control a remote "pod" MCU via the Background Debug Mode interface
• reprogram EEPROM on either the host EVB or the "pod"
For the correct jumper settings, refer to 4.2 Configuration Headers and Jumper Settings.
68EVB912B32UM/D1-4
GENERAL INFORMATION
NOTES
The D-Bug12 operating instructions in this manual presume the
factory-default memory configuration. Other configurations
require different operating-software arrangements.
EEPROM resides in two areas of memory (refer to Table 3-5),
which are referred to in this manual as "byte-erasable EEPROM"
and "Flash EEPROM." This distinction is necessary because of the
different ways in which they may be programmed and used.
D-Bug12 uses the MCU’s Serial Communications Interface (SCI) for communications with the
user terminal. For information on the port and its connector, refer to 2.4 EVB to Terminal
Connection and 4.4 Terminal Interface.
If the MCU’s single-wire Background Debug Mode (BDM) interface serves as the user interface,
the SCI port becomes available for user applications. This mode requires either:
• another M68EVB912B32 and a host computer
• a background debug development tool, such as Motorola’s Serial Debug Interface
(SDI)
For more information, refer to the Motorola Serial Debug Interface User’s Manual.
Two methods may be used to generate EVB user code:
1. For small programs or subroutines, D-Bug12’s single-line assembler/disassembler
may be used to place object code directly into the EVB’s RAM or EEPROM.
2. For larger programs, P&E Microcomputer Systems' IASM12 or Motorola's MCUasm
assembler may be used on a host computer to generate S-Record object files, which
can then be loaded into the EVB’s memory using D-Bug12’s LOAD command.
The EVB features a prototype area, which allows custom interfacing with the MCU’s I/O and bus
lines. These connections are broken out via headers P2, P3, P4, and P6, which are immediately
adjacent to the MCU on the board. Wire-wrap pins may be placed in these headers to connect to
the prototyping area, as shown in Figure 1-1.
An on-board push-button switch, S1, provides for resetting the EVB hardware and restarting
D-Bug12.
The EVB can begin operation in any of four jumper-selectable (W3, W4) modes at reset:
1. In EVB mode, program execution begins in one of two ways:
a. If D-Bug12 is resident in Flash EEPROM (i.e., if Mode 4 below has not been
performed), D-Bug12 immediately issues its command prompt on the terminal display
and waits for a user entry.
68EVB912B32UM/D1-5
GENERAL INFORMATION
b. If D-Bug12 has been replaced in Flash EEPROM with user code (i.e., Mode 4
below has been performed), execution begins with the user program.
2. In JUMP-EE mode, execution begins directly at location $0D00 with the user code
in byte-erasable EEPROM.
3. In POD mode, the board makes use of the BDM OUT header (W12) and uses the
D-Bug12 commands to non-intrusively interrogate an external target MCU. Special
prompts are displayed to let the user know if this mode is selected. If no external
MCU is detected, the software informs the user.
The target’s EEPROM may be programmed while the host M68EVB912B32 board is
in EVB mode, using the D-Bug12 commands BULK, LOAD, FBULK and FLOAD.
4. In BOOTLOAD mode, the host EVB’s byte-erasable or Flash EEPROM may be
reprogrammed with user code. This mode may also be used to reload or customize
D-Bug12.
D-Bug12 allows programming of the MC68HC912B32’s on-chip EEPROM through commands
that directly alter memory. For details of all D-Bug12 commands, refer to 3.6 D-Bug12Command Set.
When operating in EVB mode, the MCU must manage the EVB hardware and execute D-Bug12
in addition to serving as the user-application processor, there are a few restrictions on its use.
For more information, refer to 3.9 Operational Limitations.
1.4 EXTERNAL EQUPMENT REQUIREMENTS
In addition to the EVB, the following user-supplied external equipment is required:
• Power supply — see Table 1-1 for voltage and current requirements.
− Host computer with RS-232C serial port — allows off-board code assembly
that can be loaded into the EVB’s memory. Requires a user-supplied
communications program capable of emulating a dumb terminal. Examples of
acceptable communications programs are given in Appendix B Communications Program Examples.
− Host computer using the MCU’s BDM interface — frees the target MCU’s
SCI port for user applications. This requires another M68EVB912B32 for use
as the target or a background debug development tool, such as the Motorola
Serial Debug Interface (SDI).
• Power-supply and terminal interconnection cables as required
68EVB912B32UM/D1-6
GENERAL INFORMATION
For full details of equipment setup, cabling, and special requirements, refer to Chapter 2.
• P&E Microcomputer Systems’ IASM12 Assembler and user’s manual on 3.5" diskette
• Using D-Bug12 Callable Routines
Save all packing materials for storing and shipping the EVB.
Remove the EVB from its anti-static container.
2.2 EVB CONFIGURATION
Because the EVB has been factory-configured to operate with D-Bug12, it is not necessary to
change any of the jumper settings to begin operating immediately.
As shown in Table 2-1, only two jumpers (W3 and W4) should be changed during the course of
factory-default EVB operation with D-Bug12.
68EVB912B32UM/D2-1
CONFIGURATION AND SETUP
Table 2-1. EVB Startup Mode Jumpers
Jumper
Positions
W3W4
00EVB execution mode (default). D-Bug12 is executed from Flash EEPROM upon reset.
The D-Bug12 prompt appears immediately on the terminal display.
10JUMP-EEPROM mode. User code is executed from byte-erasable EEPROM upon reset.
For more information, refer to 3.1 Operating Modes.
01Remote Debugging through BDM OUT header (W12)
11BOOTLOAD mode
Startup Mode
Other jumper settings affect the hardware setup and/or MCU operational modes. For an
overview of all jumper-selectable functions, refer to 1.2 General Description and Features.
For details of the settings, see Table 4-1.
2.3 EVB TO POWER SUPPLY CONNECTION
The EVB requires a user-provided external power supply. See Table 1-1 for the voltage and
current specifications. For full details of the EVB’s power-input circuitry, refer to 4.3 Power
Input Circuitry.
A power supply with current-limiting capability is desirable. If this feature is available on the
power supply, set it at 200 mA.
Connect the external power supply to connector P5 on the EVB, using 20 AWG or smaller
insulated wire. Strip each wire’s insulation 1/4 in. from the end, lift the P5 contact lever to
release tension on the contact, insert the bare end of the wire into P5, and close the lever to
secure the wire. Observe the polarity carefully.
CAUTION
Do not use wire larger than 20 AWG in connector P5. Larger wire
could damage the connector.
2.4 EVB TO TERMINAL CONNECTION
For factory-default operation, connect the terminal to P1 on the EVB, as shown in Table 2-2.
This setup uses the MCU’s SCI port and its associated RS-232C interface for communications
with the terminal device.
68EVB912B32UM/D2-2
CONFIGURATION AND SETUP
Standard, commercially available cables may be used in most cases. Note that the EVB requires
only three of the RS-232C signals. Table 2-2 lists these signals and their pin assignments. Other
signals have been routed through the RS-232C interface chip for proper levels. Some terminal
interface programs require proper levels on all pins to function correctly.
The EVB’s RS-232C connector, P1 , is wired as Data Circuit-terminating Equipment (DCE) and
employs a 9-pin subminiature D (DB-9) receptacle.
Most terminal devices — whether dumb terminals or the serial ports on host computers — are
wired as Data Terminal Equipment (DTE) and employ 9- or 25-pin subminiature D (DB-9 or
DB-25) plugs. In these cases, normal straight-through cabling is used between the EVB and the
terminal. Adapters are readily available for connecting 9-pin cables to 25-pin terminal
connectors.
If the terminal device is wired as DCE, the RXD and TXD lines must be cross-connected, as
shown in Table 2-2. Commercial "null modem" adapter cables are available for this purpose.
Table 2-2. RS-232C Interface Cabling
EVB P1DTE SignalTerminal
DCE
Receptacle
DB-9DB-25DB-9DB-25
2Receive Data (RXD)2233
3Transmit Data (TXD)3322
5Ground (GND)5757
(1)
Normal (DCE-to-DTE) cable connections
(2)
Null modem (DCE-to-DCE) cable connections
DTE
Plug
(1)
Receptacle
DCE
(2)
Optionally, the MCU’s Background Debug Mode (BDM IN W12) interface can serve as the
user interface. This setup makes the SCI port available for user applications. Additional
hardware and software are required. For more information, refer to the documentation for the
background debug development tool being used. This can be another M68EVB912B32 or a tool
such as Motorola’s Serial Debug Interface (SDI).
68EVB912B32UM/D2-3
CONFIGURATION AND SETUP
2.5 TERMINAL COMMUNICATIONS SETUP
2.5.1 Communication Parameters
The EVB’s serial communications port uses the communication parameters listed in Table 2-3.
Of these, only the baud rate can be changed. For instructions on changing it, refer to 2.5.4
Changing the Baud Rate.
Table 2-3. Communication Parameters
Baud Rate
Data Bits
Stop Bits
Parity
9600
8
1
none
2.5.2 Dumb-Terminal Setup
Configuring a dumb terminal for use with the EVB consists of setting its parameters as shown in
Table 2-3. Many terminals are configurable with externally accessible switches, but the
procedure differs between brands and models. Consult the manufacturer’s instructions for the
terminal being used.
2.5.3 Host-Computer Setup
One advantage of using a host computer as the EVB’s terminal is the ability to generate code offboard, for subsequent loading into the EVB’s memory. It is thus desirable for the host to be
capable of running programs such as P&E Microcomputer Systems' IASM12 or Motorola’s
MCUasm assembler. For more information, refer to 3.7 Off-Board Code Generation.
To serve as the EVB’s terminal, the host computer must have an RS-232C serial port and an
installed communications program capable of operating with the parameters listed in Table 2-3.
Setting up the parameters is normally done within the communications program, after it has been
started on the host. Usually, the setup can be saved in a configuration file so that it does not have
to be repeated. Procedures vary between programs; consult the user’s guide for the specific
program.
Appendix B Communications Program Examples provides ex amples of using some of the
commonly available communications programs.
68EVB912B32UM/D2-4
CONFIGURATION AND SETUP
2.5.4 Changing the Baud Rate
The EVB’s default baud rate for the RS-232C port is 9600. This can be changed in two ways:
• For temporary changes, use the D-Bug12 BAUD command. This change remains in
effect only until the next reset or power-up, at which time the baud rate returns to
9600.
• For permanent changes, the D-Bug12 baud-rate initialization value stored in Flash
EEPROM must be modified. For instructions, refer to Appendix D D-Bug12Customization Data and Appendix E EEPROM Bootloader.
68EVB912B32UM/D2-5
CONFIGURATION AND SETUP
68EVB912B32UM/D2-6
OPERATION
CHAPTER 3
OPERATION
3.1 OPERATING MODES
The EVB can operate in one of four jumper-selectable modes:
EVB mode either D-Bug12 or the user code in Flash EEPROM executes.
JUMP-EEPROM mode user code in byte-erasable EEPROM executes.
POD mode D-Bug12 executes. EVB serves as the BDM probe for a target system.
BOOTLOAD mode the host EVB’s EEPROM may be reprogrammed.
The operating mode is determined by jumper headers W3 and W4, as shown in Table 4-1. The
modes are described in the following three sections.
NOTE
When operating in EVB mode, the M68EVB912B32 cannot fully
emulate a target system. The limitations are described in 3.9Operational Limitations.
Target system emulation may, however, be performed by using the
EVB with D-Bug12 as an intelligent, non-intrusive BDM interface.
This operation is described in 3.1.3 POD (Probe) Mode.
3.1.1 EVB Mode
In the default EVB mode (W3-0 and W4-0), D-Bug12 begins execution immediately. The
D-Bug12 prompt appears on the terminal and commands may be entered as described in 3.5Using D-Bug12 Commands.
If D-Bug12 has been replaced with user code in Flash EEPROM, execution begins with the
user’s program.
3.1.2 JUMP-EEPROM Mode
In this mode (W3-1 and W4-0), the EVB begins operation out of reset by executing the user
program in byte-erasable EEPROM starting at address $0D00, as shown in Table 3-5.
68EVB912B32UM/D3-1
OPERATION
This mode is effected using the MCU’s PAD0 line. User code may be programmed into byteerasable EEPROM using the D-Bug12 commands listed in 3.5.3 Command-Set Summary.
Control can be returned to D-Bug12 in the following ways:
1. Move the jumpers on headers W3 and W4 to position 0 and reset the EVB.
2. Terminate the user program with code that returns to D-Bug12 after execution has
finished.
To return to D-Bug12 automatically after a user program has finished, include the following lines
as the last instructions to be executed in the program:
STACKTOP: equ $0c00 ; stack at top of on-chip RAM
AltResetVect: equ $F7FE
;
lds #STACKTOP
jmp [AltResetVect,PCR] ; jump to start of D-Bug12
3.1.3 POD (Probe) Mode
In this mode (W3-0 and W4-1), the EVB and D-Bug12 serve as a POD ("probe") interface
between a target system and the user. Communications between the EVB and the target are by
means of the Background Debug Mode (BDM) interface, using the EVB header W12 (BDM
OUT).
This arrangement allows the target system to perform true emulation of an application, as the
BDM interface is non-intrusive upon the target’s foreground operation. The target’s on-chip
resources are all available for the application. The target may be a second M68EVB912B32
board or any other M68HC12 system. D-Bug12 commands are entered as usual on the user
terminal, which is served by the POD EVB.
3.1.3.1 Target Types Supported
All members of the M68HC12 family may be used in the target system.
3.1.3.2 Target MCU Characteristics
The following D-Bug12 commands must be used to inform D-Bug12 of the target MCU’s
essential operating characteristics in order to allow transparent modification of the target’s
EEPROM. For details, refer to the command descriptions in 3.6 D-Bug12 Command Set.
DEVICE specifies the target’s microprocessor type
EEBASE specifies the base address of the target’s Flash EEPROM
REGBASE specifies the base address of the target MCU’s I/O registers
68EVB912B32UM/D3-2
OPERATION
3.1.3.3 Programming the Target’s EEPROM
The target MCU’s on-chip byte-erasable or Flash EEPROM may be programmed from userassembled S-Records on the host (terminal) computer by using the D-Bug12 commands BULK,
LOAD, FBULK, and FLOAD. For details, refer to 3.6 D-Bug12 Command Set.
3.1.3.4 Controlling Target Execution
All D-Bug12 commands that control the execution of user code may also be used in both EVB
mode and POD mode. Two additional commands are available in POD mode:
• RESET resets the target MCU and places it in active background mode
• STOP halts program execution on the target
For details, refer to the command descriptions in 3.6 D-Bug12 Command Set.
3.1.4 BOOTLOAD Mode
In this mode (W3-1 and W 4-1), a user program may be loaded into the host EVB’s byte-erasable
or Flash EEPROM. D-Bug12 may be replaced as the startup "boot" program. This mode may
also be used to reload or customize D-Bug12. The procedures are described in Appendix E
EEPROM Bootloader.
3.2 STARTUP
3.2.1 Startup Procedure
The following startup procedure includes a checklist of configuration and setup items. To begin
operating the M68EVB912B32, follow these steps::
1. Configure the EVB if required — section 2.2.
2. Determine whether execution should begin in EVB mode (page 3-1), JUMPEEPROM mode (page 3-2), POD mode (page 3-2), or BOOTLOAD mode (page3-3).
Set the jumpers on headers W3 and W4 accordingly — sections 2.2 and 3.1.
3. Connect the EVB to the external power supply — section 2.3.
4. Connect the EVB to the terminal — section 2.4.
5. Configure the terminal communications interface — section 2.5.
68EVB912B32UM/D3-3
OPERATION
6. Apply power to the EVB and to the terminal. If the terminal is a host computer,
a. Verify that it has booted correctly.
b. Start the communications program for terminal emulation — section 2.5.3 and
Appendix B Communications Program Examples.
7. Reset the EVB by pressing and releasing the on-board reset switch (S1).
3.2.2 Operating Procedures
After starting the EVB in accordance with section 3.2.1, follow the operating procedure for the
EVB mode that was selected: EVB mode, JUMP-EEPROM mode, POD mode, or BOOTLOAD
mode. These procedures are described in the following sections.
3.2.2.1 EVB Mode
In EVB mode, the MC68HC912B32 begins executing code at the address contained in the
alternate reset vector at $F7FE (for information on the alternate reset and interrupt vector table,
see Vector Jump Table: Interrupt and Reset Addresses on page E-4). The code pointed to by
the alternate reset vector may either be D-Bug12 (factory default) or a user’s program that has
replaced D-Bug12 in Flash EEPROM.
D-Bug12 upon reset, the D-Bug12 sign-on banner and prompt should appear on the terminal’s
display as follows:
D-Bug12 v 2.0.0
Copyright 1996 - 1997 Motorola Semiconductor
For Commands type "Help"
>
If the prompt does not appear, check all connections and verify that startup steps 1
through 7 in section 3.2.1 have been performed correctly.
When the prompt appears, D-Bug12 is ready to accept commands from the terminal as
described in section 3.5.
User boot program upon reset, the user program executes immediately. D-Bug12 commands
are not available. Terminal communications take place either via the SCI under control
of the user program or via the BDM interface and a serial debug interface tool such as
Motorola’s SDI.
3.2.2.2 JUMP-EEPROM Mode
In JUMP-EEPROM mode, the user code in byte-erasable EEPROM starting at address $0D00 is
executed immediately. Terminal communications are controlled by the user code via the SCI or
by an appropriate serial debug tool via the BDM interface. For more information, refer to
68EVB912B32UM/D3-4
OPERATION
3.1.2 JUMP-EEPROM Mode. Control can be returned to the D-Bug12 terminal prompt by
doing one of the following:
1. terminating the user code with appropriate instructions — see section 3.1.2
2. pressing the reset button (S1)
3.2.2.3 POD Mode
In POD mode, the host EVB serves as a non-intrusive controller for the target system via the
BDM interface. The host EVB begins executing code at the address contained in the alternate
reset vector at $F7FE (for information on the alternate reset and interrupt vector table, see VectorJump Table: Interrupt and Reset Addresses on page E-4). The code pointed to by the
alternate reset vector may either be D-Bug12 (factory default) or a user’s program that has
replaced D-Bug12 in Flash EEPROM.
D-Bug12 upon power-up or reset, D-Bug12 attempts to establish communications with a
target system connected to BDM OUT (W11). Communications are first attempted
without resetting the target system. If communications cannot be established, the
following message is displayed:
Can’t Communicate With The Target Processor
To reset target, hit any key...
Pressing any key on the terminal’s keyboard causes D-Bug12 to assert the target’s reset
pin for approximately 2 mS and try again to establish communications. If
communications fail, the above error message is redisplayed. Once communications have
been established with the target system, the D-Bug12 sign-on banner and prompt should
appear on the terminal’s display as follows:
D-Bug12 v 2.0.0
Copyright 1996 - 1997 Motorola Semiconductor
For Commands type "Help"
S>
If communications cannot be established with the target system after repeated attempts,
check for the following possible problems:
• The host EVB's BDM OUT (W11) must be properly connected to the target system’s
BDM connector. If the target system is another EVB, make sure that the host EVB's
BDM OUT is connected to target EVB's BDM IN (W9).
• If the target system is not another EVB, verify that its BDM connector is wired to the
proper MCU signals on each pin.
• If the target MCU does not have any firmware to execute, it could "run away,"
possibly executing a STOP opcode and preventing BDM communications with the
host EVB.
Thus, it is strongly recommended that, if the target system does not have firmware to
execute at reset, the target MCU be initially configured to begin operation in Special
68EVB912B32UM/D 3-5
OPERATION
Special D-Bug12 command-line prompts indicate the status of the target system:
Single Chip mode. Resetting the target MCU in Special Single Chip mode places it
in active background mode. See the target MCU’s technical summary for details on
setting the MCU operating mode.
S>
R>
target is in active background mode
target is running a user program
In addition to the normal D-Bug12 commands that control execution of user code, the
RESET and STOP commands are available in POD mode. These commands are
described in 3.6 D-Bug12 Command Set.
D-Bug12 must be informed of the target MCU’s basic operating parameters. Refer to
section 3.1.3 for more information about setting up and using POD mode.
User boot program upon reset, the user program executes immediately. D-Bug12 commands
are not available. Communications with the user terminal and with t he target system are
controlled by the user program.
3.2.2.4 BOOTLOAD Mode
In BOOTLOAD mode, a user program may be loaded into the host EVB's byte-erasable or Flash
EEPROM. If the user code replaces D-Bug12 in Flash EEPROM, it serves as the "boot" program
when the EVB is restarted in EVB or POD mode. This procedure is described in Appendix E
EEPROM Bootloader.
3.3 RESET
EVB operation can be restarted at any time by activating the hardware reset function. Do this in
one of two ways:
1. Press and release the on-board reset switch, S1 (always applicable).
2. Activate the external reset input if one has been provided for operation below 3.0
Vdc.
Note that the EVB’s reset circuitry is associated with the low-voltage protection. For more
information, refer to 4.7 Reset and 4.8 Low-Voltage Inhibit.
3.4 ABORTING A USER PROGRAM
When operating in EVB mode, the only way to recover from an erroneous or runaway user
program is to press the reset switch (S1). If this becomes necessary, the jumpers on headers W3
and W4 should be set to execute D-Bug12 at reset instead of the flawed user program.
68EVB912B32UM/D3-6
OPERATION
When operating in POD mode, the D-Bug12 RESET or STOP command can be used to regain
control of the target system.
3.5 USING D-BUG12 COMMANDS
D-Bug12, the EVB’s firmware-resident monitor program, provides a self-contained operating
environment that allows writing, evaluation, and debugging of user programs.
3.5.1 Command-Line Prompt
D-Bug12 displays one of three command-line prompts, depending upon its operating mode
and/or the state of the target system. When D-Bug12 is operating in the EVB mode, it displays
the single character ">" at the beginning of a line when it is waiting for the user to enter a
command. When a command is issued that causes user code to run, D-Bug12 places the terminal
cursor on a blank line, where it remains until control returns to D-Bug12.
When operating in the POD mode, D-Bug12 displays one of two prompts, depending upon the
state of the attached target system. When the target system is in active background mode (not
running a user program), the two-character prompt "S>" is displayed, indicating that the target is
stopped and not running a user program. When the target system is running a user program, the
two-character prompt "R>" is displayed, indicating that the target is running a user program.
Because the M68HC12 Background Debug Mode interface allows the reading and writing of
target system memory even when the target is running a user’s program, the probe
microcontroller is always available for the entry of commands. D-Bug12 commands that
examine or modify target system memory may be issued when either the "S>" or "R>" prompt is
displayed.
3.5.2 Entering Commands
Commands are typed on the terminal’s D-Bug12 prompt line and executed when the carriagereturn (ENTER) key is pressed. D-Bug12 then displays either the appropriate response to the
command or an error indication.
The D-Bug12 command-line prompt is the greater-than sign (>). Type the command and any
other required or optional fields immediately after the prompt, as follows:
command-line syntax:
<command> [<parameter>] ...[<parameter>]<ENTER>
where:
<command>is the command mnemonic.
68EVB912B32UM/D3-7
OPERATION
<parameter>is an expression or address.
<ENTER>is the terminal keyboard’s carriage-return or enter key.
1. The command-line syntax is illustrated using the following special characters for
2. Fields are separated by any number of space characters.
3. All numeric fields, unless noted otherwise, are interpreted as hexadecimal.
4. Command-line entries are case-insensitive and may be typed using any combination
5. A maximum of 80 characters, including the terminating carriage return, may be
NOTES
clarification. Do not type these characters on the command line:
< >required syntactical element
[ ]optional field
...[ ]repeated optional fields
of upper- and lower-case letters.
entered on the command line. After the 80th character, D-Bug12 automatically
terminates the command-line entry and processes the characters entered to that point.
6. Before the <ENTER> or <RETURN> key is pressed, the command line may be
edited using the backspace key. Receiving the backspace character causes D-Bug12
to delete the previously-received character from its input buffer and erase the
character from the display.
3.5.3 Command-Set Summary
Table 3-1 summarizes the D-Bug12 commands. For detailed descriptions of each command,
refer to 3.6 D-Bug12 Command Set.
Table 3-1. D-Bug12 Command-Set Summary
CommandDescription
ASM <address>Single-line assembler/disassembler
BAUD <BAUDRate>Set the SCI communications baud rate
BF <StartAddress><EndAddress> [<Data>]Block fill user memory with data
BR [<Address><Address>...]Set/display user breakpoints
BULKBulk erase byte-erasable EEPROM
CALL [<Address>]Execute a user subroutine; return to D-Bug12 when
finished
DEVICE [
EEBASE <Address>Inform D-Bug12 of the target’s EEPROM base address
FBULKErase the target processor’s on-chip Flash EEPROM
FLOAD <AddressOffset>Program the target processor’s on-chip Flash EEPROM
G [<Address>]Go — begin execution of user program
GT <Address>Go Till — set a temporary breakpoint and begin execution
HELPDisplay D-Bug12 command set and command syntax
LOAD [<AddressOffset>]Load user program in S-Record format*
MD <StartAddress> [<EndAddress>]Memory Display — display memory contents in hex
MDW <StartAddress> [<EndAddress>]Memory Display Word — display memory contents in hex
MM <Address> [<data>]Memory Modify — interactively examine/change memory
MMW <address> [<data>]Memory Modify Word — interactively examine/change
see description
]Select/define a new target MCU device
from S-Records
of user program
bytes/ASCII format
words/ASCII format
contents
memory contents
MOVE <StartAddress> <EndAddress>
<DestAddress>
NOBR [<Address> <Address>...]Remove individual user breakpoints
RDRegister Display — display the CPU register contents
REGBASEInform D-Bug12 of the target I/O register’s base address
RESETReset the target CPU
RMRegister Modify — interactively examine/change CPU
STOPStop execution of user code on the target processor and
T [<Count>]Trace — execute an instruction, disassemble it, and
display the CPU registers
UPLOAD <StartAddress> <EndAddress>Display memory contents in S-Record format*
VERF [<AddressOffset>]Verify memory contents against S-Record Data
<RegisterName> <RegisterValue>Set CPU <RegisterName> to <RegisterValue>
* Refer to Appendix A for S-Record information.
3.6 D-BUG12 COMMAND SET
In the following command descriptions, the examples represent what is seen on the terminal
display. For clarity, the user’s entry is underlined. This underlining does not actually appear
onscreen.
A typical example looks like this:
>baud 9600 user’s entry
Change Terminal BR, Press ReturnD-Bug12’s response
>D-Bug12 prompt for next entry
68EVB912B32UM/D3-10
OPERATION
ASM
syntax:
ASM <Address>
where:
<Address>is a 16-bit hexadecimal number.
The assembler/disassembler is an interactive memory editor that allows memory contents to be
viewed and altered using assembly l anguage mnemonics. Each entered source line is translated
into object code and placed into memory at the time of entry. When displaying memory contents,
each instruction is disassembled into its source mnemonic form and displayed along with the
hexadecimal object code and any instruction operands.
Assembler mnemonics and operands may be entered in any mix of upper and lower case letters.
Any number of spaces may appear between the assembler prompt and the instruction mnemonic
or between the instruction mnemonic and the operand. Numeric values appearing in the operand
field are interpreted as signed decimal numbers. Placing a $ in front of any number will cause
the number to be interpreted as a hexadecimal number.
Assembler/Disassembler
ASM
When an instruction is disassembled and displayed, the D-Bug12 prompt is displayed following
the disassembled instruction. If a carriage return is the first non-space character entered
following the prompt, the next instruction in memory is disassembled and displayed on the next
line.
If a CPU12 instruction is entered following the prompt, the entered instruction is assembled and
placed into memory. The line containing the new entry is erased and the new instruction is
disassembled and displayed on the same line. The next instruction location is then disassembled
and displayed on the screen.
The instruction mnemonics and operand formats accepted by the assembler foll ows the syntax as
described in the CPU12 Reference Manual.
There are a number of M68HC11 instruction mnemonics that appear in the CPU12 ReferenceManual that do not have directly equivalent CPU12 instructions. These mnemonics, listed in
Table 3-2, are translated into functionally equivalent CPU12 instructions. To aid the current
M68HC11 users who may desire to continue using the M68HC11 mnemonics, the disassembler
portion of the assembler/disassembler recognizes the functionally equivalent CPU12 instructions
and disassembles those instructions into the equivalent M68HC11 mnemonics.
When entering branch instructions, the number placed in the operand field should be the absolute
destination address of the instruction. The assembler calculates the two’s-complement offset of
the branch and places the offset in memory with the instruction
68EVB912B32UM/D3-11
OPERATION
The assembly/disassembly process may be terminated by entering a period (.) as the first nonspace character following the assembler prompt.
restrictions:
None.
Table 3-2. M68HC11 to CPU12 Instruction Translation
assembly operand format:
This section describes the operand format used by the assembler when assembling CPU12
instructions. The operand format accepted by the assembler is described separately in the CPU12Reference Manual. Rather than describe the numeric format accepted for each instruction, some
general rules are used. Exceptions and complicated operand formats are described separately.
In general, anywhere the assembler expects a numeric value in the operand field, either a decim al
or hexadecimal value may be entered. Decimal numbers are entered as signed constants having a
range of -32768 to 65535. A leading minus sign (-) indicates negative numbers, the absence of a
leading minus sign indicates a positive number. A leading plus sign (+) is not allowed.
68EVB912B32UM/D3-12
OPERATION
Hexadecimal numbers must be entered with a leading dollar sign ($) followed by one to four
hexadecimal digits. The default number base is decimal.
For all branching instructions (Bcc, LBcc, BRSET, BRCLR, DBEQ, DBNE, IBEQ, IBNE,
TBEQ, and TBNE), the number entered as the branch address portion of the operand field is the
absolute address of the branch destination. The assembler calculates the two’s-complement
offset to be placed in the assembled object code.
disassembly operand format:
The operand format used by the disassembler is described separately in the CPU12 Reference
Manual. Rather than describing the numeric format used for each instruction, some general rules
are applied. Exceptions and complicated operand formats are described separately.
All numeric values disassembled as hexadecimal num bers are preceded by a dollar sign ($) to
avoid being confused with values disassembled as signed decimal numbers.
For all branch (Bcc, LBcc, BRSET, BRCLR, DBEQ, DBNE, IBEQ, IBNE, TBEQ, TBNE)
instructions the numeric value of the address portion of the operand field is displayed as the
hexadecimal absolute address of the branch destination.
All offsets used with indexed addressing modes are disassembled as signed decimal numbers.
All addresses, whether direct or extended, are disassembled as four digit hexadecimal numbers.
All 8-bit mask values (BRSET/BRCLR/ANDCC/ORCC) are disassembled as two-digit
hexadecimal numbers.
All 8-bit immediate values are disassembled as hexadecimal numbers.
All 16-bit immediate values are disassembled as hexadecimal numbers.
68EVB912B32UM/D3-13
OPERATION
BAUD
Set Baud Rate
BAUD
syntax:
BAUD <BAUDRate>
where:
<BAUDRate>is an unsigned 16-bit decimal number.
The BAUD command is used to change the communications rate of the SCI used by D-Bug12 for
the terminal interface.
restrictions:
Because the <BAUDRate> parameter supplied on the command line is a 16-bit unsigned integer,
BAUD rates greater than 65535 baud cannot be set using this command. The SCI BAUD rate
divider value for the requested BAUD rate is calculated using the E-clock value supplied in the
D-Bug12 customization data area. Because the SCI BAUD rate divider is a 13-bit counter,
certain BAUD rates may not be supported at particular E-clock frequencies. If the value
calculated for the SCI’s BAUD rate divider is equal to zero or greater than 8191, command
execution is terminated and the communications BAUD rate is not changed.
<StartAddress>is a 16-bit hexadecimal number.
<EndAddress>is a 16-bit hexadecimal number.
<Data>is an 8-bit hexadecimal number.
The Block Fill command is used to place a single 8-bit value into a range of memory locations.
<StartAddress> is the first memory location written with <data> and <EndAddress> is the last
memory location written with <data>. If the <data> parameter is omitted, the memory range is
filled with the value $00.
restrictions:
None.
Block Fill
BF
example:
>BF 6400 6fff 0
>BF 6f00 6fff 55
>
68EVB912B32UM/D3-15
OPERATION
BR
syntax:
BR [<Address> <Address> ...]
where:
<Address>are optional 16-bit hexadecimal numbers.
The BR command is used to set a software breakpoint at a specified address or to display any
previously set breakpoints. The function of a breakpoint is to halt user program execution when
the program reaches the breakpoint address. When a breakpoint address is encountered,
D-Bug12 disassembles the instruction at the breakpoint address, prints the CPU12’s register
contents, and waits for a D-Bug12 command to be entered by the user.
Breakpoints are set by typing the breakpoint command followed by one or more breakpoint
addresses. Entering the breakpoint command without any breakpoint addresses will display all
the currently set breakpoints.
A maximum of 10 user breakpoints may be set at one time.
Breakpoint Set
BR
restrictions:
D-Bug12 implements the breakpoint function by replacing the opcode at the breakpoint address
in the users program with an SWI instruction when operating in EVB mode or with the BGND
instruction when operating in POD mode. A breakpoint may not be set on a user SWI instruction
when operating in EVB mode. In either mode, breakpoints may only be set at an opcode address,
and breakpoints may only be placed at memory addresses in alterable memory.
Even though D-Bug12 supports a maximum of 10 user-defined breakpoints, a maximum of 9
breakpoints may be set on the command line at one time. This restriction is due to the limitation
of the command-line processor, which allows a maximum of 10 command-line arguments,
including the command string.
When operating in POD mode, new breakpoints may not be set with the BR command when the
"R>" prompt is displayed. However, the BR command may be used to display breakpoints that
are currently set in the user's running program.
D-Bug12 version 2.0.0 does not support the MC68HC912B32's hardware breakpoint (H/W)
function. Later versions of D-Bug12, which may support this function, can be obtained from the
sources listed in Obtaining D-Bug12 Upgrades on page E-6.
68EVB912B32UM/D3-16
example:
>BR 35ec 2f80 c592
Breakpoints: 35EC 2F80 C592
>BR
Breakpoints: 35EC 2F80 C592
>
OPERATION
68EVB912B32UM/D3-17
OPERATION
BULK
Bulk Erase EEPROM
BULK
syntax:
BULK
The BULK command is used to erase the entire contents of byte-erasable EEPROM in a single
operation. After the bulk erase operation has been performed, each on-chip EEPROM location is
checked for an erased condition.
restrictions:
In order to erase EEPROM, the EEPROM block-protect control bits must be cleared. Refer to
the MC68HC912B32 Technical Summary for locations and operation of the block-protect
controls.
example:
>BULK
F/EEPROM Failed To Erase
>BULK
>
68EVB912B32UM/D3-18
OPERATION
CALL
Call Subroutine
CALL
syntax:
CALL [<Address>]
where:
<Address>is an optional 16-bit hexadecimal number.
The CALL command is used to execute a subroutine and return to the D-Bug12 monitor program
when the final RTS of the subroutine is executed. When control is returned to D-Bug12, the
CPU register contents are displayed. All CPU registers contain the values at the time the final
RTS instruction was executed, with the exception of the program counter (PC). The PC contains
the starting address of the subroutine. If a subroutine address is not supplied on the command
line, the current value of the Program Counter (PC) is used as the starting address.
NOTE:
No user breakpoints are placed in memory before execution is
transferred to user code.
restrictions:
If the called subroutine modifies the value of the stack pointer during its execution, it must
restore the stack pointer’s original value before executing the final RTS of the call ed subroutine.
This restriction is required because a return address is placed on the users stack that retu rns to
D-Bug12 when the final RTS of the subroutine is executed. Obviously, any subroutine must
obey this restriction to execute properly.
The CALL command cannot be issued when the "R>" prompt is displayed, indicating that the
target system is already running a user program.
example:
>CALL 820
Subroutine Call Returned
PC SP X Y D = A:B CCR = SXHI NZVC
0820 0A00 057C 0000 0F:F9 1001 0000
>
<DeviceName>is the maximum of 7 ASCII characters used to select/define a target
<EEStart>is the on-chip EEPROM starting address; a 16-bit hexadecimal
<EEEnd>is the on-chip EEPROM ending address; a 16-bit hexadecimal
<FStart>is the on-chip Flash EEPROM starting address; a 16-bit
<FEEnd>is the on-chip Flash EEPROM ending address; a 16-bit
Specify Target MCU Device
<FEnd> <RAMStart> <RAMEnd> <IOBase>]
MCU device.
number.
number.
hexadecimal number.
hexadecimal number.
DEVICE
<RAMStart>is the on-chip RAM starting address; a 16-bit hexadecimal number.
<RAMEnd>is the on-chip RAM ending address; a 16-bit hexadecimal number.
<IOBase>is the base address of the on-chip I/O registers; a 16-bit
hexadecimal number.
Selecting the proper target MCU with the DEVICE command provides D-Bug12 the information
necessary to allow transparent alteration of the target MCU’s on-chip EEPROM using any
D-Bug12 commands that modify memory. It also provides the necessary information to allow
the programming and erasure of on-chip Flash EEPROM. In addition, it allows D-Bug12 to
initialize the stack pointer to the top of on-chip RAM when the target MCU is reset by use of the
RESET command. The DEVICE command has three separate command line formats that allows
for the display, selection and/or definition of target device parameters.
Entering "DEVICE" on the command line followed by a carriage return displays the name of the
currently selected device, the on-chip EEPROM’s starting and ending address, the on-chip Flash
EEPROM’s starting and ending address, the on-chip RAM’s starting and ending address, and the
I/O Base address. This form of the command may be used when D-Bug12 is operating in either
EVB or POD mode.
When D-Bug12 is operated in the POD mode, the DEVICE command may also be used to select
or define a new target device. Entering the DEVICE command followed only by a device name
68EVB912B32UM/D3-20
OPERATION
configures D-Bug12 for operation with the selected target device. The default device list
contains entries for the MC68HC912B32 and the MC68HC812A4. The table below shows the
command line name to use for the two default MCU devices.
Device NameTarget MCU
912B32MC68HC912B32
812A4MC68HC812A4
Entering the DEVICE command followed by a device name and seven hexadecimal parameters
allows new devices to be added to the target device table or existing device table entries to be
modified. When a new device is added or when an existing device entry is modified, it becomes
the currently selected device. If a new device does not contain a particular on-chip resource, such
as Flash EEPROM, a value of zero should be entered for the starting and ending addresses
Because the target device data and the current device selection are stored in the probe MCU’s onchip EEPROM, new device information and the device selection are retained when power is
removed from the POD. If the M68EVB912B32 is operated in EVB mode and the contents of
any locations of the on-chip EEPROM are altered it is strongly recommended that the on-chip
EEPROM be completely erased by using the BULK command before using the EVB in POD
mode again. Erasing the on-chip EEPROM causes D-Bug12 to reinitialize the device table with
the two default MCU devices. The information for any new devices that were added to the table
will be lost.
restrictions:
When operating the M68EVB912B32 in EVB mode, the DEVICE command may only be used to
display the current device information.
The DEVICE command maintains a 16-bit checksum on the contents of the entire on-chip
EEPROM to maintain the integrity of the device table. If any of the on-chip EEPROM locations
are altered while operating the M68EVB912B32 in EVB mode, D-Bug12 will reinitialize the
device table with the default device information contained in the on-chip Flash EEPROM.
However, it is possible for the checksum verification to fai l (one case where the checksum will
fail is if the entire contents of the on-chip EEPROM is programmed with zeros). Therefore, it is
strongly recommended that the on-chip EEPROM be completely erased by using the BULK
command before using the EVB in POD mode again. Using the EVB in Probe mode with a
corrupt device data table may cause D-Bug12 to operate in an unpredictable manner.
The 768 bytes of on-chip EEPROM allows a total of 34 entries in the device table. Do not
exceed this number.
When adding a new device to the device table, the addresses provided for the on-chip Flash
EEPROM, on-chip RAM and the I/O Registers should reflect the locations of these resources
when the part is reset. This requirement is necessary for the FBULK and FLOAD commands to
work properly.
<Address>is an optional 16-bit hexadecimal number.
Each time D-Bug12 performs a memory write, it automatically performs the necessary register
manipulations to program the on-chip EEPROM if the write operation falls within the address
range of the target’s on-chip EEPROM. Because user code may change the EEPROM’s base
address by writing to the INITEE register, D-Bug12 must be informed of the EEPROM’s
location if automatic EEPROM writes are to occur. The EEBASE command is used to specify
the base address of the target processor’s on-chip EEPROM.
When operating in EVB mode, the default EEPROM base address and range are specified in the
customization data variables CustomData.EEBase and CustomData.EESize. The value
in CustomData.EEBase is used by the startup code to remap the EEPROM. The EEBASE
command may not be used to relocate the I/O registers.
Specify Target EEPROM
Base Address
EEBASE
When operating in POD mode, the target’s default EEPROM base address and range are
specified by the currently-selected device (See the DEVICE command for additional details).
The EEBASE command does not check to ensure that the parameter is a valid base address for
the selected M68HC12 family member. If an improper base address is provided, automatic
programming of the on-chip EEPROM will not operate properly.
NOTE
The EEBASE command does not automatically modify the
INITEE register. It is the responsibility of the user to ensure that
the INITEE register is modified either manually or through the
execution of user code.
restrictions:
The EEBASE command may not be used when D-Bug12 is operated in EVB mode.
The FBULK command is used to erase the entire contents of the target MCU’s on-chip Flash
EEPROM in a single operation. After the bulk erase operation has been performed, each on-chip
Flash location is verified. If the contents are not $FF, an error message is displayed.
The target processor’s Flash EEPROM is erased by resetting the target processor and then
loading a small driver program into the target processor’s on-chip RAM. For this reason, the
previous contents of the target processor’s on-chip RAM are lost.
restrictions:
When operating in the EVB mode, the FBULK command cannot be used. If the FBULK
command is entered while in EVB mode, an error message is displayed and command execution
is terminated.
Before using the FBULK command, a target device must have been selected with the DEVICE
command that reflects the locations of the target’s on-chip Flash EEPROM, on-chip RAM, and
the I/O registers when the part is reset. Failure to follow this restriction will cause the FBULK
command to fail and may require that the EVB be reset.
Erase Target Flash
EEPROM
FBULK
Flash EEPROM programming voltage (Vpp) must be applied to the target MCU. If the target
system is another M68EVB912B32 board, Vpp may be supplied via header W 8, with header W 7
set accordingly. For more information on these EVB headers, see Table 4-1.
Because the FBULK command downloads a small "driver" program into the target MC U's onchip RAM, D-Bug12's breakpoint table is cleared before beginning execution of the "driver".
This is necessary to prevent previously-set breakpoints from accidentally halting the execution of
the driver program.
68EVB912B32UM/D3-25
OPERATION
example:
S>FBULK
Flash Programming Voltage Not Present
S>FBULK
F/EEPROM Failed To Erase
S>FBULK
S>
>FBULK
Command Not Allowed In EVB Mode
>
68EVB912B32UM/D3-26
OPERATION
FLOAD
syntax:
FLOAD [<AddressOffset>]
where:
<AddressOffset>is a 16-bit hexadecimal number.
The FLOAD command is used to program a target device’s Flash EEPROM memory with the
data contained in S-Record object files. The address offset, if supplied, is added to the load
address of each S-Record before the S-Record’s data bytes are placed in m emory. Providing an
address offset other than zero allows object code or data to be programmed into memory at a
location other than that for which it was assembled or compiled.
The programming of the on-chip Flash EEPROM uses an algorithm where the time required to
program each byte or word can vary from as little as 60 µS to as long as 3.5 mS (note, however
that the programming time for each byte or word should typically take no more than 120-180
µ S). Because of this variability, the FLOAD command uses a software handshaking protocol to
control the flow of S-Record data from the host computer. When the FLOAD command is ready
to receive an S-Record, an ASCII asterisk character (*) is sent to the host computer. The host
computer should respond by sending a single S-Record. The S-Record may include a carriage
return and/or line feed character(s). Most commercial terminal programs that are capable of
sending ASCII text files have the ability to wait for a specific character or characters before
sending a line of text.
Program Target Flash
EEPROM
FLOAD
The FLOAD command is terminated when D-Bug12 receives an "S9" end-of-file record. If the
object file being loaded does not contain an "S9" record, D-Bug12 does not return its prompt and
continues to wait for the end-of-file record. Pressing the reset switch returns D-Bug12 to its
command line prompt.
restrictions:
The host program used to send the S-Record data must be capable of waiting for an ASCII
asterisk character (*) before sending each S-Record line.
Because the on-chip Flash EEPROM is only bulk-erasable, the FBULK command should be used
before loading new data into Flash EEPROM with the FLOAD command.
The FLOAD command cannot be used with S-Records that contain a code/data field longer than
64 bytes. Sending an S-Record with a longer field may cause D-Bug12 to crash or load incorrect
data into the Flash EEPROM.
68EVB912B32UM/D3-27
OPERATION
Before using the FLOAD command, a target device must have been selected using the DEVICE
command that reflects the locations of the on-chip Flash EEPROM, on-chip RAM, and t he I/O
registers when the part is reset. Failure to follow this restriction will cause the FLOAD
command to fail and may require that the EVB be reset.
Flash EEPROM programming voltage (Vpp) must be applied to the target MCU. If the target
system is another M68EVB912B32 board, Vpp may be supplied via header W 8, with header W 7
set accordingly. For more information on these EVB headers, see Table 4-1.
Because the FLOAD command downloads a small "driver" program into the target MC U’s onchip RAM, D-Bug12’s breakpoint table is cleared before beginning execution of the "driver".
This is necessary to prevent previously set breakpoints from accidentally halting the execution of
the driver program.
example:
S>FLOAD
Flash Programming Voltage Not Present
S>FLOAD
<Address>is an optional 16-bit hexadecimal number.
The G command is used to begin the execution of user code in real time. Before beginning
execution of user code, any breakpoints that were set with the BR command are placed in
memory. Execution of the user program continues until a user breakpoint is encountered, a CPU
exception occurs, the STOP or RESET command is entered, or the EVB’s reset switch is pressed.
When user code halts for any of these reasons (except reset, which wipes the slate clean) and
control is returned to D-Bug12, a message is displayed ex plaining the reason for user program
termination. In addition, D-Bug12 disassembles the instruction at the current PC address, prints
the CPU12’s register contents, and waits for the next D-Bug12 command to be entered by the
user.
If a starting address is not supplied in the command line parameter, program execution will begin
at the address defined by the current value of the Program Counter.
restrictions:
The G command cannot be issued when the "R>" prompt is displayed, indicating that the target
system is already running a user program.
PC SP X Y D = A:B CCR = SXHI NZVC
0820 09FE 057C 0000 00:00 1001 0100
0820 08 INX
S>
68EVB912B32UM/D3-29
OPERATION
GT
Go Till
GT
syntax:
GT <Address>
where:
<Address>is a 16-bit hexadecimal number.
The GT command is similar to the G command except that a temporary breakpoint is placed at
the address supplied on the command line. Any breakpoints that were set by the use of the BR
command are NOT placed in the user code before program execution begins. P rogram execution
begins at the address defined by the current value of the Program Counter. When user code
reaches the temporary breakpoint and control is returned to D-Bug12, a message is displayed
explaining the reason for user program termination. In addition, D-Bug12 disassembles the
instruction at the current PC address, prints the CPU12’s register contents, and waits for a
command to be entered by the user.
restrictions:
The GT command cannot be issued when the "R>" prompt is displayed, indicating that the target
system is already running a user program.
example:
S>GT 820
R>
Temporary Breakpoint Encountered
PC SP X Y D = A:B CCR = SXHI NZVC
0820 09FE 057C 0000 00:00 1001 0100
0820 08 INX
S>
68EVB912B32UM/D3-30
OPERATION
HELP
syntax:
HELP
The HELP command is used to display a summary of the D-Bug12 command set. Each
command is shown along with its command line format and a brief description of its function.
restrictions:
None.
Onscreen Help Summary
HELP
68EVB912B32UM/D3-31
OPERATION
example:
>HELP
ASM <Address> Single line assembler/disassembler
<CR> Disassemble next instruction
<.> Exit assembly/disassembly
BAUD <baudrate> Set communications rate for the terminal
BF <StartAddress> <EndAddress> [<data>] Fill memory with data
BR [<Address>] Set/Display user breakpoints
BULK Erase entire on-chip EEPROM contents
CALL [<Address>] Call user subroutine at <Address>
DEVICE [<DevName> [<Address>...<Address>]] display/select/add
target device
EEBASE <Address> Set base address of on-chip EEPROM
FBULK Erase entire target Flash contents
FLOAD [<AddressOffset>] Load S-Records into target Flash
G [<Address>] Begin/continue execution of user code
GT <Address> Set temporary breakpoint at <Address> & execute
user code
HELP Display this D-Bug12 command summary
LOAD [<AddressOffset>] Load S-Records into memory
MD <StartAddress> [<EndAddress>] Memory Display Bytes
MDW <StartAddress> [<EndAddress>] Memory Display Words
MM <StartAddress> Modify Memory Bytes
<CR> Examine/Modify next location
</> or <=> Examine/Modify same location
<^> or <-> Examine/Modify previous location
<.> Exit Modify Memory command
MMW <StartAddress> Modify Memory Words (same subcommands as MM)
MOVE <StartAddress> <EndAddress> <DestAddress> Move a block of
memory
NOBR [<address>] Remove One/All Breakpoint(s)
RD Display all CPU registers
REGBASE <Address> Set base address of I/O registers
RESET Reset target CPU
RM Modify CPU Register Contents
STOP Stop target CPU
T [<count>] Trace <count> instructions
UPLOAD <StartAddress> <EndAddress> S-Record Memory display
VERF [<AddressOffset>] Verify S-Records against memory contents
<Register Name> <Register Value> Set register contents
Register Names: PC, SP, X, Y, A, B, D
CCR Status Bits: S, XM, H, IM, N, Z, V, C
>
68EVB912B32UM/D3-32
OPERATION
LOAD
Load S-Record File
LOAD
syntax:
LOAD [<AddressOffset>]
{
Send File
}
where:
<AddressOffset>is an optional 16-bit hexadecimal number.
{Send File}is the host-computer communications program’s utility for sending
an ASCII (text) file. Refer to Appendix B Communications
Program Examples.
The LOAD command is used to load S-Record object files into memory from an external device.
The address offset, if supplied, is added to the load address of each S-Record before its data bytes
are placed in memory. P roviding an address offset other than zero allows object code or data to
be loaded into memory at a location other than that for which it was assembled. During the
loading process, the S-Record data is not echoed to the control consol e. However, for each ten
S-Records that are successfully loaded, an ASCII asterisk character (*) is sent to the control
console, When an S-Record file has been successfully loaded, control returns to the D-Bug12
prompt.
The LOAD command is terminated when D-Bug12 receives an S9 end-of-file record. If the
object file being loaded does not contain an S9 record, D-Bug12 does not return its prompt and
continues to wait for the end-of-file record. Pressing the reset switch returns D-Bug12 to its
command line prompt.
restrictions:
When operating in POD mode, the LOAD command does not support standard baud rates above
38400. This is due to the overhead involved in the implementation of the custom serial protocol
required by the single-wire Background Debug Mode interface.
example:
>LOAD 1000
********************
>
68EVB912B32UM/D3-33
OPERATION
MD
Memory Display
MD
syntax:
MD <StartAddress> [<EndAddress>]
where:
<StartAddress>is a 16-bit hexadecimal number.
<EndAddress>is an optional 16-bit hexadecimal number.
The Memory Display command displays the contents of memory as both hexadecimal bytes and
ASCII characters, 16-bytes on each line. The <StartAddress> parameter must be supplied; the
<EndAddress> parameter is optional. When the <EndAddress> parameter is not supplied, a
single line is displayed.
The number supplied as the <StartAddress> parameter is rounded down to the next lower
multiple of 16, while the number supplied as the <EndAddress> parameter is rounded up to the
next higher multiple of 16 - 1. This causes each line to display memory in the range of $xxx0
through $xxxF. For example, if $205 is entered as the start address and $217 as the ending
address, the actual memory range displayed would be $200 through $21F.
<StartAddress>is a 16-bit hexadecimal number.
<EndAddress>is an optional 16-bit hexadecimal number.
The Memory Display Word command displays the contents of memory as hexadecimal words
and ASCII characters, 16-bytes on each line. The <StartAddress> parameter must be supplied;
the <EndAddress> parameter is optional. When the <EndAddress> parameter is not supplied, a
single line is displayed.
The number supplied as the <StartAddress> parameter is rounded down to the next lower
multiple of 16, while the number supplied as the <EndAddress> parameter is rounded up to the
next higher multiple of 16 - 1. This causes each line to display memory in the range of $xxx0
through $xxxF. For example, if $205 is entered as the start address and $217 as the ending
address, the actual memory range displayed would be $200 through $21F.
<Address>is a16-bit hexadecimal number.
<Data>is an optional 8-bit hexadecimal number.
The Memory Modify command allows the contents of memory to be examined and/or modified
as 8-bit hexadecimal data. If the 8-bit data parameter is present on the command line, the byte at
memory location <Address> is replaced with <Data> and the command is terminated. If not,
D-Bug12 enters the interactive memory modify mode. In the interactive mode, each byte is
displayed on a separate line following the data’s address. Once the memory modify command
has been entered, single-character sub-commands are used for the modification and verification
of memory contents. These sub-commands have the following format:
[<Data>] <CR>Optionally update current location and display the next location.
[<Data>] </> or <=> Optionally update current location and redisplay the current
location.
Memory Modify
MM
[<Data>] <^> or <-> Optionally update current location and display the previous
location.
[<Data>] <.>Optionally update current location and exit Memory Modify.
With the exception of the carriage return, the sub-command must be separated from any entered
data with at least one space character. If an invalid sub-command character is entered, an
appropriate error message is issued and the contents of the current memory location are
redisplayed.
restrictions:
While there are no restrictions on the use of the MM command, caution should be used when
modifying target memory while user code is running. Accidentally modifying target memory
containing program code could lead to program runaway.
<Address>is a 16-bit hexadecimal number.
<Data>is an optional 16-bit hexadecimal number.
The Memory Modify Word command allows the contents of memory to be examined and/or
modified as 16-bit hexadecimal data. If the 16-bit data parameter is present on the command
line, the word at memory location <Address> is replaced with <Data> and the command is
terminated. If not, D-Bug12 enters the interactive memory modify mode. In the interactive
mode, each word is displayed on a separate line following the data’s address. Once the memory
modify command has been entered, single-character sub-commands are used for the modification
and verification of memory contents. These sub-commands have the following format:
[<Data>] <CR>Optionally update current location and display the next location.
[<Data>] </> or <=> Optionally update current location and redisplay the current
Memory Modify, Word
location.
MMW
[<Data>] <^> or <-> Optionally update current location and display the previous
location.
[<Data>] <.>Optionally update current location and exit Memory Modify.
With the exception of the carriage return, the sub-command must be separated from any entered
data with at least one space character. If an invalid sub-command character is entered, an
appropriate error message is issued and the contents of the current memory location are
redisplayed.
restrictions:
While there are no restrictions on the use of the MMW command, caution should be used when
modifying target memory while user code is running. Accidentally modifying target memory
containing program code could lead to program runaway.
<StartAddress>is a 16-bit hexadecimal number.
<EndAddress>is a 16-bit hexadecimal number.
<DestAddress>is a 16-bit hexadecimal number.
The MOVE command is used to move a block of memory from one location to another, one byte
at a time. The number of bytes moved is one more than the <EndAddress> - <StartAddress>.
The block of memory beginning at the destination address may overlap the memory block
defined by the <StartAddress> and <EndAddress>.
One of the uses of the MOVE command might be to copy a program from RAM into the on-chip
EEPROM memory.
restrictions:
Move Memory Block
MOVE
A minimum of one byte may be moved if the <StartAddress> is equal to the <EndAddress>. The
maximum number of bytes that may be moved is 216 - 1.
Caution should be exercised when moving target memory while user code is running.
Accidentally modifying target memory containing program code could lead to program runaway.
example:
>MOVE 800 8ff 1000
>
68EVB912B32UM/D3-40
OPERATION
NOBR
Remove Breakpoints
NOBR
syntax:
NOBR [<Address> <Address> ...]
where:
<Address>is an optional 16-bit hexadecimal number.
The NOBR command can be used to remove one or more previously entered breakpoints. If the
NOBR command is entered without any arguments, all user breakpoints are removed from the
breakpoint table.
restrictions:
When operating in the POD mode, breakpoints may not be removed with the NOBR command
when the "R>" prompt is displayed.
The Register Display command is used to display the CPU12’s registers.
restrictions:
When operating in POD mode, the CPU registers may not be displayed when the "R>" prompt is
displayed.
example:
>RD
PC SP X Y D = A:B CCR = SXHI NZVC
0206 03FF 1000 3700 27:FF 1001 0001
>
68EVB912B32UM/D3-42
OPERATION
REGBASE
syntax:
REGBASE <Address>
where:
<Address>is a 16-bit hexadecimal number.
Because D-Bug12 supports the ability to transparently program the on-chip EEPROM of the
target MCU, it must know the base address of the I/O registers. Because user code may change
the register block’s base address by writing to the INITRG register, D-Bug12 must be informed
of the register block’s base address for transparent EEPROM writes to occur. The REGBASE
command is used to specify the base address of the target processor’s on-chip registers.
The REGBASE command does not check to ensure that the <Address> parameter is a valid base
address for the selected M68HC12 family member. If an improper register base address is
provided, automatic programming of the on-chip EEPROM will not operate properly.
When operating in EVB mode, the default register base address is specified in the customization
data variable CustomData.IOBase. This value is used by the startup code to remap the I/O
registers. The REGBASE command may not be used to relocate the I/O registers.
Specify Target EEPROM
Register Address
REGBASE
NOTE
The REGBASE command does not automatically modify the
INITRG register. It is the responsibility of the user to ensure that
the INITRG register is modified either manually or through the
execution of user code.
restrictions:
The REGBASE command may not be used when D-Bug12 is operated in the EVB mode.
The RESET command is used to reset the target system processor when operating in D-Bug12’s
POD mode. The target processor’s reset pin is held byte-erasable for approximately 2 mS.
When the reset line is released, BDM commands are sent to the t arget processor t o place it in
active background mode. The target processor’s registers are initialized with the same values
used for the registers when operating in EVB mode.
The effects of the RESET command may be different from a user assertion of the target's
RESET* pin:
• When the RESET command is issued, the host EVB controls the state of the target's
BKGD pin, placing the target processor in Special mode and active background
execution.
• When a user assertion of the target's RESET* pin occurs, the target processor may
enter either Special or Normal mode, depending on the state of its BKGD pin.
D-Bug12 displays a message indicating that the target processor has been reset.
restrictions:
When operating in the EVB mode, the RESET command cannot be used. If the RESET
command is entered while in EVB mode, an error message is displayed and command execution
is terminated.
example:
S>RESET
Target Processor Has Been Reset
S>G 4000
R>RESET
Target Processor Has Been Reset
S>
68EVB912B32UM/D3-45
OPERATION
RM
Register Modify
RM
syntax:
RM
The Register Modify command is used to examine and/or modify the contents of the CPU12’s
registers in an interactive manner. As each register and its contents is displayed, D-Bug12 allows
the user to enter a new value for the register in hexadecimal. If modification of the displayed
register is not desired, entering a carriage return will cause the next CPU12 register and its
contents to be displayed on the next line. When the last of the CPU12’s registers has been
examined and/or modified, the RM command displays the first register, giving the user an
opportunity to make additional modifications to the CPU12’s register contents. Typing a period
(.) as the first non space character on the line will exit the interactive mode of the register modify
command and return to the D-Bug12 prompt. The registers are displayed in the following order,
one register per line: PC, SP, X, Y, A, B, CCR.
restrictions:
When operating in POD mode, the CPU registers may not be modified when the "R>" prompt is
displayed.
When operating in D-Bug12’s POD mode, the STOP command is used to halt target program
execution and place the target processor in active Background Debug Mode.
restrictions:
When operating in the EVB mode, the STOP command cannot be used. If the STOP command
is entered while in EVB mode, an error message is displayed and command execution is
terminated.
example:
S>ASM 4000
4000 CCFFFF LDD #$FFFF
4003 830001 SUBD #$0001
4006 26FB BNE $4003
4008 20F6 BRA $4000
400A 00 BGND >.
S>G 4000
R>STOP
Target Processor Has Been Stopped
PC SP X Y D = A:B CCR = SXHI NZVC
4003 0A00 0000 0000 37:3F 1101 0000
4003 830001 SUBD #$0001
S>
68EVB912B32UM/D3-47
OPERATION
T
syntax:
T [<Count>]
where:
<Count>is an optional 8-bit decimal number in the range 1 to 255.
The Trace command is used to execute one or more user program instructions beginning at the
current Program Counter (PC) location. As each program instruction is executed, the CP U12’s
register contents are displayed and the next instruction to be executed is displayed. A single
instruction may be ex ecuted by entering the trace command immediately followed by a carriage
return.
restrictions:
Because of the method used to execute a single instruction, branch instructions (Bcc, LBcc,
BRSET, BRCLR, DBEQ/NE, IBEQ/NE, TBEQ/NE) that contain an offset that branches back to
the instruction opcode DO NOT execute. D-Bug12 appears to become stuck at the branch
instruction and does not execute the instruction even if the condition for the branch instruction is
satisfied. This limitation can be overcome by using the GT (Go Till) command to set a
temporary breakpoint at the instruction following the branch instruction.
Trace
T
In EVB mode, the Trace command may only be used for code located in alterable memory.
These restrictions do not apply when using D-Bug12 on a target system in POD mode.
68EVB912B32UM/D3-48
example:
>T
PC SP X Y D=A:B CCR=SXHI NZVC
0803 09FE 057C 0000 10:00 1001 0000
0803 830001 SUBD #$0001
>T 3
PC SP X Y D=A:B CCR=SXHI NZVC
0806 09FE 057C 0000 0F:FF 1001 0000
0806 26FB BNE $0803
PC SP X Y D=A:B CCR=SXHI NZVC
0803 09FE 057C 0000 0F:FF 1001 0000
0803 830001 SUBD #$0001
PC SP X Y D=A:B CCR=SXHI NZVC
0806 09FE 057C 0000 0F:FE 1001 0000
0806 26FB BNE $0803
>
OPERATION
68EVB912B32UM/D3-49
OPERATION
UPLOAD
Display Memory in S-Record Format
UPLOAD
syntax:
UPLOAD <StartAddress> <EndAddress>
where:
<StartAddress>is a 16-bit hexadecimal number.
<EndAddress>is a 16-bit hexadecimal number.
The UPLOAD command is used to display the contents of memory in Motorola S-Record
format. In addition to displayi ng the specified range of memory, the UPLOAD command also
outputs an S9 end-of-file record. The output of this command may be captured by the users
terminal program and saved to a disk file.
<AddressOffset>is an optional 16-bit hexadecimal number.
{Send File}is the host-computer communications program’s utility for sending
an ASCII (text) file. Refer to Appendix B Communications
Program Examples.
The VERF command is used to compare the data contained in an S-Record object file to the
contents of EVB memory. The address offset, if supplied, is added to the load address of each
S-Record before an S-Record’s data bytes are compared to the contents of memory. Providing an
address offset other than zero allows the S-Record’s object code or dat a to be compared against
memory other than that for which the S-Record was assembled.
During the verification process, an ASCII asterisk character (*) is sent to the control console for
each ten S-Records that are successfully verified. When an S-Record file has been successfully
verified, control returns to the D-Bug12 prompt.
If the contents of EVB memory do not match the corresponding data in the received S-Records,
an error message is displayed and the Verify command is terminated. D-Bug12 then returns to its
command-line prompt. If the host computer continues to send S-Records to the EVB, D-Bug12
tries to interpret each S-Record as a command and issues error message for each S-Record
received.
If the contents of EVB memory match the contents of the received S-Records, the Verify
command terminates when D-Bug12 receives an S9 end-of-file record. If the object file being
verified does not contain an S9 record, D-Bug12 continues to wait for an S9 record without
returning to the command-line prompt. Pressing the reset switch, S1, returns D-Bug12 to its
command-line prompt.
restrictions:
None.
example:
>VERF 1000
********************
>
68EVB912B32UM/D3-51
OPERATION
<Register Name>
Modify Register Value
<Register Name>
syntax:
<RegisterName> <RegisterValue>
where:
<RegisterName>is one of the CPU12 registers listed in Table 3-3.
<RegisterValue>is an 8- or 16-bit hexadecimal number.
Table 3-3. CPU12 Registers
Register NameDescriptionLegal Range
PCProgram Counter$0 to $FFFF
SPStack Pointer$0 to $FFFF
XX-Index Register$0 to $FFFF
YY-Index Register$0 to $FFFF
AA Accumulator$0 to $FF
BB Accumulator$0 to $FF
DD Accumulator (A:B)$0 to $FFFF
CCRCondition Code Register$0 to $FF
Each of the fields in the Condition Code Register (CCR) may be modifi ed by using the bit names
in Table 3-4.
Table 3-4. Condition Code Register Bits
CCR Bit NameDescriptionLegal Values
SSTOP Enable0 or 1
HHalf Carry0 or 1
NNegative Flag0 or 1
ZZero Flag0 or 1
VTwo’s Complement Overflow Flag0 or 1
CCarry Flag0 or 1
IMIRQ Interrupt Mask0 or 1
XMXIRQ Interrupt Mask0 or 1
This set of "commands" uses a CPU12 register name as the command name to allow changing
the register’s contents. Each register name or CCR bit name is entered on the command line
followed by a space, then followed by the new register or bit contents. After successful alteration
of a CPU register or CCR bit, the entire CPU register set is displayed.
restrictions:
None.
example:
>PC 700e
PC SP X Y D=A:B CCR=SXHI NZVC
700E 0A00 7315 7D62 47:44 1001 0000
>X 1000
PC SP X Y D=A:B CCR=SXHI NZVC
700E 0A00 1000 7D62 47:44 1001 0000
>C 1
PC SP X Y D=A:B CCR=SXHI NZVC
700E 0A00 1000 7D62 47:44 1001 0001
>Z 1
PC SP X Y D=A:B CCR=SXHI NZVC
700E 0A00 1000 7D62 47:44 1001 0101
>D adf7
PC SP X Y D=A:B CCR=SXHI NZVC
700E 0A00 1000 7D62 AD:F7 1001 0101
>
68EVB912B32UM/D3-53
OPERATION
3.7 OFF-BOARD CODE GENERATION
Code developed outside the EVB environment should be generated with an M68HC12compatible assembler or C compiler that can generate object files in S-Record format. The
recommended assembler, P&E Microcomputer Systems’ IASM12, is supplied with the EVB
package on the diskette labeled "IASM12." The IASM12 user’s manual, IASM12.DOC, is also
on the diskette.
S-Records are described in Appendix A S-Record Format.
When the S-Record file has been generated, it may be loaded from the host computer into EVB
memory in the following ways:
• into the host EVB’s byte-erasable EEPROM or RAM, using the D-Bug12 commands
BULK and LOAD when the host EVB is in EVB mode
• into the host EVB’s byte-erasable or Flash EEPROM, using the EEPROM bootloader
when the host EVB is in BOOTLOAD mode
• into a target MCU’s byte-erasable EEPROM or RAM, using the D-Bug12 commands
BULK and LOAD when the host EVB is in POD mode
• into a target MCU’s Flash EEPROM, using the D-Bug12 commands FBULK and
FLOAD when the host EVB is in POD mode
More information on the EVB operating modes, the D-Bug12 commands, and the EEPROM
bootloader can be found in section 3.1, section 3.2.2, section 3.6, and Appendix E.
3.8 MEMORY USAGE
3.8.1 Description
The EVB’s memory usage and requirements are described below and summarized in Table 3-5.
The monitor program, D-Bug12, occupies the 32 Kbyte Flash EEPROM area of the MCU’s
memory map. To use the Flash EEPROM area for custom programs, refer to Appendix EEEPROM Bootloader.
When operating in EVB mode, D-Bug12 requires 512 bytes of on-chip RAM, from $0A00 to
$0BFF, for stack and variable storage. The remaining 512 bytes of on-chip RAM, from $0800 to
$09FF, are available for variable storage and stack space by user programs.
68EVB912B32UM/D3-54
NOTE
D-Bug12 sets the default value of the user’s stack pointer to
$0A00. This is not a mistake. The M68HC12’s stack pointer
points to the last byte that was pushed onto the stack, rather than to
the next available byte on the stack, as the M68HC11 does. The
M68HC12 first decrements its stack pointer, then stores data on the
stack. The M68HC11 stores data on the stack and then decrement s
its stack pointer.
D-Bug12 code
user-accessible functions
D-Bug12 customization data
D-Bug12 startup code
interrupt vector jump table
reserved for bootloader expansion
EEPROM bootloader
reset and interrupt vectors
1K on-chip RAM
32 Kbytes on-chip Flash
EEPROM
3.9 OPERATIONAL LIMITATIONS
In EVB mode, D-Bug12 requires many of the MC68HC912B32’s resources for execution. In
this mode, the EVB cannot provide true emulation of a target system. These limitations are
described in the following sections.
If target-system emulation is required, the EVB may be reprogrammed and controlled via the
BDM interface. Operation as a target is described in 3.1.3 POD (Probe) Mode.
68EVB912B32UM/D3-55
OPERATION
3.9.1 On-Chip RAM
D-Bug12 requires 512 bytes of on-chip RAM for stack and variable storage. This usage is shown
in Table 3-5.
3.9.2 On-Chip EEPROM
D-Bug12 occupies Flash EEPROM starting at address $8000, as shown in Table 3-5. This area
is thus not available for emulation of a target application.
3.9.3 SCI Port Usage
D-Bug12 requires the MCU’s Serial Communications Interface (SCI) port for the terminal
interface. The SCI port is either connected (default) or disconnected from the RS-232C RXD
and TXD signals by means of jumpers W1 and W2.
3.9.4 Dedicated MCU Pins
As used on the EVB with D-Bug12, the following MCU lines perform specific functions. If an
application requires their use, the EVB hardware and/or operating software must be customconfigured, or special precautions must be taken in the application code t o avoid conflicts with
the D-Bug12 usage.
High baud rates occasionally result in dropped characters on the terminal display. This is not the
result of a baud rate mismatch; it is due to the host processor being too busy or too slow to
process incoming data at the selected baud rate. The D-Bug12 MD, MDW, T, and HELP
commands may be affected by this problem. Sometimes the problem can be ignored without
harm. If it requires correcting, try the following:
• Use a slower baud rate.
• Try a different communications program.
• In multitasking environments such as Windows 3.1 and the MacIntosh System 7, the
problem can occur when several applications are running at once. Try closing
unnecessary applications or exiting Windows.
• When using the MD, MDW, or T commands, try displaying fewer address locations
or tracing fewer instructions at a time.
68EVB912B32UM/D3-57
OPERATION
68EVB912B32UM/D3-58
HARDWARE REFERENCE
CHAPTER 4
HARDWARE REFERENCE
4.1 PCB DESCRIPTION
The EVB printed circuit board (PCB) is a 5.15 by 3.4 inch (13.1 by 8.64 cm) board with two
layers.
Most of the connection points on the EVB use headers spaced on 1/10-inch (2.54 mm) centers,
with the following exceptions:
• Subminiature D connector for the RS-232C interface
• External power-supply connections
4.2 CONFIGURATION HEADERS AND JUMPER SETTINGS
For maximum flexibility, the EVB uses two types of jumper headers:
Factory-installed headers are those most likely to be used for configuration without
major alteration of the EVB’s hardware operation. These headers
are populated, and the factory-installed jumpers on them are preset
for the default EVB hardware and firmware (D-Bug12)
configurations. Table 4-1 lists these headers by function and
describes their default and optional jumper settings.
Cut-trace header footprints offer EVB hardware options that are less likely to be
changed. These footprints are not populated. The default
connection between pins is a trace on the PCB. To change a cuttrace footprint, the PCB trace must be cut. To return to the original
configuration, a header and a jumper must be installed to reestablish the shunt.
NOTE
Use of the cut-trace header footprints requires a thorough
understanding of the MCU and of the EVB hardware. Refer to the
MC68HC912B32 Technical Summary and to the EVB schematic
diagram for design information.
68EVB912B32UM/D4-1
HARDWARE REFERENCE
CAUTION
When cutting a PCB trace to customize a header footprint, use a
sharp blade. Be careful to avoid personal injury and not to cut
adjacent traces.
Key to Table 4-1:Headers are depicted as viewed from either the
component side as shown in Figure 1-1 or the
solder side as shown in Figure 1-2.
2-pin header with no jumper installed or
2-pin cut-trace header with trace cut
Table 4-1. Jumper and Header Functions (continued)
DiagramPinsDescription
W3, W4 EVB Mode Selection
10
10
W3-0
W4-0
W3-1
W4-0
EVB mode execution from Flash EEPROM (D-Bug12 default)
Jump to EEPROM mode
HARDWARE REFERENCE
W3-0
W4-1
W3-1
W4-1
W5, W6 MCU Mode Selection: MODB (W5), MODA (W6)
2
1
W7 Vpp / Vdd Selection
W8 Vpp Input Header
2
1
1
3
2
1
2
W5 in
W6 in
2-3
1-2
1
2
POD mode
BOOTLOAD mode
MODB MODA
0 0Single Chip mode
NOTE: If cut, these headers must be wired to external circuitry that provides
the desired levels for MODA and MODB. Refer to Table 4-2. CPU ModeSelection.
Connects MCU’s Vpp pin to Vdd (non-programming mode)
Connects MCU’s Vpp pin to Vpp input header (programming mode)
Vpp input
Ground
remote BDM
W9 BDM IN
51
62
68EVB912B32UM/D4-3
1
2
3
4
5
6
Input to MCU BKGD
Ground
NC
RESET* input to MCU
NC
Vdd
NOTE: At reset, the BKGD input serves with MODA and MODB to determine
the CPU mode. Refer to Table 4-2. CPU Mode Selection.
HARDWARE REFERENCE
Table 4-1. Jumper and Header Functions (continued)
DiagramPinsDescription
W10 Vdd Connection to BDM OUT
1-2
1
2
W11 Reset Connection to BDM OUT
2
1
W12 BDM OUT
51
62
W13, W14 RS-232C Configuration (reserved)
W15LVI Reset Enable
cut
1-2
cut
1
2
3
4
5
6
inreserved
in
Connects Vdd to BDM OUT pin 6
BDM OUT pin 6 open
Connects MCU-generated reset (PT6) to BDM OUT pin 4
BDM OUT pin 4 open
BKGD output from MCU PT7
Ground
NC
Reset output from MCU PT6
NC
Vdd
On-board low-voltage reset enabled
cut
W16On-Board Crystal Enable
in
cut
On-board LVI reset disabled
On-board crystal connected to MCU EXTAL
On-board crystal disabled
provide external reset
use W16 to provide external clock to EXTAL
4.3 POWER INPUT CIRCUITRY
The input power connector on the EVB is a 2-pin, lever-actuated connector (P5). Decoupling
capacitors filter ripple and noise from the supply voltage.
68EVB912B32UM/D4-4
HARDWARE REFERENCE
4.4 TERMINAL INTERFACE
An RS-232C transceiver (U1A or U1B) links the MCU’s Serial Communications Interface to the
RS-232C DB-9 receptacle, P1. The communications parameters for this port are described in 2.5
Terminal Communications Setup.
4.5 MICROCONTROLLER
The MC68HC912B32 is the first of a family of next generation M68HC11 microcontrollers with
both on-chip memory and peripheral functions. The CPU12 is a high-speed, 16-bit processing
unit. The programming model and stack frame are identical to those of the standard M68HC11
CPU. The CPU12 instruction set is a proper superset of the M68HC11 instruction set. All
M68HC11 instruction mnemonics are accepted by CPU12 assemblers with no changes.
The EVB-resident MC68HC912B32 (U2) has seven modes of operation. These modes are
determined at reset by the state of three mode pins — BKGD, MODB, and MODA — as shown
in Table 4-2.
The EVB is factory-configured for MCU operation in the Normal Single Chip mode. In this
mode of operation, all port pins are available to the user. On-chip Flash EEPROM is used for
program execution, with byte-erasable EEPROM and some RAM available for user code/data.
Although other MCU modes are available, the EVB was designed for the Single Chip mode of
operation. There is no provision for external memory.
For more information on the CPU, refer to the CPU12 Reference Manual.
101Normal Expanded Narrow
110Reserved (currently defaults to
111Normal Expanded Wide
68EVB912B32UM/D4-5
peripheral mode)
HARDWARE REFERENCE
4.6 CLOCK CIRCUITRY
The EVB comes with a 16-MHz crystal, Y1, with appropriate startup capacitors. The board
should be able to accommodate most crystals and ceramic resonators.
Header W16 may be used to disconnect Y1 from the MCU’s on-chip oscillator. An external
clock may then be supplied to EXTAL through W16.
4.7 RESET
The reset circuit includes a pull-up resistor, reset switch (S1), and a low-voltage inhibit device
with a toggle voltage of 3.0 Vdc. This reset circuit drives the MCU’s RESET* pin directly.
Note that header W15 may be used to provide an alternate reset input.
4.8 LOW-VOLTAGE INHIBIT
Low voltage inhibition (LVI) uses a Motorola undervoltage sensing device (U1) to automatically
drive the MCU’s RESET* pin low when Vdd falls below U1's threshold. This prevents the
accidental corruption of EEPROM data if the power-supply voltage should drop below the
allowable level.
Depending on the date of manufacture, the sensing device installed on the EVB may have either a
2.7-volt or 4.5-volt threshold. U1 may be identified by part number:
MC34164P-3 2.7 Vdc
MC34164P-5 4.5 Vdc
If operation below U1's threshold (but no less than 2.7 Vdc) is required, one of two methods can
be used:
1. Replace U1 with a device that has the required threshold voltage.
2. Cut the trace on header W15 to disconnect U1 from the RESET* line. If this is done,
an external reset signal should be provided via W15 in case the supply voltage falls
below the acceptable level.
4.9 BACKGROUND DEBUG MODE (BDM) INTERFACE
The MCU’s serial BDM interface can be accessed through two 2x3 headers, BDM IN (W9) and
BDM OUT (W12). The pin assignments are shown in Table 4-3.
68EVB912B32UM/D4-6
The BDM interface may serve in two ways:
• as the "probe" interface through which a host EVB in POD mode controls a target
system (see section 3.1.3)
• as the user interface with the EVB. This requires a development tool such as
Motorola’s Serial Debug Interface. For more information, refer to the Motorola
Serial Debug Interface User’s Manual.
Table 4-3. BDM Connector Pin Assignments
Pin Number Description
W9 (in) W12 (out)
1 BKGD input to MCU BKGD output from MCU PT7
2 Vss Vss
3 no connection no connection
4 RESET* input to MCU Reset output from MCU PT6
HARDWARE REFERENCE
(1)
5 no connection no connection
6 Vdd Vdd
(1)
Refer to Table 4-1. Jumper and Header Functions.
(1)
4.10 PROTOTYPE AREA
The EVB’s prototype area allows construction of custom I/O circuitry that can be connected to
the MCU’s I/O lines through connectors P2, P3, P4, and P6. This area is a grid of holes
(approximately 15 by 31) on 1/10-inch (2.54 mm) centers. This spacing accommodates most
sockets, headers, and device packages.
Figure 1-1 shows the component-side view of the prototype area. Adjacent Vss (ground) and
Vdd footprints are provided for wire-wrap pins.
4.11 MCU CONNECTORS
Four 2x20 header footprints, P2, P3, P4, and P6, surround the MCU and provide access to its I/O
and bus lines. They may be populated with wire-wrap pins or strip headers for use as I/O
connectors, connection points for instrumentation probes and target hardware, and connections to
the prototype area described in section 4.10. Figure 4-1 and Figure 4-2 depict the pin
assignments for these headers.
The S-Record format for output modules was devised for the purpose of encoding programs or
data files in a printable format for transportation between computer systems. The transportation
process can thus be visually monitored and the S-Records can be more easily edited.
S-RECORD CONTENT
When viewed by the user, S-Records are essentially character stri ngs made of several fields t hat
identify the record type, record length, memory address, code/data, and checksum. Each byte of
binary data is encoded as a 2-character hexadecimal number: the first character represents the
high-order 4 bits, and the second represents the low-order 4 bits of the byte.
The 5 fields that comprise an S-Record are shown below:
TYPE RECORD LENGTH ADDRESS CODE/DATA CHECKSUM
The S-Record fields are composed as follows:
Field Printable
Characters
Type 2 S-Record type - S0, S1, etc.
Record length 2 The count of the character pairs in the record, excluding the type and
record length.
Address 4, 6, or 8 The 2-, 3-, or 4-byte address at which the data field is to be loaded into
memory.
Code/data 0-2n From 0 to n bytes of executable code, memory-loadable data, or
descriptive information. For compatibility with teletypewriters, some
programs may limit the number of bytes to as few as 28 (56 printable
characters in the S-Record).
Checksum 2 The least significant byte of the one’s complement of the sum of the
values represented by the pairs of characters making up the record
length, address, and the code/data fields.
Contents
68EVB912B32UM/D A-1
S-RECORD FORMAT
Each record may be terminated with a CR/LF/NULL. Additionally, an S-Record may have an
initial field to accommodate other data such as line numbers generated by some time-sharing
systems.
Accuracy of transmission is ensured by the record length (byte count) and checksum fields.
S-RECORD TYPES
Eight types of S-Records have been defined to accommodate the several needs of the encoding,
transportation, and decoding functions. The various Motorola upload, download, and other
record transportation control programs, as well as cross assemblers, linkers, and other filecreating or debugging programs, utilize only those S-Records that serve the purpose of the
program. For specific information on which S-Records are supported by a particular program,
the user manual for that program must be consulted.
NOTE
D-Bug12 supports only the S1 and S9 records. All data before the
first S1 record is ignored. Thereafter, all code/data records must be
of type S1 until the S9 record terminates data transfer.
An S-Record format module may contain S-Records of the following types:
S0The header record for each block of S-Records. The code/data field may contain any descriptive
information identifying the following block of S-Records. The address field is normally zeroes.
S0 records are ignored by the EVB.
S1A record containing code/data and the 2-byte address at which the code/data is to reside
S2-S8
S9The termination record for a block of S1 records. Address field may optionally contain the 2-byte
Ignored by the EVB
address of the instruction to which control is to be passed. If not specified, the first entry point
specification encountered in the object module input is used. There is no code/data field.
Only one termination record is used for each block of S-Records. Normally, only one header
record is used, although it is possible for multiple header records to occur.
68EVB912B32UM/DA-2
S-RECORD FORMAT
S-RECORD EXAMPLE
Shown below is a typical S-Record format module, as printed or displayed:
The above module consists of an S0 header record, four S1 code/data records, and an S9
termination record.
The S0 header record is comprised of the following character pairs:
S0S-Record type S0, indicating a header record.
06Hexadecimal 06 (decimal 6), indicating six character pairs (or ASCII bytes) follow.
00
00
48
44
52
1BChecksum of S0 record.
Four-character 2-byte address field, zeroes.
ASCII H, D, and R - "HDR".
The first S1 code/data record is explained as follows:
S1S-Record type S1, indicating a code/data record to be loaded/verified at a 2-byte address.
13Hexadecimal 13 (decimal 19), indicating 19 character pairs, representing 19 bytes of binary data,
follow.
00
00
Four-character 2-byte address field; hexadecimal address 0000, indicates location where the
following data is to be loaded.
68EVB912B32UM/DA-3
S-RECORD FORMAT
The next 16 character pairs are the ASCII bytes of the actual program code/data. In this
assembly language example, the hex adecimal opcodes of the program are written in sequence in
the code/data fields of the S1 records:
(Balance of this code is continued in the
code/data fields of the remaining S1
records, and stored in memory location
0010, etc.)
2AChecksum of the first S1 record.
The second and third S1 code/data records each also contain $13 (19) character pairs and are
ended with checksums 13 and 52, respectively. The fourth S1 code/data record contains 07
character pairs and has a checksum of 92.
The S9 termination record is explained as follows:
S9S-Record type S9, indicating a termination record.
03Hexadecimal 03, indicating three character pairs (3 bytes) follow.
00
00
FCChecksum of S9 record.
Four-character 2-byte address field, zeroes.
Each printable character in an S-Record is encoded in hexadecimal (ASCII in this example)
representation of the binary bits which are actually transmitted. For example, the first S1 record
above is sent as shown below.
In all of these ex amples, first follow the EVB startup procedure in section 3.2. When the startup
procedure calls for setting up the host computer’s communications program for terminal
emulation, follow the steps in the examples.
Keyboard entries are illustrated in this appendix using the following conventions:
<ENTER>Press the keyboard’s Enter, Carriage Return, or Return key.
<ALT-P>While holding down the ALTERNATE key, press the P key.
<CTL-\>While holding down the CONTROL key, press the backslash key.
<filename>Supply the appropriate file name when required.
The stepwise procedures in this appendix are as accurate as possible. However, it is not feasi ble
to document all of the communications programs that are available or to guarantee th at a newer
revision of a program behaves in exactly the same way as the version used to develop the
procedure. For this reason, the steps are as generic as possible in their descriptions. They can
thus serve as guidelines for programs not exemplified in this manual. Always consult the
documentation for the program being used.
PROCOMM FOR DOS — IBM PC
Setup
To set up Procomm using DOS on an IBM-compatible PC for use as the EVB terminal, first refer
to section 3.2 for the EVB startup procedure, which is inter-related with this example. Then
follow these steps:
1. At the DOS prompt, Invoke the Procomm program by typing:
PROCOMM<RETURN>
2. Enter the Setup menu by pressing <ALT-S>.
3. From the TERMINAL SETUP submenu, select the following:
4. From the ASCII TRANSFER SETUP submenu, select the following:
Echo locallyYES
Expand blank linesYES
Pace character0 (ASCII)
Character pacing25 (1/1000th sec)
Line pacing10 (1/10th sec)
CR translationNONE
LF translationNONE
5. Enter the Line Settings menu by pressing <ALT-P>. Select the following:
baud rate9600 (or the customized EVB setting)
data bits8
stop bits1
paritynone
COM portthe host port used as the EVB terminal interface
6. Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry.
7. Press <ENTER>. The D-Bug12 prompt should appear on the display. Continue with
the startup procedure in section 3.2.
S-Record Transfers to EVB Memory
To load an S-Record file from the host computer into EVB memory using Procomm on an IBMcompatible host computer, first verify that the host is correctly configured and operating as the
EVB terminal. Then follow these steps:
1. At the D-Bug12 prompt, enter the LOAD or VERF command with any parameters.
68EVB912B32UM/DB-2
COMMUNICATIONS PROGRAM EXAMPLES
2. Instruct Procomm to send the S-Record file by pressing the <Page Up> key. Follow
the onscreen instructions to select the S-Record fi le for transfer, using ASCII transfer
protocol.
Upon completion of the S-Record file transfer, the D-Bug12prompt is displayed.
KERMIT FOR DOS — IBM PC
Setup
To set up Kermit using DOS on an IBM-compatible PC for use as the EVB terminal, first refer to
section 3.2 for the EVB startup procedure, which is inter-related with this example. Then follow
these steps:
1. At the DOS prompt, invoke Kermit by typing:
kermit<ENTER>
2. Set the baud rate to 9600 (or the customized EVB setting) by typing:
set baud 9600<ENTER>
3. Connect to the EVB by typing:
connect<ENTER>
4. Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry.
The D-Bug12 prompt should appear on the display. Continue with the startup
procedure in section 3.2.
S-Record Transfers to EVB Memory
To load an S-Record file from the host computer into EVB memory using Kermit on an IBMcompatible host computer, first verify that the host is correctly configured and operating as the
EVB terminal. Then follow these steps:
1. At the D-Bug12 prompt, enter the LOAD or VERF command with any parameters.
2. "Escape" from the D-Bug12 prompt and start the Kermit file transfer by typing:
<CTL-]>c
push<ENTER>
type <filename> > com1<ENTER>
Upon completion of the S-Record file transfer, the D-Bug12 prompt is displayed.
68EVB912B32UM/DB-3
COMMUNICATIONS PROGRAM EXAMPLES
KERMIT — SUN WORKSTATION
Setup
To set up Kermit on the Sun Workstation for use as the EVB terminal, first refer to section 3.2
for the EVB startup procedure, which is inter-related with this example. Then follow these steps:
1. In a shell window, invoke Kermit by typing:
kermit<ENTER>
2. Set the serial port to the one in use for the EVB (ttya, ttyb, etc.) by typing:
set line /dev/ttya<ENTER>
3. Set the baud rate to 9600 (or the customized EVB setting) by typing:
set speed 9600<ENTER>
4. Connect to the EVB by typing:
connect<ENTER>
5. Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry.
The D-Bug12 prompt should appear on the display. Continue with the startup
procedure in section 3.2.
S-Record Transfers to EVB Memory
To load an S-Record file from the host computer into EVB memory using Kermit on a Sun
Workstation, first verify that the host is correctly configured and operating as the EVB terminal.
Then follow these steps:
1. In the shell window being used for the EVB terminal interface, at the D-Bug12
prompt, enter the LOAD or VERF command with any parameters.
2. Open a shell window separate from the one being used for the EVB terminal
interface. In this window, type:
cat <filename> > /dev/ttya<ENTER>
Upon completion of the S-Record file transfer, the D-Bug12 prompt is displayed in the shell
window being used for the EVB terminal interface.
68EVB912B32UM/DB-4
COMMUNICATIONS PROGRAM EXAMPLES
MACTERMINAL — APPLE MACINTOSH
Setup
To set up MacTerminal on an Apple MacIntosh computer for use as the EVB terminal, first refer
to section 3.2 for the EVB startup procedure, which is inter-related with this example. Then
follow these steps:
1. Select the following from the Terminal Settings menu:
Terminal:TTY
Cursor Shape:Underline
Line Width:80 Columns
Select:On Line
Auto Repeat
Click on:OK
2. Select the following from the Compatibility Settings menu:
Baud Rate:9600 (or the customized EVB setting)
Bits per Character:8 Bits
Parity:None
Handshake:None
Connection:Modem or Another Computer
Connection Port:Modem or Printer
Click on:OK
3. Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry.
4. Press <ENTER>. The D-Bug12 prompt should appear on the display. Continue with
the startup procedure in section 3.2.
S-Record Transfers to EVB Memory
To load an S-Record file from the host computer into EVB memory using MacTerminal, first
verify that the host is correctly configured and operating as the EVB terminal. Then follow these
steps:
1. At the D-Bug12 prompt, enter the LOAD or VERF command with any parameters.
2. From the MacIntosh File menu, select Send File - ASCII.
3. From the dialog box, select the S-Record file to be transferred.
68EVB912B32UM/DB-5
COMMUNICATIONS PROGRAM EXAMPLES
4. Click on Send.
NOTES
1. S-Records are not displayed during the file transfer.
2. Following the file transfer, MacTerminal sends a carriage return-line feed pair,
which D-Bug12 interprets as an erroneous command. To return to the
D-Bug12 prompt, reset the EVB.
RED RYDER — APPLE MACINTOSH
Setup
To set up Red Ryder on an Apple MacIntosh computer for use as the EVB terminal, first refer to
section 3.2 for the EVB startup procedure, which is inter-related with this example. Then follow
these steps:
1. Launch the Red Ryder program.
2. Set up the Red Ryder parameters as follows:
9600 baud (or the customized EVB setting)
8 data bits
1 stop bit
no parity
full duplex
3. Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry.
4. Press <ENTER>. The D-Bug12 prompt should appear on the display. Continue with
the startup procedure in section 3.2.
S-Record Transfers to EVB Memory
To load an S-Record file from the host computer into EVB memory using Red Ryder, first verify
that the host is correctly configured and operating as the EVB terminal. Then follow these steps:
1. At the D-Bug12 prompt, enter the LOAD or VERF command with any parameters.
2. From the MacIntosh File menu, select Send File - ASCII.
3. From the dialog box, select the S-Record file to be transferred.
4. Click on Send.
68EVB912B32UM/DB-6
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.