MTP Writer User¢s Guide September 2005 Copyright Ó 2005 by HOLTEK SEMICONDUCTOR INC. All rights reserved. Printed in Taiwan. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form by any means, electronic, mechanical photocopying, recording, or otherwise without the prior written permission of HOLTEK SEMICONDUCTOR INC. NOTICE The information appearing in this User¢s Guide is believed to be accurate at the time of publication. However, Holtek assumes no responsibility arising from the use of the specifications described. The applications mentioned herein are used solely for the purpose of illustration and Holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. Holtek reserves the right to alter its products without prior notification. For the most up-to-date information, please visit our web site at http://www.holtek.com.tw. Contents Contents Introduction ..........................................................................................................................1 Installation ............................................................................................................................2 Accompanying Hardware ....................................................................................................5 Programming a MTP Device with the HT-MWriter .............................................................6 Prepare the MTP File Before Programming the MTP Device ......................................... 6 Running the HT-MWriter Software Utility ........................................................................ 6 MCU Type and Driver Type for Programming................................................................. 6 Initialize the Data EEPROM.............................................................................................7 On-Line Programming Mode...............................................................................................7 Basic Functions .............................................................................................................. 7 Additional Functions ..................................................................................................... 14 Stand-Alone Programming Mode .....................................................................................17 Programming Steps ...................................................................................................... 17 LED Indicator Description ............................................................................................. 18 Using the Adapter Card .....................................................................................................18 System Messages ..............................................................................................................18 i MTP Writer User¢s Guide MTP Writer User¢s Guide Introduction The Holtek HT-MTPWriter was specifically developed to program the range of Holtek MTP (Multi-Time Programmable) microcontroller devices allowing users to easily and efficiently burn their program code into MTP devices. The HT-MTPWriter offers the advantages of a small and easy to manage size, in addition to easy to use special features. Other additional advantages include the ability to operate both connected to a PC in an on-line programming mode as well as being able to operate in a stand-alone programming mode. After downloading the program code from the PC to the HT-MTPWriter, the stand-alone mode allows the user to program MTP devices without connection to a PC. In the on-line programming mode, the HT-MTPWriter is connected to the PC via the supplied RS232 cable. In the stand-alone programming mode, no connection is required to the PC. As the Holtek range of MTP devices are supplied in many different package types, a range of adapters is supplied by Holtek to match the appropriate package type and pin count being used. The correct adapter must therefore also be selected and plugged into the HT-MTPWriter. The HT-MTPWriter writes both program code and data into the MTP MCU device. The data can be initialized using the HT-IDE3000 or the HT-MWriter software utility. The requirements for using the HT-MTPWriter are: · 16V power adapter with minimum current rating of 500mA. It is recommended that only the supplied power adapter is used. · The correct adapter to match the MTP device package type and pin count · IBM 386 compatible or higher specification PC · Win95/98/NT/2000/XP Windows operating system · HT-MWriter software utility 1 MTP Writer User¢s Guide Installation For connection to the PC, use the supplied cable to connect the HT-MTPWriter 9-pin D-type connector to the RS232 port of the PC as shown in Figure 1. R S 2 3 2 C a b le H T - M T P W r ite r P C Figure 1 To install the HT-MTPWriter software utility, run the ²HT-MwriterSetup.exe² file as supplied with the HT-MWriter, after which the following instructions should be followed. Note If the HT-Mwriter software utility has been installed already, then ignore this software installation. Figure 2 2 MTP Writer User¢s Guide Figure 3 Figure 4 3 MTP Writer User¢s Guide Figure 5 Figure 6 4 MTP Writer User¢s Guide Accompanying Hardware The outline of the HT-MTPWriter is shown in Figure 7: S u p p lie d R e m o v a b le A d a p te r P in 2 0 P in 1 9 2 0 - P in H e a d e r P in 1 P in 2 O K R e a d y F a il R S 2 3 2 C o n n e c to r P r o g r a m m in g S w itc h Figure 7 Component Description DC16V DC JACK, DC 16V socket 20-Pin Header Programming signal connector OK Green LED to indicate normal conditions Ready Yellow LED to indicate ready conditions Fail Red LED to indicate error conditions Programming Switch Programming key for stand-alone mode RS232 Connector 9-pin D-type connector for PC RS-232 port connector 4P DIP Switch DIP switch on rear side of HT-MTPWriter 5 MTP Writer User¢s Guide MTP Device Pin Name Programming Signal 20-pin Header Position PA0 AD0 8 PA1 AD1 6 PA2 AD2 4 PA3 AD3 2 PA4 CLK 10 PA5 CS 12 PA6 RW 14 OSC1 Ground (direct connection) ¾ OSC3 Ground (direct connection) ¾ VDD VDD 18 RES VPP 20 VSS Ground (direct connection) 11, 13, 15, 16, 17, 19 Programming Signal/MTP Device Pin-Out Cross-Reference Table Programming an MTP Device with the HT-MWriter Prepare the MTP File Before Programming the MTP Device Before the MTP device can be programmed, an MTP data file, with the file extension .MTP, must first be generated using the Build command in the Project menu within the HT-IDE3000 development environment. After finishing the build procedure, the HT-MTPWriter hardware and the HT-MWriter software can then be used to program the MTP device. Running the HT-MWriter Software Utility After running the HT-MWriter software utility from under the Holtek HT-Mwriter item in the main Windows program group, the window as shown in Figure 8 will be displayed. MCU Type and Driver Type for Programming The MCU box indicates the present MCU type that is to be programmed. Either of the following commands determines the MCU type: · Open an MTP file by selecting the Open button, the MTP file contains information about the MCU type of MTP device that is to be programmed · Set the MCU type by selecting the MCU command in the Settings menu 6 MTP Writer User¢s Guide Initialize the Data EEPROM If an initial value is required for some of Data EEPROM memory, then set the value by using Data EEPROM Editor command in the Tools menu within the HT-IDE3000 development environment before building the MTP data file. Also, the initial value can be set before downloading to the writer within the HT-Mwriter software. Please refer to On-Line Programming Mode, Basic Function in the following text. Note If an MTP device blank check is required, then it is not necessary to open an MTP file. After the HT-MTPWriter is connected to the PC, the HT-MWriter software utility reads the driver type from the HT-MTPWriter and displays it in the Driver box as shown in Figure 8. If no driver type is read out, the HT-MWriter software utility will download the corresponding driver data to the writer according to the last MCU type or the default MCU type. Therefore, the MCU type and the Driver type should be the same unless the connection between the PC and the HT-MTPWriter is broken or the HT-MTPWriter is powered off. The functions that can be executed by the HT-MTPWriter depend upon the driver type in its flash memory. An incorrect driver type will induce programming errors. The user has to ensure that the MCU type and Driver type are the same. On-Line Programming Mode Basic Functions There are 9 function keys or control buttons as shown at the right hand side of the window shown in Figure 8, with each button representing an instruction, the functions of which are explained below. In Figure 8, the Program window contains/displays the program code read either from the MTP file or from an MTP device. The Data window contains/displays the data read either from the MTP file or from the Data EEPROM of the MTP device. The Status Bar displays the result of executing each basic function. 7 MTP Writer User¢s Guide P ro g ra m W in d o w D a ta W in d o w S ta tu s B a r Figure 8 Figure 9 8 MTP Writer User¢s Guide ® Open This opens a file which has an .MTP suffix. It is the contents of this memory which will be accessed when programming the relevant MTP device. After selecting ²Open² the file dialogue box will be displayed from which the correct folder and file name can be chosen, as shown in Figure 9. The file contents will be displayed in the Program window and Data window after being opened, and the checksum of the opened file will be shown in the Checksum box, as shown in Figure 10. After opening an MTP file, the value in the Data window can be modified directly. Any modification is not written to the writer before executing the Download command. Figure 10 9 MTP Writer User¢s Guide ® Download This instruction downloads the contents of the presently opened MTP file and driver information to the writer¢s flash memory, as shown in Figure 11. An MTP file must already have been opened before using this instruction. If the value in the Data window has been modified, then the new value will be downloaded into the writer¢s flash memory. Figure 11 ® Blank Check This instruction checks that the presently loaded MTP device has not previously been written to. The results of this check will be displayed in the Program window. 10 MTP Writer User¢s Guide ® Program This instruction encompasses two functions. The first is to program the data already in the writer¢s flash memory into the MTP device, the second is a verification check to ensure that the actual data burned into the MTP device is the same as the data in the writer¢s flash memory, as shown in Figure 12. Before this instruction is used the relevant MTP file must have been previously downloaded. Figure 12 ® Verify The contents of the presently loaded MTP device will be read and checked that it is the same as the data loaded into the writer¢s flash memory, the results of which will be displayed in the Program window. Before this instruction is used, the relevant MTP file must have been previously downloaded. ® Lock This instruction will implement a protect function in the MTP device preventing the contents of this MTP device from being read. After programming an MTP device, this instruction can be used to protect its contents. 11 MTP Writer User¢s Guide ® Auto This instruction will execute up to four instructions consecutively: Blank Check, Program, Verify and Lock, as shown in Figure 13. If any of the instructions do not execute correctly, the process will be halted with any following remaining instructions not being executed. The instructions to be executed by the ²Auto² command can be selected from the Auto option under the Settings menu. Figure 13 ® Read This instruction will read from the MTP device and display the contents on the window as shown in Figure 10. Then user can store it to a new MTP file. The contents of the writer¢s flash memory is not changed. If it is required to program a new MTP device from this read data, then the writer¢s flash memory should be updated by pressing the Download key first, then press the Program key. This instruction will fail if the MTP device is already locked. 12 MTP Writer User¢s Guide ® Erase This instruction will erase the contents of the MTP device including both the program and data memory. Figure 14 will be displayed when this instruction has completed. Figure 14 The relationship between function commands and programming resource. D o w n lo a d O p e n W r ite r ( F la s h M e m o r y ) H a r d D is k P C ( H T - M w r ite r ) N o te : " R e a d /B la n k " D e n o te s th e d ir e c tio n o f d a ta flo w 13 P ro g ra m /L o c k M C U V e r ify MTP Writer User¢s Guide Additional Functions ® Setting This menu contains three setup commands for the basic configuration of the HT-MTPWriter which determines the way in which the HT-MTPWriter is configured and operated. A detailed explanation of each command is shown below: · Detect Connect This command looks for a connection between the HT-MTPWriter hardware and the PC and will display the result in the Program window. · MCU This command specifies a specific MCU type for the following operations. The driver data for the specified MCU will be downloaded to the HT-MTPWriter hardware if the writer has been connected to the PC and is powered on. · Auto This command will setup which programming instructions are to be automatically and sequentially executed by the Auto button. 14 MTP Writer User¢s Guide ® Option Two commands exist in this menu. The first of these is the option command which will display the configuration options for the presently opened MTP file as shown in Figure 15. The other is the Print command, which will printout the configuration options for the presently opened MTP file. Figure 15 ® S/N - Serial Number Writing The serial number function allows a user specified serial number to be written into each MTP device. This serial number, the address of which is specified by the user, is written into the Lower Byte address of Program ROM for each MTP device. After a serial number is written into an MTP device, an auto-incrementing function ensures that subsequently programmed devices will contain serial number incremented by one each time. It is first required to setup the initial data and fixed address of the first serial number. Selecting ²Setup² from the ²S/N² menu will display the window as shown in Figure 16, which can be used to input the initial serial number¢s data and its corresponding address. Figure 16 15 MTP Writer User¢s Guide After the initial data and address information has been setup, selecting ²Enable² from the ²S/N² menu will activate the serial number function. When the serial number function is activated, the present serial number¢s corresponding address and data will be displayed at the lower right hand side of the main window as shown in Figure 17. During the programming stage the first device to be programmed will contain the previously setup serial number data in its Program ROM at the indicated address. Subsequent devices will contain serial numbers incremented by one for each additional device. To reset the order of serial numbers, again select ²Setup² from the ²S/N² menu. Figure 17 16 MTP Writer User¢s Guide Stand-Alone Programming Mode Before the stand-alone programming mode is used it is essential that the following steps have been first implemented: · The program code must have been already been downloaded into the HT-MTPWriter. When this happens the yellow LED will illuminate to indicate that the system is ready, if there is an error then the red LED will illuminate. · Select the programming commands using the DIP Switch. The following table lists the DIP switch functions. Note that the DIP switches are only used for stand-alone operation. DIP Position Function Description DIP1 Erase If DIP switch #1 is on, the writer will erase the program memory and data memory of the MTP device before programming DIP2 Blank Check If DIP switch #2 is on, the writer will run a blank check on the MTP to check if its contents are empty before programming. If DIP switch #2 is off, the writer will start programming without a blank check. DIP3 Lock If DIP switch #3 is on, after programming the data into the MTP, the data will be locked and prevented from being read out in the future. DIP4 Buzzer If DIP switch #4 is on, then after programming, whether successful or not, an audible reminder signal will be generated. Programming Steps ® Step 1 Connect the supplied 16V power adapter, the HT-MTPWriter will check whether the programming data in the Flash memory is correct or not. The system will then remain in a standby state if the programming data is valid. Otherwise, the HT-MTPWriter must be connected to the PC using the supplied RS232 cable to download the program code to the HT-MTPWriter. ® Step 2 Place an MTP device that is compatible with the data in the HT-MTPWriter, into the Textool socket. ® Step 3 Press the programming switch to begin the programming cycle. ® Step 4 Check the indicator LEDs to verify that the programming operation was successful. ® Step 5 If successful, remove the programmed MTP device to allow the HT-MTPWriter to return to its standby state. If the programming operation has failed, press the programming key again to allow the HT-MTPWriter to go back to its standby state. ® Step 6 Repeat step 2~step 5. 17 MTP Writer User¢s Guide LED Indicator Description The HT-MTPWriter contains 3 LED indicators to display the status of the programming operation. The following table lists the function of each of the LED indicators: LED Type Status Description Flash once then stop MTP device is locked Flash twice then stop Data in the HT-MTPWriter is incompatible with the present MTP device Flash 3-times then stop MTP device already contains data, device not blank Red LED Flash 4-times then stop Programming failed Failure Status Programming complete but error detected during the Flash 5-times then stop verification process Flash 6-times then stop Failed to lock the present MTP device Green LED OK Status Rapid flashing* Data in the HT-MTPWriter is invalid LED illuminated Programming successful Yellow LED - Slow flashing Ready Status Rapid flashing System is ready and awaiting programming instruction Programming operation in progress ²*² If the Red LED flashed rapidly, which indicates the content of the writer¢s flash memory is invalid. To repair this, just to connect the HT-MTPwriter to the PC and execute the HT-Mwriter software utility, then open an MTP file and download to the writer. Using the Adapter Card The HT-MTPWriter is supplied with an adapter card which contains a 40-pin Textool socket. If it is necessary to program MTP devices whose package types are unable to use the supplied Textool socket there are two alternative possibilities: · Remove the supplied adapter card and replace it with another type of adapter card that can accommodate the different MTP. These other adapter cards for the HT-MTPWriter will have a C prefix next to their adapter card product name. · Use the existing supplied adapter card in conjunction with one of the MTP writer alternative adapter cards. These alternative MTP writer adapter cards can be plugged directly into the 40-pin Textool socket of the supplied HT-MTPWriter adapter card. These other adapter cards for the MTP writer will have a T prefix next to their adapter card product name. System Messages · Download driver OK! The PC has downloaded the MCU programming information to the writer¢s flash memory. 18 MTP Writer User¢s Guide · Disconnected from the Writer The PC has failed to connect to the HT-MTPWriter, to rectify check the power supply and the RS232 cable. · Connected with Writer! The PC has connected to the writer. · Failed to Open File! The present MTP file cannot be opened, either this file has errors or the file format is invalid. · Load file failed! Can¢t load the present MTP file. Check the specified file. · Not support the type of MCU! The software utility does not support the MCU type in the present MTP file or the driver in the writer. · Not support the type of File! The software utility does not support the file format, it may not be an MTP file. · Failed to Read MTP File Record! The file format of the present MTP file has errors or the file format is invalid. · Failed to Allocate Memory! Failed to allocate memory for the present MTP file. · Invalid Checksum for the MTP File! The checksum of the MTP file is incorrect. · Writer is Busy. The writer cannot execute the requested command as it is still executing other operations. · Failed to write to flash ROM! The writer is unable to download the contents of the MTP file or Driver data into the writer. · Device is Locked! The MTP device has been locked. · ID Error! The Driver is not consistent with the ID in the MTP device · Not Blank! The MTP device is not empty. · Programming Failed! Failed to program the MTP device. · Verify Failed! The contents of the present MTP device is not consistent with the data in the writer¢s flash memory. 19 MTP Writer User¢s Guide · Lock Failed! Cannot lock the present MTP device. · ROM Format Error! The record format in writer¢s flash memory is incorrect. This error may be caused by incomplete downloading or because the contents of the flash memory is not valid for the present Driver in the writer. · Writer Time-out! The writer does not respond after a command has been issued. · Checksum of received data error! The checksum returned from the writer is incorrect. Restart the writer and the software utility. · Unknown Error! The software utility cannot recognize the message returned from the writer. Restart the writer and software utility. · Not Blank! The result message for the Blank Check instruction indicating that the MTP device is not empty. · Erase failed! The result message for the Erase instruction indicating that the writer is unable to erase the MTP device. · Failed to Write to Program ROM! The writer has failed to write to the program ROM. · Write OK! The writer has successfully programmed the program ROM. · Verify data failed! The writer has failed to verify the contents of the data EEPROM. · Verify OK! The writer has successfully verified the program ROM. · S/N Address Exceeds the Program ROM Size, Set to Default Address: 1, 2, 3, 7 The address specified for the serial number exceeds the program memory¢s range. The system will set the addresses to the default addresses 1,2, 3,7. · S/N Addresses are not Blank in the MTP File! In the present MTP file, there is data already written to the address specified for the serial number. · No status return from writer The PC is unable to receive the return status from the writer. To rectify check the power supply and the RS232 cable. · Unknown status This is an internal error. 20 MTP Writer User¢s Guide Holtek Semiconductor Inc. (Headquarters) No.3, Creation Rd. II, Science Park, Hsinchu, Taiwan Tel: 886-3-563-1999 Fax: 886-3-563-1189 http://www.holtek.com.tw Holtek Semiconductor Inc. (Taipei Sales Office) 4F-2, No. 3-2, YuanQu St., Nankang Software Park, Taipei 115, Taiwan Tel: 886-2-2655-7070 Fax: 886-2-2655-7373 Fax: 886-2-2655-7383 (International sales hotline) Holtek Semiconductor Inc. (Shanghai Sales Office) 7th Floor, Building 2, No.889, Yi Shan Rd., Shanghai, China 200233 Tel: 021-6485-5560 Fax: 021-6485-0313 http://www.holtek.com.cn Holtek Semiconductor Inc. (Shenzhen Sales Office) 5/F, Unit A, Productivity Building, Cross of Science M 3rd Road and Gaoxin M 2nd Road, Science Park, Nanshan District, Shenzhen, China 518057 Tel: 0755-8616-9908, 8616-9308 Fax: 0755-8616-9533 Holtek Semiconductor Inc. (Beijing Sales Office) Suite 1721, Jinyu Tower, A129 West Xuan Wu Men Street, Xicheng District, Beijing, China 100031 Tel: 010-6641-0030, 6641-7751, 6641-7752 Fax: 010-6641-0125 Holtek Semiconductor Inc. (Chengdu Sales Office) 709, Building 3, Champagne Plaza, No.97 Dongda Street, Chengdu, Sichuan, China 610016 Tel: 028-6653-6590 Fax: 028-6653-6591 Holmate Semiconductor, Inc. (North America Sales Office) 46729 Fremont Blvd., Fremont, CA 94538 Tel: 510-252-9880 Fax: 510-252-9885 http://www.holmate.com Copyright Ó 2005 by HOLTEK SEMICONDUCTOR INC. The information appearing in this User¢s Guide is believed to be accurate at the time of publication. However, Holtek assumes no responsibility arising from the use of the specifications described. The applications mentioned herein are used solely for the purpose of illustration and Holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. Holtek¢s products are not authorized for use as critical components in life support devices or systems. Holtek reserves the right to alter its products without prior notification. For the most up-to-date information, please visit our web site at http://www.holtek.com.tw. 21