Zilog Z51F0811 User Manual

Z8051™ Family of 8-Bit Microcontrollers
Z8051 On-Chip Debugger and In-System Programmer
User Manual
UM024002-0512
Copyright ©2012 Zilog®, Inc. All rights reserved.
www.zilog.com
Z8051 On-Chip Debugger and In-System Programmer
Warning:
User Manual
DO NOT USE THIS PRODUCT IN LIFE SUPPORT SYSTEMS.
LIFE SUPPORT POLICY
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 criti­cal 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 ason­ably expected to cause the failure of the life support device or system or to affect its safety or effectiveness.
ii
Document Disclaimer
©2012 Zilog, Inc. All rights reserved. Information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. ZILOG, INC. DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY OF THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOC UMENT. ZILOG ALSO DOES NOT ASSUME LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT RELATED IN ANY MANNER TO USE OF INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED HEREIN OR OTHERWISE. The information contained within this document has been verified according to the general principles of electrical and mechanical engineering.
Z8051 is a trademark or registered trademark of Zilog, Inc. All other product or service names are the property of their respective owners.
UM024002-0512

Revision History

Each instance in the Revision History table below reflects a change to this document from its previous version.
Z8051 On-Chip Debugger and In-System Programmer
User Manual
iii
Date
May 2012
Mar 2012
Revision Level Description
02 Updated for improved usability. All
01 Original issue. All
Page No
UM024002-0512 Revision History

Table of Contents

Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .vi
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
The Z8051 On-Chip Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Install the Z8051 OCD Software and Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Z8051 OCD Driver Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Understanding the OCD Menu Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Emulation Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Break/Configure Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Z8051 On-Chip Debugger and In-System Programmer
User Manual
iv
Child Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Z8051 Basic Registers Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Code Disassemble Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Code Dump Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
XDATA Dump Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
IRAM Dump Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
SFR Dump Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Watch Global Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Watch Local Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Text File Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
The Z8051 OCD In-System Programmer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Connect the Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Apply Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Understanding the OCD ISP Menu Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
HexData Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Program Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
UM024002-0512 Table of Contents
Z8051 On-Chip Debugger and In-System Programmer
User Manual
Child Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Code Dump Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
XData Dump Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Appendix A. OCD Driver Installation on Windows Vista Systems . . . . . . . . . . . . . . . . 82
Appendix B. OCD Driver Installation on Windows XP Systems . . . . . . . . . . . . . . . . . . 85
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
v
UM024002-0512 Table of Contents

List of Figures

Figure 1. On-Chip Debugger Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Figure 2. Install Device Driver Dialog, Windows 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 3. Browse For Driver Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 4. Can’t Verify Publisher Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . 7
Figure 5. Successfully Installed Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 6. Unsuccessful Installation, Scenario 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 7. Unsuccessful Installation, Scenario 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 8. Device Manager Dialog, Windows 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 9. The OCD’s File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 10. Object File Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 11. Open File Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 12. Break Debug Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 13. The OCD’s Emulation Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 14. The OCD’s Break/Configure Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 15. Break Control Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 16. Break BEFORE Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 17. Break AFTER Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 18. Peripheral Control Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 19. Z51F0811 MCU Configuration Example . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 20. The OCD’s View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 21. The Basic Registers Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 22. Code Disassembler Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 23. Code Dump Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 24. XDATA Dump Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 25. IRAM Dump Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 26. SFR Dump Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 27. Global Variables Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 28. Local Function Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 29. A Sample Text File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 30. The OCD’s Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 31. Cascaded Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 32. Tiled Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 33. Using the Basic Registers Function, #1 of 6 . . . . . . . . . . . . . . . . . . . . . . . . 34
Z8051 On-Chip Debugger and In-System Programmer
User Manual
vi
UM024002-0512 List of Figures
Z8051 On-Chip Debugger and In-System Programmer
User Manual
Figure 34. Using the Basic Registers Function, #2 of 6 . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 35. Using the Basic Registers Function, #3 of 6 . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 36. Using the Basic Registers Function, #4 of 6 . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 37. Using the Basic Registers Function, #5 of 6 . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 38. Using the Basic Registers Function, #6 of 6 . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 39. Using the Code Disassembler Function, #1 of 3 . . . . . . . . . . . . . . . . . . . . . 38
Figure 40. Using the Code Disassembler Function, #2 of 3 . . . . . . . . . . . . . . . . . . . . . 38
Figure 41. Using the Code Assembler Function, #3 of 3 . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 42. Using the PC Break Toggle Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 43. Using the Code Dump Function, #1 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 44. Using the Code Dump Function, #2 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 45. The Code Dump Function’s Goto/Input Dialog . . . . . . . . . . . . . . . . . . . . . 43
Figure 46. The Code Dump Function’s Pattern Load Dialog . . . . . . . . . . . . . . . . . . . . 43
Figure 47. The Code Dump Function’s Pattern Save Dialog . . . . . . . . . . . . . . . . . . . . 44
Figure 48. The Code Dump Function’s Pattern Fill Dialog . . . . . . . . . . . . . . . . . . . . . 44
Figure 49. Using the XDATA Dump Function, #1 of 2 . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 50. Using the XDATA Dump Function, #2 of 2 . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 51. The XDATA Dump Function’s Goto/Input Dialog . . . . . . . . . . . . . . . . . . . 46
Figure 52. The XDATA Dump Function’s Pattern Load Dialog . . . . . . . . . . . . . . . . . 47
Figure 53. The XDATA Dump Function’s Pattern Save Dialog . . . . . . . . . . . . . . . . . 47
Figure 54. The XDATA Dump Function’s Pattern Fill Dialog . . . . . . . . . . . . . . . . . . 48
Figure 55. Using the IRAM Dump Function, #1 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Figure 56. Using the IRAM Dump Function, #2 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Figure 57. Using the SFR Dump Function, #1 of 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Figure 58. Using the SFR Dump Function, #2 of 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Figure 59. Using the SFRDump Function, #3 of 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Figure 60. The Watch Global Function’s Global Variables Dialog . . . . . . . . . . . . . . . 53
Figure 61. Adding A Global Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Figure 62. Editing A Global Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Figure 63. The Watch Local Function Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 64. Editing A Local Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 65. Example Watch Local Function, #1 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Figure 66. Example Watch Local Function, #2 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Figure 67. Using the Text File Function, #1 of 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Figure 68. Using the Text File Function, #2 of 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Figure 69. Using the Text File Function, #3 of 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
vii
UM024002-0512 List of Figures
Z8051 On-Chip Debugger and In-System Programmer
User Manual
Figure 70. Text File Child Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Figure 71. Code Disassembler Child Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Figure 72. Using the Text File Function, #4 of 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Figure 73. Using the Text File Function, #5 of 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Figure 74. Example On-Chip Debugger ISP Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Figure 75. OCD Hardware ISP Pin Assignment (Bottom View) . . . . . . . . . . . . . . . . . 65
Figure 76. The OCD ISP’s File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Figure 77. Device Select Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Figure 78. Fill Buffer Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Figure 79. File Open Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Figure 80. OCD ISP Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Figure 81. Select Device To Read Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Figure 82. Most Recently Used Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Figure 83. The OCD ISP’s Program Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Figure 84. Configuration Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Figure 85. The OCD ISP’s Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Figure 86. Open CODE Dump Child Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Figure 87. Open XData Dump Child Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Figure 88. Cascading Child Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Figure 89. Tiled Child Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Figure 90. CODE Dump Child Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Figure 91. XData Dump Child Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Figure 92. Found New Hardware Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . 82
Figure 93. Install Device Driver Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . . 83
Figure 94. Couldn’t Find Driver Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . . 84
Figure 95. The Found New Hardware Wizard Welcome Screen . . . . . . . . . . . . . . . . . 85
Figure 96. The Found New Hardware Wizard’s Browse Screen . . . . . . . . . . . . . . . . . 86
viii
UM024002-0512 List 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-0512 Introduction
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-0512 The 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-0512 The 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 sec­tion 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 32­and 64-bit operating systems, ensure that the target side of the OCD will remain uncon­nected while you install these drivers.
If you are running Windows Vista, see Appendix A on page 82 to install your device driv­ers. 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-0512 The 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
Next button.
.inf
Browse
On 32-bit machines, use the following path:
<Z8051 Installation>\Z8051_<version_number>\device drivers\OCD USB\x32
On 64-bit machines, use the following path:
<Z8051 Installation>\Z8051_<version_number>\device drivers\OCD USB\x64
UM024002-0512 The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
6
Figure 3. Browse For Driver Dialog, Windows Vista
UM024002-0512 The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
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-0512 The 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 dis­play the text string,
Zilog Z8051 USB OCD - No Firmware. This occurrence is normal
and can be disregarded.
UM024002-0512 The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
9
Figure 6. Unsuccessful Installation, Scenario 1
UM024002-0512 The Z8051 On-Chip Debugger
Z8051 On-Chip Debugger and In-System Programmer
User Manual
10
Figure 7. Unsuccessful Installation, Scenario 2
UM024002-0512 The 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-0512 The 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, Win­dow 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-0512 The 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-0512 The 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-0512 The 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 dis­abled (greyed out) in the Emulation menu during emulation.
UM024002-0512 The 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-0512 The 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 dur­ing 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 rein­itialized. 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 con­figuration 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 dis­abled (greyed out) in the Break/Configure menu during emulation.
UM024002-0512 The 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 dia­log 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-0512 The 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-0512 The 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 configura­tions. 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 oper­ational 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-0512 The 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 Debug­ger 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-0512 The Z8051 On-Chip Debugger
Loading...
+ 67 hidden pages