Motorola M68EVB912B32 User Manual

M68EVB912B32
EVALUATION BOARD
68EVB912B32UM/D
February 1997
USER’S MANUAL
© MOTOROLA Inc., 1997; All Rights Reserved
68EVB912B32UM/Dii
CONTENTS
TABLE OF CONTENTS
CHAPTER 1 GENERAL INFORMATION
1.1 INTRODUCTION.............................................................................................................. 1-1
1.2 GENERAL DESCRIPTION AND FEATURES................................................................ 1-1
1.3 FUNCTIONAL OVERVIEW............................................................................................ 1-4
1.4 EXTERNAL EQUPMENT REQUIREMENTS................................................................ 1-7
1.5 EVB SPECIFICATIONS................................................................................................... 1-8
1.6 CUSTOMER SUPPORT.................................................................................................... 1-9
CHAPTER 2 CONFIGURATION AND SETUP
2.1 UNPACKING AND PREPARATION.............................................................................. 2-1
2.2 EVB CONFIGURATION.................................................................................................. 2-1
2.3 EVB TO POWER SUPPLY CONNECTION.................................................................... 2-3
2.4 EVB TO TERMINAL CONNECTION............................................................................. 2-3
2.5 TERMINAL COMMUNICATIONS SETUP.................................................................... 2-5
2.5.1 Communication Parameters.......................................................................................... 2-5
2.5.2 Dumb-Terminal Setup.................................................................................................. 2-5
2.5.3 Host-Computer Setup ................................................................................................... 2-5
2.5.4 Changing the Baud Rate............................................................................................... 2-6
CHAPTER 3 OPERATION
3.1 OPERATING MODES ...................................................................................................... 3-1
3.1.1 EVB Mode.................................................................................................................... 3-1
3.1.2 JUMP-EEPROM Mode................................................................................................ 3-2
3.1.3 POD (Probe) Mode....................................................................................................... 3-2
3.1.3.1 Target Types Supported......................................................................................... 3-2
3.1.3.2 Target MCU Characteristics.................................................................................. 3-3
3.1.3.3 Programming the Target’s EEPROM.................................................................... 3-3
3.1.3.4 Controlling Target Execution................................................................................ 3-3
3.1.4 BOOTLOAD Mode...................................................................................................... 3-3
3.2 STARTUP.......................................................................................................................... 3-4
68EVB912B32UM/D iii
CONTENTS
3.2.1 Startup Procedure.......................................................................................................... 3-4
3.2.2 Operating Procedures.................................................................................................... 3-5
3.2.2.1 EVB Mode............................................................................................................. 3-5
3.2.2.2 JUMP-EEPROM Mode......................................................................................... 3-5
3.2.2.3 POD Mode............................................................................................................. 3-6
3.2.2.4 BOOTLOAD Mode............................................................................................... 3-7
3.3 RESET................................................................................................................................ 3-7
3.4 ABORTING A USER PROGRAM ................................................................................... 3-8
3.5 USING D-BUG12 COMMANDS...................................................................................... 3-8
3.5.1 Command-Line Prompt................................................................................................ 3-8
3.5.2 Entering Commands ..................................................................................................... 3-8
3.5.3 Command-Set Summary............................................................................................... 3-9
3.6 D-BUG12 COMMAND SET........................................................................................... 3-12
Assembler/Disassembler...................................................................................................... 3-13
Set Baud Rate ...................................................................................................................... 3-16
Block Fill............................................................................................................................. 3-17
Breakpoint Set ..................................................................................................................... 3-18
Bulk Erase EEPROM .......................................................................................................... 3-20
Call Subroutine.................................................................................................................... 3-21
Specify Target MCU Device............................................................................................... 3-22
Specify Target EEPROM Base Address.............................................................................. 3-26
Erase Target Flash EEPROM.............................................................................................. 3-28
Program Target Flash EEPROM......................................................................................... 3-30
Go Execute a User Program................................................................................................. 3-32
Go Till.................................................................................................................................. 3-33
Onscreen Help Summary..................................................................................................... 3-34
Load S-Record File.............................................................................................................. 3-36
Memory Display.................................................................................................................. 3-37
Memory Display, Word....................................................................................................... 3-38
Memory Modify................................................................................................................... 3-39
Memory Modify, Word........................................................................................................ 3-41
Move Memory Block........................................................................................................... 3-43
Remove Breakpoints............................................................................................................ 3-44
Register Display................................................................................................................... 3-45
Specify Target EEPROM Register Address........................................................................ 3-46
Reset Target MCU............................................................................................................... 3-48
Register Modify................................................................................................................... 3-49
68EVB912B32UM/Div
CONTENTS
Stop Execution on Target MCU.......................................................................................... 3-50
Trace.................................................................................................................................... 3-51
Display Memory in S-Record Format.................................................................................. 3-53
Verify S-Record File against Memory................................................................................. 3-54
Modify Register Value......................................................................................................... 3-56
3.7 OFF-BOARD CODE GENERATION............................................................................. 3-59
3.8 MEMORY USAGE.......................................................................................................... 3-59
3.8.1 Description.................................................................................................................. 3-59
3.8.2 Memory Map.............................................................................................................. 3-60
3.9 OPERATIONAL LIMITATIONS.................................................................................... 3-60
3.9.1 On-Chip RAM............................................................................................................ 3-61
3.9.2 On-Chip EEPROM..................................................................................................... 3-61
3.9.3 SCI Port Usage............................................................................................................ 3-61
3.9.4 Dedicated MCU Pins.................................................................................................. 3-61
3.9.5 Terminal Communications ......................................................................................... 3-62
CHAPTER 4 HARDWARE REFERENCE
4.1 PCB DESCRIPTION.......................................................................................................... 4-1
4.2 CONFIGURATION HEADERS AND JUMPER SETTINGS.......................................... 4-1
4.3 POWER INPUT CIRCUITRY........................................................................................... 4-5
4.4 TERMINAL INTERFACE................................................................................................. 4-6
4.5 MICROCONTROLLER..................................................................................................... 4-6
4.6 CLOCK CIRCUITRY........................................................................................................ 4-8
4.7 RESET................................................................................................................................ 4-8
4.8 LOW-VOLTAGE INHIBIT............................................................................................... 4-8
4.9 BACKGROUND DEBUG MODE (BDM) INTERFACE................................................. 4-8
4.10 PROTOTYPE AREA..................................................................................................... 4-10
4.11 MCU CONNECTORS................................................................................................... 4-10
APPENDIX A S-RECORD FORMAT
DESCRIPTION .....................................................................................................................A-1
S-RECORD CONTENT........................................................................................................A-1
S-RECORD TYPES ..............................................................................................................A-2
S-RECORD EXAMPLE........................................................................................................A-3
68EVB912B32UM/D v
CONTENTS
APPENDIX B COMMUNICATIONS PROGRAM EXAMPLES
INTRODUCTION.................................................................................................................B-1
PROCOMM FOR DOS — IBM PC......................................................................................B-1
Setup..................................................................................................................................B-1
S-Record Transfers to EVB Memory................................................................................B-3
KERMIT FOR DOS — IBM PC...........................................................................................B-3
Setup..................................................................................................................................B-3
S-Record Transfers to EVB Memory................................................................................B-3
KERMIT — SUN WORKSTATION....................................................................................B-5
Setup..................................................................................................................................B-5
S-Record Transfers to EVB Memory................................................................................B-5
MACTERMINAL — APPLE MACINTOSH.......................................................................B-6
Setup..................................................................................................................................B-6
S-Record Transfers to EVB Memory................................................................................B-6
RED RYDER — APPLE MACINTOSH..............................................................................B-7
Setup..................................................................................................................................B-7
S-Record Transfers to EVB Memory................................................................................B-7
APPENDIX C D-BUG12 STARTUP CODE
APPENDIX D D-BUG12 CUSTOMIZATION DATA
INITIAL USER CPU REGISTER VALUES........................................................................D-3
SysClk FIELD........................................................................................................................D-3
IOBase FIELD.......................................................................................................................D-3
SCIBaudRegVal FIELD........................................................................................................D-4
EEBase AND EESize FIELDS..............................................................................................D-4
EEPROM ERASE/PROGRAM DELAY FUNCTION POINTER FIELD...........................D-5
AUXILIARY COMMAND TABLE ENTRIES....................................................................D-5
APPENDIX E EEPROM BOOTLOADER
SERIAL S-RECORD BOOTLOADER.................................................................................E-1
(E)rase................................................................................................................................E-3
(P)rogram...........................................................................................................................E-4
(L)oadEE............................................................................................................................E-4
68EVB912B32UM/Dvi
CONTENTS
VECTOR JUMP TABLE: INTERRUPT AND RESET ADDRESSES..............................E-4
RELOADING AND CUSTOMIZING D-BUG12.................................................................E-5
Obtaining D-Bug12 Upgrades...........................................................................................E-6
Reloading D-Bug12...........................................................................................................E-6
Customizing D-Bug12.......................................................................................................E-6
INDEX
LIST OF ILLUSTRATIONS
Figure 1-1. EVB Layout and Component Placement.................................................................1-3
Figure 1-2. EVB Solder Side View............................................................................................1-4
Figure 4-1. MCU I/O Headers P2, P3.......................................................................................4-11
Figure 4-2. MCU I/O Headers P4, P6.......................................................................................4-12
LIST OF TABLES
Table 1-1. EVB Specifications...................................................................................................1-8
Table 2-1. EVB Startup Mode Jumpers......................................................................................2-3
Table 2-2. RS-232C Interface Cabling.......................................................................................2-4
Table 2-3. Communication Parameters......................................................................................2-5
Table 3-1. D-Bug12 Command-Set Summary............................................................................3-9
Table 3-2. M68HC11 to CPU12 Instruction Translation.........................................................3-14
Table 3-3. CPU12 Registers.....................................................................................................3-56
Table 3-4. Condition Code Register Bits..................................................................................3-56
Table 3-5. Factory-Configuration Memory Map......................................................................3-60
Table 4-1. Jumper and Header Functions...................................................................................4-3
Table 4-2. CPU Mode Selection.................................................................................................4-6
Table 4-3. BDM Connector Pin Assignments..........................................................................4-10
68EVB912B32UM/D vii
CONTENTS
68EVB912B32UM/Dviii
GENERAL INFORMATION
CHAPTER 1
GENERAL INFORMATION
1.1 INTRODUCTION
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/D 1-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/D 1-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/D 1-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-Bug12 Command 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.
User terminal — options:
RS-232C dumb terminal — allows single-line on-board code assembly and
disassembly.
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.
1.5 EVB SPECIFICATIONS
Table 1-1 lists the EVB specifications.
Table 1-1. EVB Specifications
Characteristic Specifications
MCU MC68HC912B32 MCU I/O ports HCMOS compatible Background Debug Mode
interface (IN and OUT) Communications port RS-232C DCE port Power requirements,
16 MHz clock source Prototype area:
Area Holes
Board dimensions 5.15 x 3.4 in. (13.1 x 8.64 cm)
two 2x3 headers
+2.7 Vdc to +5.0 Vdc @ 100 mA (max.) For low-voltage operation, refer to section 4.8.
approx. 1.5 x 3 in. (3.8 x 7.6 cm) approx. 15 wide x 31 high, on 0.1 in. (2.54 mm) centers
68EVB912B32UM/D 1-7
GENERAL INFORMATION
1.6 CUSTOMER SUPPORT
AUSTRALIA, JAPAN
Melbourne – (61-3)887-0711 Fukuoka – 81-92-725-7583 Sydney – (61-2)906-3855 Gotanda – 81-3-5487-8311
BRAZIL Nagoya – 81-52-232-3500
Sao Paulo – 55(11)815-4200 Osaka – 81-6-305-1802
CANADA Sendai – 81-22-268-4333
B.C., Vancouver – (604)606-8502 Takamatsu – 81-878-37-9972 ONTARIO, Toronto – (416)497-8181 Tokyo – 81-3-3440-3311 ONTARIO, Ottawa – (613)226-3491 KOREA QUEBEC, Montreal – (514)333-3300 Pusan – 82(51)4635-035
CHINA Seoul – 82(2)554-5118
Beijing – 86-10-6843722 MALAYSIA
FINLAND Penang – 60(4)374514
Helsinki – 358-9-6824-400 MEXICO
FRANCE Mexico City – 52(5)282-0230
Paris – 33134 635900 Guadalajara – 52(36)21-8977
GERMANY PUERTO RICO
Langenhagen/Hannover – 49(511)786880 San Juan – (809)282-2300 Munich – 49 89 92103-0 SINGAPORE – (65)4818188 Nuremberg – 49 911 96-3190 SPAIN Sindelfingen – 49 7031 79 710 Madrid – 34(1)457-8204 Wiesbaden – 49 611 973050 SWEDEN
HONG KONG Solna – 46(8)734-8800
Kwai Fong – 852-6106888 SWITZERLAND Tai Po – 852-6668333 Geneva – 41(22)799 11 11
INDIA Zurich – 41(1)730-4074
Bangalore – (91-80)5598615 TAIWAN
ISRAEL Taipei – 886(2)717-7089
Herzlia – 972-9-590222 THAILAND
ITALY Bangkok – 66(2)254-4910
Milan – 39(2)82201 UNITED KINGDOM
Aylesbury – 44 1 (296)395252
UNITED STATES
Phoenix, AZ – 1-800-441-2447
For a list of the Motorola sales offices and distributors: http://www.mcu.mot.sps.com
68EVB912B32UM/D1-8
CHAPTER 2
CONFIGURATION AND SETUP
2.1 UNPACKING AND PREPARATION
Verify that the following items are present in the EVB package:
The M68EVB912B32 board assembly
Background Debug Mode(BDM) interface cable, 6-pin to 6-pin
Warranty and registration cards
EVB schematic diagram and parts list
M68EVB912B32 User’s Manual
CONFIGURATION AND SETUP
MC68HC912B32 Technical Summary
MC68HC912B32 Electrical Specifications Supplement
CPU12 Reference Manual
MC68HC12 Family Brochure
Assembly Language Development Toolset
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/D 2-1
CONFIGURATION AND SETUP
Table 2-1. EVB Startup Mode Jumpers
Jumper
Positions
W3 W4
0 0 EVB execution mode (default). D-Bug12 is executed from Flash EEPROM upon reset.
The D-Bug12 prompt appears immediately on the terminal display.
1 0 JUMP-EEPROM mode. User code is executed from byte-erasable EEPROM upon reset.
For more information, refer to 3.1 Operating Modes. 0 1 Remote Debugging through BDM OUT header (W12) 1 1 BOOTLOAD 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 P1 DTE Signal Terminal
DCE
Receptacle
DB-9 DB-25 DB-9 DB-25
2 Receive Data (RXD) 2 2 3 3 3 Transmit Data (TXD) 3 3 2 2 5 Ground (GND) 5 7 5 7
(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/D 2-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 off­board, 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-Bug12 Customization Data and Appendix E EEPROM Bootloader.
68EVB912B32UM/D 2-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.9 Operational 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.5 Using 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/D 3-1
OPERATION
This mode is effected using the MCU’s PAD0 line. User code may be programmed into byte­erasable 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 user­assembled 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), JUMP­EEPROM 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/D 3-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 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 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 carriage­return (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/D 3-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
Command Description
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 BULK Bulk erase byte-erasable EEPROM
68EVB912B32UM/D3-8
OPERATION
Table 3-1. D-Bug12 Command-Set Summary (continued)
Command Description
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
FBULK Erase 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
HELP Display 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 RD Register Display — display the CPU register contents REGBASE Inform D-Bug12 of the target I/O register’s base address RESET Reset the target CPU RM Register Modify — interactively examine/change CPU
STOP Stop execution of user code on the target processor and
68EVB912B32UM/D 3-9
Move a block of memory
register contents
place it in background mode
OPERATION
Table 3-1. D-Bug12 Command-Set Summary (continued)
Command Description
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 Return D-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.
There are a number of M68HC11 instruction mnemonics that appear in the CPU12 Reference Manual 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/D 3-11
OPERATION
The assembly/disassembly process may be terminated by entering a period (.) as the first non­space character following the assembler prompt.
restrictions:
None.
Table 3-2. M68HC11 to CPU12 Instruction Translation
M68HC11 Mnemonic CPU12 Instruction M68HC11 Mnemonic CPU12 Instruction
CLC ANCC # $FE INS LEAS 1, S
CLI ANCC # $EF TAP TFR A, CC CLV ANCC # $FD TPA TFR CC, A SEC ORCC # $01 TSX TFR S, X
SEI ORCC # $10 TSY TFR S, Y SEV ORCC # $02 XGDX EXG D, X ABX LEAX B, X XGDY EXG D, Y ABY LEAY B, Y SEX R8, R DES LEAS -1, S
16
TFR R8, R
16
example:
>ASM 800
0800 CC1000 LDD #$1000 0803 1803123401FE MOVW #$1234,$01FE 0809 0EF9800001F1 BRSET -32768,PC,$01,$0700 080F 18FF TRAP $FF 0811 183FE3 ETBL <Illegal Addr Mode> >. >
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 CPU12 Reference 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/D 3-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.
example:
>BAUD 50
Invalid BAUD Rate >BAUD 38400 Change Terminal BR, Press Return >
68EVB912B32UM/D3-14
OPERATION
BF
syntax:
BF <StartAddress> <EndAddress> [<Data>]
where:
<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/D 3-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/D 3-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 >
68EVB912B32UM/D 3-19
OPERATION
DEVICE
syntax:
DEVICE DEVICE <DeviceName> [<EEStart> <EEEnd> <FStart>
where:
<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.
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 Name Target MCU
912B32 MC68HC912B32 812A4 MC68HC812A4
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 on­chip 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.
68EVB912B32UM/D 3-21
OPERATION
example:
>DEVICE
Device: 912B32 EEPROM: $0D00 - $0FFF Flash: $8000 - $FFFF RAM: $0800 - $0BFF I/O Regs: $0000
S>DEVICE 912b32 1d00 1fff 8000 ffff 800 bff 0
Device: 912B32 EEPROM: $1D00 - $1FFF Flash: $8000 - $FFFF RAM: $0800 - $0BFF I/O Regs: $0000
S>DEVICE 812a4
Device: 812A4 EEPROM: $1000 - $1FFF RAM: $0800 - $0BFF I/O Regs: $0000
S>
68EVB912B32UM/D3-22
OPERATION
EEBASE
syntax:
EEBASE <Address>
where:
<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.
68EVB912B32UM/D 3-23
OPERATION
example:
S>DEVICE
Device: 912B32 EEPROM: $0D00 - $0FFF Flash: $8000 - $FFFF RAM: $0800 - $0BFF I/O Regs: $0000
S>EEBASE 1d00
Device: 912B32 EEPROM: $1D00 - $1FFF Flash: $8000 - $FFFF RAM: $0800 - $0BFF I/O Regs: $0000
S>MM 12 0012 01 11 0013 0F . S>MD 1d00
1D00 FF FF FF FF - FF FF FF FF - FF FF FF FF - FF FF FF FF ................
S>
68EVB912B32UM/D3-24
OPERATION
FBULK
syntax:
FBULK
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 on­chip 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/D 3-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/D 3-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 on­chip 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
********************************************************************** ********************************************************************** ***********************
S>
68EVB912B32UM/D3-28
OPERATION
G
Go Execute a User Program
G
syntax:
G [<Address>]
where:
<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.
example:
S>G 800 R>MD 1000
1000 FF FF FF FF - FF FF FF FF - FF FF FF FF - FF FF FF FF ................
R> User 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/D 3-29
OPERATION
GT
Go Till
GT
syntax:
GT <Address>
where:
<Address> is a 16-bit hexadecimal number.
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/D 3-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/D 3-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.
restrictions:
None.
example:
>MD 800 0800 AA 04 37 6A - 00 06 27 F9 - 35 AE 78 0D - B7 56 78 20 ..7j..’.5.x..Vx
>MD 800 87f
0800 AA 04 37 6A - 00 06 27 F9 - 35 AE 78 0D - B7 56 78 20 ..7j..’.5.x..Vx 0810 B6 36 27 F9 - 35 AE 27 F9 - 35 9E 27 F9 - 35 BE B5 28 .6’.5.’.5.’.5..( 0820 27 F9 35 D6 - 37 B8 00 0F - 37 82 01 0A - 37 36 FF F0 ’.5.7...7...76..
0830 7C 10 37 B3 - 00 00 37 B6 - 00 0F AA 04 - A5 02 37 B6 |.7...7.......7.
0840 00 0F 27 78 - 37 6A 00 06 - 27 F9 35 78 - 27 F9 35 56 ..’x7j..’.5x’.5V 0850 78 0D B7 10 - 78 3B 37 86 - 00 DC 27 F9 - 35 48 78 57 x...x;7...’.5HxW
0860 37 86 00 DE - F5 01 EA 09 - 37 B5 0D 0A - 27 F9 36 2A 7.......7...’.6*
0870 A5 00 37 65 - 00 02 27 F9 - 35 E8 37 9C - 37 4C F5 02 ..7e..’.5.7.7L..
>
68EVB912B32UM/D3-34
OPERATION
MDW
Memory Display, Word
MDW
syntax:
MDW <StartAddress> [<EndAddress>]
where:
<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.
restrictions:
None.
example:
>MDW 800 0800 AA04 376A - 0006 27F9 - 35AE 780D - B756 7820 ..7j..’.5.x..Vx
>MDW 800 87f
0800 AA04 376A - 0006 27F9 - 35AE 780D - B756 7820 ..7j..’.5.x..Vx 0810 B636 27F9 - 35AE 27F9 - 359E 27F9 - 35BE B528 .6’.5.’.5.’.5..( 0820 27F9 35D6 - 37B8 000F - 3782 010A - 3736 FFF0 ’.5.7...7...76..
0830 7C10 37B3 - 0000 37B6 - 000F AA04 - A502 37B6 |.7...7.......7.
0840 000F 2778 - 376A 0006 - 27F9 3578 - 27F9 3556 ..’x7j..’.5x’.5V 0850 780D B710 - 783B 3786 - 00DC 27F9 - 3548 7857 x...x;7...’.5HxW
0860 3786 00DE - F501 EA09 - 37B5 0D0A - 27F9 362A 7.......7...’.6*
0870 A500 3765 - 0002 27F9 - 35E8 379C - 374C F502 ..7e..’.5.7.7L..
>
68EVB912B32UM/D 3-35
OPERATION
MM
syntax:
MM <Address> [<Data>]
where:
<Address> is a16-bit hexadecimal number. <Data> is an optional 8-bit hexadecimal number.
[<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.
68EVB912B32UM/D3-36
example:
>MM 800 0800 00 <CR> 0801 F0 FF 0802 00 ^ 0801 FF <CR> 0802 00 <CR> 0803 08 55 / 0803 55 . >
OPERATION
68EVB912B32UM/D 3-37
OPERATION
MMW
syntax:
MMW <Address> [<Data>]
where:
<Address> is a 16-bit hexadecimal number. <Data> is an optional 16-bit hexadecimal number.
[<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.
68EVB912B32UM/D3-38
example:
>MMW 800 0800 00F0 <CR> 0802 0008 AA55 / 0804 843F ^ 0802 AA55 <CR> 0804 843F <CR> 0806 C000 . >
OPERATION
68EVB912B32UM/D 3-39
OPERATION
MOVE
syntax:
MOVE <StartAddress> <EndAddress> <DestAddress>
where:
<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.
example:
>BR 800 810 820 830 Breakpoints: 0800 0810 0820 0830
>NOBR 810 820 Breakpoints: 0800 0830
>NOBR All Breakpoints Removed
>
68EVB912B32UM/D 3-41
OPERATION
RD
Register Display
RD
syntax:
RD
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.
68EVB912B32UM/D 3-43
OPERATION
example:
S>DEVICE
Device: 912B32 EEPROM: $0D00 - $0FFF Flash: $8000 - $FFFF RAM: $0800 - $0BFF I/O Regs: $0000
S>REGBASE 2000
Device: 912B32 EEPROM: $0D00 - $0FFF Flash: $8000 - $FFFF RAM: $0800 - $0BFF I/O Regs: $2000
S>
68EVB912B32UM/D3-44
OPERATION
RESET
Reset Target MCU
RESET
syntax:
RESET
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/D 3-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.
example:
>RM PC=0206 200 SP=03FF <CR> X=1000 1004 Y=3700 <CR> A=27 <CR> B=FF <CR> CCR=D0 D1 PC=0200 . >
68EVB912B32UM/D3-46
OPERATION
STOP
Stop Execution on Target
STOP
MCU
syntax:
STOP
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/D 3-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/D 3-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.
restrictions:
None.
example:
>UPLOAD 400 5ff S123040000F0000843FC0000F50F379F37BF43FCF50F27FA757F177AFA047504177AFA21C5 S123042037B500FF37FAFB0437B5400037FAFB061735FB0037B500C137FAFA003715379C01 S1230440F50F379D37BC012C37BD400085009A003C023D02377C0140B6EE7A0F400037B583 S1230460000337FAFA4C37FAFA5037FAFA5437B5502037FAFA4E37B5302037FAFA5237B58A S1230480682037FAFA5637BD014037BC000095008A003C023D02377D0172B6EE37BD017259 S12304A037BC020095008A003C023D02377D018EB6EE27F937B0F50F379C37BC00CE27F901 S12304C000FC27F9104C27F90E68378000BE0A0D442D42756731362056312E3033202D20E3 S12304E04465627567204D6F6E69746F7220466F7220546865204D363848433136204661ED S12305006D696C790A0D2843292031393932204D6F746F726F6C612053656D69636F6E64BD S12305207563746F7220496E632E000037B5FF0237FAFA4837B578B037FAFA4A7A0F005E52 S12305400000000000000000020002040208020C021000000000000000000000000002144F S12305600000000000000000000000000000000002187A0F3BAC7A0F3BBC7A0F11E87A0F62 S12305803C727A0F3C847A0F3C967A0F3CA8F50F379C379D379E27FAF50F379F37BF43FCE8 S12305A07501177A4054173540523604361C27F90088B0D637BC01BC360227F70A0D3E00A9 S12305C04500B70427F936BC3C01B0F027F7277537BC400017BC405027F936CC780DB60477 S12305E027F936A0274A27F77803B6FEB03A7808B6162776B7DE3730000127F93686752002 S9030000FC >
68EVB912B32UM/D3-50
OPERATION
VERF
Verify S-Record File against Memory
VERF
syntax:
VERF [<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 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/D 3-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 Name Description Legal Range
PC Program Counter $0 to $FFFF SP Stack Pointer $0 to $FFFF X X-Index Register $0 to $FFFF Y Y-Index Register $0 to $FFFF A A Accumulator $0 to $FF B B Accumulator $0 to $FF D D Accumulator (A:B) $0 to $FFFF CCR Condition 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 Name Description Legal Values
S STOP Enable 0 or 1 H Half Carry 0 or 1 N Negative Flag 0 or 1 Z Zero Flag 0 or 1
68EVB912B32UM/D3-52
OPERATION
Table 3-4. Condition Code Register Bits (continued)
CCR Bit Name Description Legal Values
V Two’s Complement Overflow Flag 0 or 1 C Carry Flag 0 or 1 IM IRQ Interrupt Mask 0 or 1 XM XIRQ Interrupt Mask 0 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/D 3-53
OPERATION
3.7 OFF-BOARD CODE GENERATION
Code developed outside the EVB environment should be generated with an M68HC12­compatible 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 E EEPROM 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.
3.8.2 Memory Map
Table 3-5. Factory-Configuration Memory Map
Address Range Usage Description
$0000 - $01FF CPU registers on-chip registers
OPERATION
$0800 - $09FF
$0A00 - $0BFF
$0D00 - $0FFF user code/data 768 bytes on-chip EEPROM
$8000 - $F67F $F680 - $F6BF $F6C0 - $F6FF
$F700 - $F77F $F780 - $F7FF $F800 - $FBFF
$FC00 - $FFBF $FFC0 - $FFFF
user code/data reserved for D-Bug12
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/D 3-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 custom­configured, or special precautions must be taken in the application code t o avoid conflicts with the D-Bug12 usage.
PAD0 — EVB mode select pin (W3) PAD1 — EVB mode select pin (W4) PE5/MODA, and PE6/MODB — Sets MCU chip mode, normally single chip.
68EVB912B32UM/D3-56
OPERATION
3.9.5 Terminal Communications
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/D 3-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 cut­trace footprint, the PCB trace must be cut. To return to the original configuration, a header and a jumper must be installed to re­establish 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/D 4-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
2-pin header with jumper installed
2-pin cut-trace header with default trace intact
3-pin header with no jumper installed
3-pin header with jumper installed on left 2 pins
1-2 bold pin numbers indicate factory-default settings
1-2, cut italics indicate alternate settings
Table 4-1. Jumper and Header Functions
Diagram Pins Description
W1 RS-232C TXD Connection to SCI PS1
1 2
W2 RS-232C RXD Connection to SCI PS0
1-2
cut
TXD enabled
TXD disconnected from SCI port
1 2
1-2
cut
RXD enabled
RXD disconnected from SCI port
68EVB912B32UM/D4-2
Table 4-1. Jumper and Header Functions (continued)
Diagram Pins Description
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 0 Single 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 Mode Selection.
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/D 4-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)
Diagram Pins Description
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)
W15 LVI Reset Enable
cut
1-2
cut
1 2 3 4 5 6
in reserved
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
W16 On-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.
Table 4-2. CPU Mode Selection
BKGD
Through BDM IN
0 0 0 Special Single Chip 0 0 1 Special Expanded Narrow 0 1 0 Special Peripheral 0 1 1 Special Expanded Wide
1 0 0 Normal Single Chip
MODB
Header W5
MODA
Header W6
Mode Description
1 0 1 Normal Expanded Narrow 1 1 0 Reserved (currently defaults to
1 1 1 Normal Expanded Wide
68EVB912B32UM/D 4-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.
68EVB912B32UM/D 4-7
HARDWARE REFERENCE
PA2 1 PA4 3 PA6 5 VDD47 7 VRH 9 PAD0 11 PAD2 13 PAD4 15 PAD6 17 VDDAD 19
PS0 1 PS2 3 PS4 5 PS6 7 VFP 9 PDLC5 11 PDLC3 13 PDLC1 15 VSSX77 17 PP7 19
ll ll ll ll ll ll ll ll ll ll
P2
ll ll ll ll ll ll ll ll ll ll
2 PA3 4 PA5 6 PA7 8 VSS48 10 VRL 12 PAD1 14 PAD3 16 PAD5 18 PAD7 20 VSSAD
2 PS1 4 PS3 6 PS5 8 PS7 10 PDLC6 12 PDLC4 14 PDLC2 16 PDLC0 18 VDDX78 20 PP6
P3
Figure 4-1. MCU I/O Headers P2, P3
68EVB912B32UM/D4-8
HARDWARE REFERENCE
PB3 1 PB5 3 PB7 5 PE6/MODB 7 PE4 9 VDDX31 11 EXTAL 13 PE3 15 PE1 17 PA0 19
PP5 1 PP3 3 PP1 5 PT0 7 PT2 9 VSS11 11 PT4 13 PT6 15 BKGD 17 PB1 19
ll ll ll ll ll ll ll ll ll ll
P4
ll ll ll ll ll ll ll ll ll ll
2PB4 4PB6 6PE7 8 PE5/MODA 10 VSSX30 12 RESET* 14 XTAL 16 PE2 18 PE0 20 PA1
2 PP4 4 PP2 6 PP0 8PT1 10 VDD10 12 PT3 14 PT5 16 PT7 18 PB0 20 PB2
P6
Figure 4-2. MCU I/O Headers P4, P6
68EVB912B32UM/D 4-9
HARDWARE REFERENCE
68EVB912B32UM/D4-10
S-RECORD FORMAT
APPENDIX A
S-RECORD FORMAT
DESCRIPTION
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 file­creating 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:
S0 The 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.
S1 A record containing code/data and the 2-byte address at which the code/data is to reside S2-S8 S9 The 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:
S00600004844521B S1130000285F245F2212226A000424290008237C2A S11300100002000800082629001853812341001813 S113002041E900084E42234300182342000824A952 S107003000144ED492 S9030000FC
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:
S0 S-Record type S0, indicating a header record. 06 Hexadecimal 06 (decimal 6), indicating six character pairs (or ASCII bytes) follow. 00
00 48
44 52
1B Checksum 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:
S1 S-Record type S1, indicating a code/data record to be loaded/verified at a 2-byte address. 13 Hexadecimal 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/D A-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:
Opcode Instruction
28 5F BHCC $0161 24 5F BCC $0163 22 12 BHI $0118 22 6A BHI $0172 00 04 24 BRSET 0,$04,$012F 29 00 BHCS $010D 08 23 7C BRSET 4,$23,$018C
. . .
(Balance of this code is continued in the code/data fields of the remaining S1 records, and stored in memory location 0010, etc.)
2A Checksum 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:
S9 S-Record type S9, indicating a termination record. 03 Hexadecimal 03, indicating three character pairs (3 bytes) follow. 00
00 FC Checksum 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.
TYPE
S1130000 285F•2A
533131 3 3030303032383546••3241
0101 0011 0011 0001 0011 0001
LENGTH ADDRESS CODE/DATA CHECKSUM
3
0011 0011 0011 0000 0011 0000 0011 0000 0011 0000 0011 0010 0011 1000 0011 0101 0100 0110 ••• 0011 0010 0100 0001
68EVB912B32UM/DA-4
COMMUNICATIONS PROGRAM EXAMPLES
APPENDIX B
COMMUNICATIONS PROGRAM EXAMPLES
INTRODUCTION
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:
Terminal emulation WYSE 100 Duplex FULL
68EVB912B32UM/D B-1
COMMUNICATIONS PROGRAM EXAMPLES
Flow control NONE CR translation (in) CR CR translation (out) CR BS translation DEST BS key definition BS Line wrap OFF Scroll ON Break Length (ms) 350 Enquiry (CTRL-E) OFF
4. From the ASCII TRANSFER SETUP submenu, select the following:
Echo locally YES Expand blank lines YES Pace character 0 (ASCII) Character pacing 25 (1/1000th sec) Line pacing 10 (1/10th sec) CR translation NONE LF translation NONE
5. Enter the Line Settings menu by pressing <ALT-P>. Select the following:
baud rate 9600 (or the customized EVB setting) data bits 8 stop bits 1 parity none COM port the 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 IBM­compatible 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 IBM­compatible 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/D B-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/D B-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...