Holtek 8051 User manual

Holtek 8051 e-Link Driver for
Keil™ μVision User Manual
Revision: V1.10 Date: October 17, 2012October 17, 2012

Rev. 1.10 2 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Table of Contents
Table of Contents
1 Holtek 8051 e-Link Driver Instructions and Installation ................................................... 3
Installation.............................................................................................................................. 4
Software Installation ......................................................................................................................... 4
Hardware Requirements .................................................................................................................. 7
HT8051OCDS-ICE Composition ...................................................................................................... 8
HT8051OCDS-ICE Usage Restrictions .......................................................................................... 12
2 Operating Description .......................................................................................... 13
Operating Description .......................................................................................................... 13
Project Setting ................................................................................................................................ 13
Holtek 8051 e-Link Driver Setting ........................................................................................ 15
Flash Programming Driver Setting....................................................................................... 19

Rev. 1.10 3 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
Table of Contents
1 Holtek 8051 e-Link Driver Instructions and Installation
The Holtek 8051 e-Link driver is an AGDI interface debug adapter driver program which can be
embedded into an integrated development environment which supports an AGDI interface. It can be
used to assist users with rapid development of their application programs for Holtek’s 8051 series
MCUs.
The HT8051OCDS-ICE is composed of an e-Link, for the HT8051OCDS, and a target board
(with EV). The e-Link is a Holtek new generation OCDS structure in-circuit debug adapter which
provides customers with a development tool to directly debug their application boards. An OCDS
interfaced MCU is required on the application board.
As for the software, an integrated develop environment supporting the AGDI interface is necessary,
such as the KeilTM μVision, to develop the Holtek’s 8051 series MCU programs.
This user manual describes the way to use the e-Link Driver and the Holtek Database in the KeilTM
μVision environment as well as any relevant details regarding the HT8051OCDS-ICE.

Rev. 1.10 4 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
Installation
Note: The KeilTM μVision software must be installed rst.
Software Installation
▀Step 1
Execute the AGDIDriver_Setup_V19.exe.
Note: Your software version number may be different with that in the description. It is
recommended that only the latest version is used.
▀ Step 2
Installation welcome window: press “Next” to continue or “Cancel” to exit.

Rev. 1.10 5 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
Holtek 8051 e-Link Driver Instructions and Installation
▀ Step 3
Specify the installation version of the KeilTM μVision and then press “Next.”
▀ Step 4
Specify the installation folder for the KeilTM μVision. Make sure the specied folder is correct so
that the driver program can be installed correctly. Press “Next.”

Rev. 1.10 6 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
▀ Step 5
After all installation details are conrmed, press “Install” to start the installation.
▀ Step 6
When the installation is completed, press “Finish” to complete the setup operation.

Rev. 1.10 7 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
Holtek 8051 e-Link Driver Instructions and Installation
Hardware Requirements
Use the USB cable to connect the e-Link with a USB port on a PC.
PC
USB Cable
e-Link
e-Link Pin Assignment
2: - 1: VDD
4: - 3: -
6: - 5: OCDSCK
8: - 7: X
10: - 9: OCDSDA
12: - 11: GND

Rev. 1.10 8 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
HT8051OCDS-ICE Composition
▀ The HT8051OCDS-ICE is composed of two parts:
HT8051OCDS e-Link + Target Board (with EV) .
▀HT8051OCDS e-Link:
The e-Link is a Holtek new generation OCDS structure on-line debug adapter. When used with
the AGDI interfaced program development software, users are provided with a development tool
to directly debug their application boards.
▀e-Link Hardware Box:
e-Link (Front)
e-Link (Back)
e-Link (Side)
▀ Target Board (with EV):
The EV is an IC with an OCDS interface.
During debug, the e-Link can execute a range of debug operations such as single step, full speed,
halt and breakpoint setup by transmitting instructions to the EV. When it is not being used for
debug purposes, the EV will function in the same way as an actual IC.

Rev. 1.10 9 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
Holtek 8051 e-Link Driver Instructions and Installation
▀HT8051OCDS-ICE Hardware Connection Description
● HT8051OCDS e-Link Pin Assignment
e-Link (Back)
e-Link (Back)
1 Reserved
2 Reserved
3 Reserved
4 Reserved
2: - 1: VDD
4: - 3: -
6: - 5: OCDSCK
8: - 7: X
10: - 9: OCDSDA
12: - 11: GND
e-Link (Side) e-Link (Side)
12: - 11: GND
10: - 9: OCDSDA
6: - 7: X
8: - 5: OCDSCK
4: - 3: -
2: - 1: VDD

Rev. 1.10 10 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
▀ HT8051OCDS e-Link Pin Denitions
Name Description Direction
VDD
When the e-Link is used to supply power, the power is provided on
this output pin. e-Link→
When using an external power supply, this is the e-Link input power
pin. e-Link←
OCDSCK OCDS CLK signal during simulation e-Link→
OCDSDA OCDS Data signal during simulation e-Link ↔
GND e-Link Ground pin e-Link ↔
Reserved e-Link reserved pins Unknown
▀VDD, OCDSCK, OCDSDA, GND are the necessary HT8051OCDS-ICE pins. Even if power is
supplied from the target board, VDD must be the same as it is used as the e-Link output voltage
reference
●Note that the e-Link reserved pins are not NC pins. Their voltages are at an unknown level
▀ HT8051OCDS-ICE Hardware Connection Figure
Connect to PC
e-Link
OCDS EV
e-Cable1225A

Rev. 1.10 11 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
Holtek 8051 e-Link Driver Instructions and Installation
▀ Points to consider when using the HT8051OCDS-ICE
●Voltage and Current:
– The operating voltage of the HT8051OCDS-ICE can be within 2.0V~5.5V
– If the Power Out box is checked then the power supply to the Target Board will be provided
by the e-Link. If this item is not checked, an external power supply will be required
– In addition to the EV needing a VDD power supply, the other analog/digital circuit power
supplies may be connected with the OCDS operation. Refer to the datasheet to see if it is to
be provided by the user or to be connected with the VDD
– The maximum current for the power supply to the Target Board is 200mA. If the application
board current exceeds 200mA, an external power supply must be used
– When powered by the e-Link, if the load current becomes larger, the VDD output may not
be stable. It is recommended to take this into account during VDD setup

Rev. 1.10 12 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
HT8051OCDS-ICE Usage Restrictions
▀ OCDSDA / OCDSCK are pin-shared with other functions
1. When the e-Link is enabled, the other OCDSDA/OCDSCK shared pin function will be
invalid.
2. When the e-Link is disabled, the other OCDSDA/OCDSCK shared pin functions are normal.
▀ The OCDSDA/OCDSCK cable cannot be connected to a capacitor. When it is pin-shared with
the reset pin, the Reset circuit should be as follows:
1N4148* 10kΩ~
100kΩ
VDD
OCDSCK must
connect to this point
VSS
PB0/RES
VDD
300Ω*
0.1~1uF
0.01uF**
▀ When the OCDSDA is pin-shared with an I/O pin powered by the e-Link, the 6.8KΩ pull high
resistor connected to the OCDSDA pin will inuence the I/O voltage value. This should be taken
into account when designing the I/O circuits.
▀ HT8051OCDS-ICE Keys and Indicators
●Keys:
Used to reset the HT8051OCDS-ICE.
●Indicator LEDs
Status: The yellow LED is used to indicate if the e-Link supplies power to the target board.
On: Supplying power to the target board
Off: Not supplying power to the target board
Error: The red LED is used to indicate whether the e-Link is operating incorrectly.
On: Error has occurred
Off: Operating normally
Active: The blue LED is used to indicate the e-Link activity level.
Quick ashing: Busy
Off: Waiting

Rev. 1.10 13 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Holtek 8051 e-Link Driver Instructions and Installation
Operating Description
2 Operating Description
This chapter describes the way to use the e-Link Driver and Holtek Database in the KeilTM μVision
environment.
Operating Description
Project Setting
▀ Stpe 1
Select “New Project” in the Project menu to open a new project.
The user will be requested to input a project name after which “Save” should be pressed.

Rev. 1.10 14 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Operating Description
▀ Stpe 2
After the Project folder has been selected, the “Select a CPU Data Base File” window will pop
up. Select the “Holtek Device Database” and then press “OK.”
▀ Stpe 3
Select the required MCU part number and press “OK” to complete the project setup.

Rev. 1.10 15 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Operating Description
Operating Description
Holtek 8051 e-Link Driver Setting
▀ Stpe 1
Select the “Options for Target ‘HT85F227’*” in the Project menu.
Note*: HT85F227* is the target name.
Then the following window will appear.

Rev. 1.10 16 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Operating Description
▀ Stpe 2
Switch the operating interface to the Debug page.
▀ Stpe 3
Click the Use options in the right half page and select the “Holtek e-Link 8051 Debugger” from
the menu, then press the “Settings” key on the right.

Rev. 1.10 17 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Operating Description
Operating Description
Note: If the Run to main() option in the right page is checked, after the debug operation is executed,
as shown in the gure below, the program will start operating until it enters main(). If Run to main()
is not selected, the program will stop at address 0 immediately after debug.
▀ Stpe 4
Press the “Settings” on the right side of the Holtek e-Link 8051 Debugger options and the
following window will appear. Press “OK” to nish.
Note: If the Power Out box is checked, the e-Link will supply power to the target board. If this box
is not checked, an external power supply will be required.

Rev. 1.10 18 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Operating Description
▀ e-Link F/W version update
When an updated e-Link F/W version is available, this will be indicated as shown by the blue
frame in the diagram. Press “Update” for an immediate F/W update.

Rev. 1.10 19 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Operating Description
Operating Description
Flash Programming Driver Setting
▀ Stpe 1
Select the “Options for Target ‘HT85F227’
*
” in the Project menu.
Note*: HT85F227* is the target name.
The successive operating window will appear as follows.

Rev. 1.10 20 of 22 October 17, 2012
Holtek 8051 e-Link Driver for Keil μVision User Manual
8-Bit 8051 Series
Operating Description
▀ Stpe 2
Switch the operating interface to the Utilities Page.
▀ Stpe 3
Click the “Use Target Driver for Flash Programming” option, select the “Holtek e-Link 8051
Debugger” and then press the “Settings” key.
Table of contents
Other Holtek Recording Equipment manuals