Zilog Z51F3221 User Manual

Z8051™ Family of 8-Bit Microcontrollers
Z51F3221 Development Kit
User Manual
UM025801-1112
Copyright ©2012 Zilog®, Inc. All rights reserved.
www.zilog.com
Z51F3221 Development Kit
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 DOCUMENT. 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.
UM025801-1112

Revision History

Each instance in the Revision History table below reflects a change to this document from its previous version.
Revision
Date
Nov 2012
Level Description Page
01 Original issue. All
Z51F3221 Development Kit
User Manual
iii
UM025801-1112 Revision History

Table of Contents

Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
List of Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Kit Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Supported Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Z51F3221 Development Board Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Z51F3221 Development Board Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Install the Z8051 OCD Software and Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Supported Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Z8051 OCD Driver Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
FTDI USB-to-UART Driver Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Z51F3221 Development Kit
User Manual
iv
Configure the Z8051 OCD and Z51F3221 Development Board . . . . . . . . . . . . . . . . . . . . . . . 17
Build and Run the Z51F3221 Demo Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Using the Keil µVision IDE on a Demo Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
HyperTerminal Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Sample Projects and Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Appendix A. Schematic Diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Appendix B. OCD Driver Installation on Windows Vista Systems . . . . . . . . . . . . . . . . . . . . 40
Appendix C. OCD Driver Installation on Windows XP Systems . . . . . . . . . . . . . . . . . . . . . . 43
Appendix D. Stand-Alone Flash Programming Using the Keil µVision IDE. . . . . . . . . . . . . 46
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
UM025801-1112 Table of Contents

List of Figures

Figure 1. The Z51F3221 Development Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Figure 2. Z51F3221 Development Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 3. Block Diagram of the Z51F3221 Development Board . . . . . . . . . . . . . . . . . 4
Figure 4. Z51F3221 Development Board: Highlighted Components . . . . . . . . . . . . . . 5
Figure 5. Install Device Driver Dialog, Windows 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 6. Browse For Driver Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 7. Can’t Verify Publisher Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . 10
Figure 8. Successfully Installed Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . 11
Z51F3221 Development Kit
User Manual
v
Figure 9. Unsuccessful Installation, Scenario 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 10. Unsuccessful Installation, Scenario 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 11. Device Manager Dialog, Windows 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 12. A Successful USB-to-UART Driver Installation . . . . . . . . . . . . . . . . . . . . . 16
Figure 13. Connecting the 10-Circuit Cable to the Board . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 14. Connecting the USB Mini-B Cable to the Board . . . . . . . . . . . . . . . . . . . . 18
Figure 15. An Example Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 16. Initial OCD Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 17. Object File Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 18. Configuration Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 19. Configuration Is Changed Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 20. A Typical On-Chip Debugger Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 21. A Typical On-Chip Debugger Window with Child Windows Open . . . . . . 25
Figure 22. Reset & Go Toolbar Icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 23. Selecting the Demo Project File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 24. Selecting the Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 25. Selecting the Target Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 26. Configuring the Debug Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 27. Configuring the Flash Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 28. Load Application at Startup Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
UM025801-1112 List of Figures
Z51F3221 Development Kit
User Manual
Figure 29. Beginning a Debug Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 30. A Default On-Chip Debugger Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 31. Demo Program Menu in HyperTerminal . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 32. Z51F3221 Development Board, #1 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Figure 33. Z51F3221 Development Board, #2 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 34. Found New Hardware Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . 40
Figure 35. Install Device Driver Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 36. Couldn’t Find Driver Dialog, Windows Vista . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 37. The Found New Hardware Wizard Welcome Screen . . . . . . . . . . . . . . . . . 43
Figure 38. The Found New Hardware Wizard’s Browse Screen . . . . . . . . . . . . . . . . . 44
vi
Figure 39. Selecting A Target Driver For Flash Programming . . . . . . . . . . . . . . . . . . . 46
Figure 40. Configuring Additional Flash Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Figure 41. The Keil IDE Flash Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
UM025801-1112 List of Figures

List of Tables

Table 1. Z51F3221000ZCOG Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Table 2. Z51F3221 Development Kit Sample Projects . . . . . . . . . . . . . . . . . . . . . . . 36
Table 3. Z51F3221 Development Kit Documentation . . . . . . . . . . . . . . . . . . . . . . . 36
Z51F3221 Development Kit
User Manual
vii
UM025801-1112 List of Tables

Introduction

This manual describes how to set up Zilog’s Z51F3221 Development Kit (Zilog part num-
ber Z51F3221000ZCOG) and use it to evaluate your Z8051-based designs and applica-
tions.
The Kit features a development board consisting of five LEDs, five pushbuttons, a buzzer,
eight 14-segment LCD digits, port pin headers and a UART-to-USB port. The Board fea-
tures the Z51F3221 MCU in a 80-pin LQFP package, plus a DBG connector to connect
the Board to a host development PC using the Z8051 USB On-Chip Debugger (OCD)
cable. For more details about the Z51F3221 MCU, please refer to the Z51F3221 Product
Specification (PS0300).
This document guides you through the following tasks:
Z51F3221 Development Kit
User Manual
1
Install the Z8051 OCD Software and Documentation – see page 7
Configure the Z8051 OCD and Z51F3221 Development Board – see page 17
Build and Run the Z51F3221 Demo Project – see page 20
Figure 1 shows an image of the Z51F3221 Development Kit.
UM025801-1112 Introduction
Z51F3221 Development Kit
User Manual
2

Kit Contents

Table 1 lists the contents of the Z51F3221 Development Kit.
Item Description Quantity
1 Z51F3221 Development Board 1 2 Z8051 USB On-Chip Debugger (OCD) 1 3 Z8051 OCD Target Cable (10ckt) 1 4 USB Cable: A (male) to Mini-B 2 5 Z51F3221 Development Kit Insert (FL0149) 1
Figure 1. The Z51F3221 Development Kit
Table 1. Z51F3221000ZCOG Contents
UM025801-1112 Kit Contents
Z51F3221 Development Kit
Figure 2 shows an image of the Z51F3221 Development Board.
User Manual
3
Figure 2. Z51F3221 Development Board

Supported Operating Systems

The Z51F3221 Development Board and the Z8051 On-Chip Debugger support the fol low-
ing operating systems:
Microsoft Windows XP
Microsoft Windows Vista (32-bit/64-bit)
Microsoft Windows 7 (32-bit/64-bit)

Z51F3221 Development Board Block Diagram

Figure 3 shows a block diagram of the Z51F3221 Development Board.
UM025801-1112 Supported Operating Systems
Z51F3221 Development Kit
User Manual
4
Figure 3. Block Diagram of the Z51F3221 Development Board

Z51F3221 Development Board Description

The Z51F3221 Development Board consists of the following components:
Z51F3221: U1, 80-pin LQFP chip
3 LEDs: Green (D2), Red (D3) and Yellow (D4) connected to the GPIO pins of the Z51F3221 MCU
1 green LED to indicate USB power: D5
1 red LED to indicate an overcurrent condition: D6
5 pushbuttons: – SW1: RESET – SW2–SW5: connected to the GPIO pins of the Z51F3221 MCU
USB connector: P1
OCD connector: J3
UM025801-1112 Z51F3221 Development Board Description
Z51F3221 Development Kit
USB-to-UART interface: U7
USB interface providing power and communication to the Board
Power supply level that can be adjusted with potentiometer R20
Overcurrent protection circuit on the Board: U6 and D6
External source of reference voltage (2.5 V) for the on-chip ADC: VR1
MCU current consumption measurement resistor R5 with test points J6 and J7
Buzzer: U4
8-digit, 14-segment LCD panel
Test points, headers and prototype area with two footprints
User Manual
5
Figure 4. Z51F3221 Development Board: Highlighted Components
If a short on the Board should occur, or if its attached component(s) require more than
500 mA, the overcurrent protection functionality will trigger the red LED D6 to illuminate.
UM025801-1112 Z51F3221 Development Board Description
Z51F3221 Development Kit
User Manual
In this instance, power to the Board will be terminated, and the USB port of the PC will be
protected from shorting.
Schematic diagrams of the Z51F3221 Development Board are presented on pages 38 and
39 of this document.
The physical dimensions of the Board are 4.01" x 2.50" (101.8 mm x 63.5 mm).
6
UM025801-1112 Z51F3221 Development Board Description
Z51F3221 Development Kit
Note:
Note:

Install the Z8051 OCD Software and Document ation

The Z8051 On-Chip Debugger (OCD) interface is the interface by which your PC will
communicate with the Z51F3221 MCU to download and execute code. In addition to the
OCD, software such as development tools and sample applications will be installed.

Supported Operating Systems

The Software and Documentation for this reference design supports Microsoft W indows 7
(32-bit/64-bit), Windows Vista (32-bit/64-bit) and Windows XP.
User Manual
7
If you have already downloaded the Z8051 software and documentation from the Zilog Store and installed it following the procedure on the paper insert in your kit (FL0149), 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. In a web browser, download the Z8051 Software and Documentation v2.1 or later from the Zilog Store drive and double-click to launch the installation file named
3. From the main menu, select lowing options:
If you do not plan to use the Keil µVision4 IDE, select
SDCC
.
If you will be using the Keil µVision4 IDE, select
µVision4 IDE Debugging Support
If you only plan to use the programming features and do not plan to perform any
development, select
To install all files, select
. When the download is complete, unzip the file to your hard
Z8051_<version>.exe.
Go to the installation page, then select one of the fol-
Zilog OCD + Samples +
Zilog OCD + Samples + Keil
.
Zilog OCD.
All of the above.
In this filename, <version_number> refers to the version number of the OCD Software and Documentation release. For example, this version number may be 2.1.
UM025801-1112 Install the Z8051 OCD Software and Documentation
4. Follow the on-screen instructions to complete the OCD software installation.
Note:

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 t he W indows 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 Vi sta, see Appendix B on page 40 to install your device driv­ers. If you are running Windows XP, see Appendix C on page 43.
Z51F3221 Development Kit
User Manual
8
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 5.
Figure 5. Install Device Driver Dialog, Windows 7
IMPORTANT NOTE: If you should encounter the scenarios presented in Figures 9 or 10, right-click
your mouse on and select
ZILOG OCD I/F (highlighted in Figure 9) or Unknown device (highlighted in Figure 10)
Update Driver Software...
3. Select
Browse my computer for driver software (advanced) to display the dialog
shown in Figure 6, 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
UM025801-1112 Z8051 OCD Driver Installation
Z51F3221 Development Kit
On 64-bit machines, use the following path:
<Z8051 Installation>\Z8051_<version_number>\device drivers\OCD USB\x64
User Manual
9
Figure 6. Browse For Driver Dialog, Windows Vista
4. When Windows prompts you whether to install or not install, as shown in Figure 7,
Install this driver software anyway and wait until the installation is completed
click (Windows may prompt you more than once).
UM025801-1112 Z8051 OCD Driver Installation
Z51F3221 Development Kit
User Manual
10
Figure 7. Can’t Verify Publisher Dialog, Windows Vista
5. When the installation is complete, the screen shown in Figure 8 will appear. Click
Close to exit the OCD driver installation.
UM025801-1112 Z8051 OCD Driver Installation
Loading...
+ 38 hidden pages