ZILOG’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE
SUPPORT DEVICES OR SYSTEMS WITHOUT THE EXPRESS PRIOR WRITTEN APPROVAL OF
THE PRESIDENT AND GENERAL COUNSEL OF ZILOG CORPORATION.
As used herein
Life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b)
support or sustain life and whose failure to perform when properly used in accordance with instructions for
use provided in the labeling can be reasonably expected to result in a significant injury to the user. A critical component is any componen t in a li fe supp ort device o r syste m whose failure to p erform ca n be re asonably expected to cause the failure of the life support device or system or to affect its safety or effectiveness.
Figure 95. The Found New Hardware Wizard Welcome Screen . . . . . . . . . . . . . . . . . 85
Figure 96. The Found New Hardware Wizard’s Browse Screen . . . . . . . . . . . . . . . . . 86
viii
UM024002-0512List of Figures
Introduction
The Z8051 On-Chip Debugger (OCD) and In-System Programmer (ISP) applications have
been developed to support Zilog’ s Z8051 8-bit MCUs. This document describes how to set
up and use the Z8051 OCD and ISP programs with your Z8051 Development Kit.
Z8051 On-Chip Debugger and In-System Programmer
User Manual
1
UM024002-0512Introduction
Z8051 On-Chip Debugger and In-System Programmer
The Z8051 On-Chip Debugger
The Z8051 On-Chip Debugger enables a development PC to communicate with your target
Z8051-based MCU. The OCD interface is used to connect the development PC and the Z8051
MCU. The OCD controls the Z8051 MCU’s internal debugging logic, including emulation, step
run, monitoring, etc., and can read or change the value of the Z8051 MCU’s internal memory
and I/O peripherals.
The Z8051 OCD supports emulation and debugging at the maximum frequency of the MCU
and can support In-System Programming (ISP), thereby eliminating the requirement for an
expensive emulator system.
The Z8051 OCD Debugger works with the Microsoft Windows XP, Vista (32/64) and
Windows 7 (32/64) operating systems.
User Manual
2
See the example On-Chip Debugger Screen shown in Figure 1.
Figure 1. On-Chip Debugger Screen
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
Features
The key features of the Z8051 On-Chip Debugger are:
•
Supports Zilog’s 8-bit Z8051 Family of MCUs
•
Loads HEX and map/symbol files
•
Allows symbolic debugging
•
Supports the internal code memory of the target MCU
•
Supports In-System Programming-only tools
•
Displays code space using a disassembler
•
Supports line assembly functions
•
Toggles Program Counter (PC) breakpoints
User Manual
3
•
Supports the display and modification of RAM, SFR, registers, etc.
•
Displays code, XDATA area using dump format
•
Device autodetect:
–Device configuration is not required
•
Operating frequency:
–Supports the maximum frequency of the target MCU
•
Operating voltage:
–Supports the entire voltage range of the target MCU
•
Clock source:
–Supports all X
•
Display emulation clock:
–Counts and displays executed machine cycles
•
Emulation and debugging:
–Supports free run, step run, autostep run, etc.
•
Save and load the development environment
, internal/external RCs, etc.
IN
Install the Z8051 OCD Software and Documentation
The Z8051 On-Chip Debugger (OCD) interface is the interface by which your PC will
communicate with the Z8051 MCU to download and execute code. In addition to the
OCD, software such as development tools and sample applications will be installed.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
Note:
Note:
Note:
User Manual
If you have already installed the Z8051 software and documentation from the CD-ROM
following the procedure on the paper insert in your kit (FL0138 or FL0139), skip this section and proceed to the Z8051 OCD Driver Installation section, below.
Observe the following procedure to install the Z8051 On-Chip Debugger software and
documentation on your computer.
1. Ensure that the OCD interface hardware is not connected to your PC.
2. Insert the Z8051 Software and Documentation CD into your comp uter’s CD-ROM
drive. The setup program launches automatically . If the setup program does not launch
automatically, open Windows Explorer, browse to your CD-ROM drive, and double-
click the file labeled
Z8051_<version_number>.exe.
4
In this filename, <version_number> refers to the version number of the OCD Software
and Documentation release. For example, this version number may be 1.0.
3. Follow the on-screen instructions to complete the OCD software installation.
Z8051 OCD Driver Installation
The driver programs for the Z8051 On-Chip Debugger are copied du ring the software and
documentation installation. In the following procedure for PCs running Windows 7 32and 64-bit operating systems, ensure that the target side of the OCD will remain unconnected while you install these drivers.
If you are running Windows Vista, see Appendix A on page 82 to install your device drivers. If you are running Windows XP, see Appendix B on page 85.
1. Connect the OCD hardware to the USB port of your PC by connecting the A (male)
end of one of the two USB A (male)-to-Mini-B cables with the host PC’s USB port.
Connect the Mini-B end to the OCD device.
2. After the PC detects the new hardware, it will display the Installing device driver soft-
ware dialog shown in Figure 2.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
Figure 2. Install Device Driver Dialog, Windows 7
IMPORTANT NOTE: If you should encounter the scenarios presented in Figures 6 or 7, right-click your
mouse on
select
ZILOG OCD I/F (highlighted in Figure 6) or Unknown device (highlighted in Figure 7) and
Update Driver Software...
5
3. Select Browse my computer for driver software (advanced) to display the dialog
shown in Figure 3, which prompts you to key in or browse for the location of the
file. Depending on the type of computer you use (32- bit or 64-bit), use the
button to navigate to one of the following paths, then click the
4. When Windows prompts you whether to install or not install, as shown in Figure 4,
Install this driver software anyway and wait until the installation is completed
click
(Windows may prompt you more than once).
7
Figure 4. Can’t Verify Publisher Dialog, Windows Vista
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
Note:
User Manual
5. When the installation is complete, the screen shown in Figure 5 will appear. Click
Close to exit the OCD driver installation.
8
Figure 5. Successfully Installed Dialog, Windows Vista
On some installations, the Found New Hardware screen shown in Figure 5 may also display the text string,
Zilog Z8051 USB OCD - No Firmware. This occurrence is normal
and can be disregarded.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
9
Figure 6. Unsuccessful Installation, Scenario 1
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
10
Figure 7. Unsuccessful Installation, Scenario 2
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
6. If Zilog Z8051 USB OCD appears in the Device Manager (as highlighted in Figure 8),
the OCD driver software has been successfully installed.
11
Figure 8. Device Manager Dialog, Windows 7
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
Note:
Understanding the OCD Menu Functions
This section describes the operation of the File, Emulation, Break/Configure, View, Window menus.
File Menu
The File menu enables you to perform basic commands in the debugger environment. Its
two commands, Load Hex and Save Hex, are described in this section.
•
The Load Hex command is used to load user code to the target MCU’s code space.
•
The Save Hex command is used to save the contents of the target MCU’s code space
to a file on your computer.
User Manual
12
The OCD’s File menu is shown in Figure 9.
Figure 9. The OCD’s File Menu
Observe the following procedure to load a user hex code file to the target MCU’s code
space.
1. Run the Z8051 OCD software. From the
Zilog Z8051 Software and Documentation <version_number>
OCD <version_number>
For a free download of the latest version of the OCD software, visit the Zilog website and
navigate via the Tools and Software menu to Software Downloads.
.
Start menu, navigate to All Programs →
→ Zilog Z8051
2. From the
appears, as shown in Figure 10.
UM024002-0512The Z8051 On-Chip Debugger
File menu of the Debugger, select Load Hex. The Object File dialog box
Z8051 On-Chip Debugger and In-System Programmer
User Manual
13
Figure 10. Object File Dialog
3. The Hex file name panel, located on the left side of the Object File dialog, displays 16
banks. If you are using the Z8051 MCU’s LINEAR ADDRESS Mode, you are not
required to select additional banks; LINEAR ADDRESS Mode uses only Bank 0.
Click the
Browse button for Bank 0 to display the Open File dialog shown in
Figure 11.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
14
Figure 11. Open File Dialog
4. In the Open File dialog, select the hex file that you wish to load into the memory space
of the target MCU, and click
OK.
5. If previous PC breakpoints exist in the debugger environment, the Break Debug dialog
box will appear, as shown in Figure 12. Click
points, or
UM024002-0512The Z8051 On-Chip Debugger
No if you prefer to retain them.
Figure 12. Break Debug Dialog
Yes if you wish to remove these break-
Z8051 On-Chip Debugger and In-System Programmer
User Manual
6. The debugger will automatically search for map and symbol files associated with the
hex file and load these files to memory.
7. After the map/symbol files are loaded into memory, the debugger resets the target
MCU and moves the MCU’s program counter to
0000h.
8. Save the current debugging environment to the hard drive of your development PC
and exit the Debugger by selecting
Exit from the File menu.
Emulation Menu
The Emulation menu, shown in Figure 13, lists the controls for starting or stopping an
emulation routine. Use the Emulation menu to control the flow of code execution for
debugging purposes.
15
Figure 13. The OCD’s Emulation Menu
The remainder of this section describes the features of the Emulation menu.
Reset & Go
This menu selection starts an emulation from the 0000h address upon a reset of the target
MCU, and functions in a manner similar to a Power-On Reset. Emulation continues until a
breakpoint occurs or the user stops the emulation process. The Reset & Go menu is disabled (greyed out) in the Emulation menu during emulation.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
Go From
The Go From menu selection starts emulation from a user-specified address, and is used to
debug each software module. The user is prompted to enter an emulation start address, as
follows:
•
Using LINEAR ADDRESS Mode, enter a 20-bit address directly.
•
Using BANKED ADDRESS Mode, enter 4 bits of bank and 16 bits of address. Each
bank size is smaller than or equal to 64 KB.
The Go From function is disabled (greyed out) in the Emulation menu during emulation.
Go
The Go function begins emulation from the current address, which can be characterized
as:
16
•
The last known (stopped) address that was held in the Program Counter from a previ-
ous emulation session
•
The point at which a break occurs, such that:
–If a break occurs before the breakpoint, the current address is the PC breakpoint
address
–If a break occurs after the breakpoint, the current address is the next execution
address of the PC breakpoint address
•
If the target MCU was reset, the reset address is 0000h.
The Go function is disabled (greyed out) in the Emulation menu during emulation.
Step
The Step function is used to debug each instruction flow and process one step at a time;
the target MCU program flow will execute only one instruction at a time, then halt.
If the MCU receives a CALL instruction, it executes a Step run into the subroutine. If
MCU is in STOP Mode, the Step run is ignored. The Step function is disabled (greyed out)
in the Emulation menu during emulation.
Step Over
The Step Over function is used to check main program flow when each subroutine had
been tested already. This function is similar to the Step function, with the exception of its
subroutine call. If the MCU receives a CALL instruction, the debugger assumes the CALL
and its subroutine to be one instruction, even if the subroutines are nested.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
If the Step Over function reaches a PC breakpoint condition, emulation is halted. This
function is disabled (greyed out) in the Emulation menu during emulation.
Step Auto
Using the Step Auto function, a step run is executed every 100 ms; execution will continue
unless the user halts it. This function is disabled (greyed out) in the Emulation menu during emulation.
Break
Using the Break function, emulation is halted immediately, even if the MCU is in STOP
Mode. This function is disabled (greyed out) in the Emulation menu during emulation.
Reset
The Reset function releases a hardware reset signal to the target MCU, which is then reinitialized. Emulation is not halted when the MCU is emulating; however, this function has
no effect when the target MCU is idle. The Reset function is enabled in the Emulation
menu whether an emulation is running or is idle.
17
Break/Configure Menu
The Break/Configure menu, shown in Figure 14, lists PC breakpoint control, device configuration and hardware test functions.
Figure 14. The OCD’s Break/Configure Menu
Clear ALL Break
The Clear ALL Break function immediately clears all PC breakpoints. This menu is disabled (greyed out) in the Break/Configure menu during emulation.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
PC
Break
PC
PC+1 PC+2 PC+3
Fetch
signal
명령
operand
명령
operan
d
Break
detect
Handl
e
User Manual
Break BEFORE (AFTER)
The Break BEFORE (AFTER) function prompts the user to select a PC breakpoint event
either before or after execution. When selecting this menu option, the Break Control dialog box appears, prompting the user to choose one of these two conditions; see Figure 15.
18
Figure 15. Break Control Dialog
Selecting
Break before execution causes a PC breakpoint when the PC reaches the PC
breakpoint address; however, a PC breakpoint position will not be executed, as illustrated
in the timing diagram shown in Figure 16.
Figure 16. Break BEFORE Timing Diagram
Selecting
break after execution causes a PC breakpoint to occur when the PC reaches the
PC breakpoint address, and a PC breakpoint position is executed, as illustrated in the tim-
UM024002-0512The Z8051 On-Chip Debugger
ing diagram shown in Figure 17.
Z8051 On-Chip Debugger and In-System Programmer
PC
Break
PC
PC+1 PC+2 PC+3
Fetch
signal
명령
opera
nd
명령
operand
Break
detect
Handl
e
User Manual
19
Figure 17. Break AFTER Timing Diagram
This Break BEFORE (AFTER) function is disabled (greyed out) in the Break/Configure
menu during emulation.
Peripheral Control
Selecting the Peripheral Control function from the Break/Configure menu prompts the
user to determine whether the target MCU’s internal peripheral functions should continue
to operate or remain idle, as shown in Figure 18. These peripherals are always running
during emulation by default.
Figure 18. Peripheral Control Dialog
The purpose of the Peripheral Control function is to tell the OCD whether the peripherals
UM024002-0512The Z8051 On-Chip Debugger
should be stopped or continuously run during Break (Debug) Mode. All peripherals,
Z8051 On-Chip Debugger and In-System Programmer
Note:
User Manual
including the PLL and ADC functions, will be stopped when selecting Stopped concur-
rently
. The Peripheral Control menu selection is disabled (greyed out) in the Break/Con-
figure menu during emulation.
The Peripheral Control function does not control each peripheral individually.
Chip Configuration
The Chip Configuration function is used to configure the target MCU’s I/O pin function,
oscillation method, code protection, etc. Each device series features different configurations. If a configuration changes, the user must turn off power to the target MCU, then
power it on again. As a result, configurations can be influenced when power rises to operational voltage.
20
The Configuration dialog box shown in Figure 19 offers an example con figu ration for the
Z51F0811 device.
Figure 19. Z51F0811 MCU Configuration Example
The Chip Configuration menu selection is disabled (greyed out) in the Break/Configure
menu during emulation.
UM024002-0512The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
Hardware Test to Repair
The Hardware Test to Repair function is used for OCD emulator testing and repairing. Its
subfunctions are not available to the user.
View Menu
The View menu, shown in Figure 20, supports the opening of child windows. The Debugger offers the following nine types of child windows:
•
MCS51 basic registers
•
Code disassembly
•
Code dump
•
XDATA dump
21
•
IRAM dump
•
SFR dump
•
Watch Global
•
Watch Local
•
Text file
UM024002-0512The Z8051 On-Chip Debugger
Loading...
+ 67 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.