Home

HT-IDE3000 User's Guide

image

Contents

1. 6 7 8 3 B C D E F lt GARAM e Trace List Fig 6 4 The Trace List window displays the trace record information as shown in Fig 6 5 The 85 Chapter 6 Menu Window contents of the trace record can be defined in the Debug command in the Options menu Double click the trace record in the Trace List window will activate the source file window and the cursor will stop at the corresponding line 86 Chapter 6 Menu Window INSTRUCTION FILE LINE A 6H init asm 84 589 1H init asm 87 51H A A init asm 88 529 A 68H init asm 91 539 1H init asm 92 55H A 96H init asm 95 55H f init asm 96 9906
2. 3 25 Fig 3 23 39 Chapter 3 Menu File Edit View Tools Option Project settings Project Option Debug Option Directories Document Production Add Change Book Item Book Title Help Book Path D Projects File Struck doc Tools User s Guide Holtek HT IDE3000 amp Us Holtek C 1 Prose Holtek V2 EHCC Prog Important Notes on using Holtek C V1 HCC In Co Holtek C V2 EHCC stan Holtek e ICE Quick Start Holtek e ICE Pin Assignm Holtek HTSOCDS ICE Us Sq Device Data Documents Help iSi E Work Eg Class 3 24 3 25 40 Chapter 3 Menu File Edit View Tools Option Production In order to let users know which IC has been locked the HT IDE3000 provides an identification code function as shown in Fig 3 26 When the setput is finished the identification code will be written into the corresponding document MTP by clicking on the ReBuild button Note This function is available for OTP and flash type MCUs The HT IDE3000 software version must be 7 71 or above The Hope3000 software version must be 3 06 or above Project settings Project Option Debug Option Directories Document Production Enable identification code Enter up to 2 characters Fig
3. MCU HT46RB70 v3 a BC D poan TuS GG GG 7 Cascade PEL T Header Title Horizontally Qa Gc Vertically ee GG Arrange Icons Ge Workspace CtrleShitteE ea aa a Gd Ge Ge GG Qa Ga 1 spur aa aa ROC 19 ChiShiftO rece List CtikShif T lt TMR1H orH TMRIL 10 7 TMR1C 11H Register Pa 12 Voile Pac Watch EIT Gur g aao 30901 Pogam S 0 Eol aaa aaa 1 x rara arca PEC zum 2ROM qaaa re ibd i Goa
4. terii 7 Hardware Installation emm een 7 Software Installation 8 Driver digital erem eet nen 11 pter esses E EE de acie debct b 13 Step 1 Create New Project with the 13 Step 2 Build the Project seem cent ect teda 13 Step Programming the MCU Device 14 Step 4 Transmit Code to the company 14 Chapter eee Start the HT IDE3000 System File Menus ep eet ERO ED RR RP 19 20 VIEW a eee 21 TOOS MENU tte s ROS ctn 22 Configuration E E ee ind 23 Conte nts Import Configuration Options eee 23 Diagnose ioter 23 Library ete eee one ERR RERO HERE cease 25 Holtek C V2 2V3 syntax 25 Program Location 27 cog 29 LCD Sim lator 32 Voice amp Flash Download 32 Switch OCDS Mode sse 32 Smart Programming Settings 32 Options t atn Ri 33 Project ccs sce fs cet ehe RR 34 Editor Settings
5. 08 08 00 28 02 80 00 00 00 00 00 00 00 01 00 00 00 00 00 1 66 00 00 00 00 00 00 00 00 08 00 00 00 00 00 04 00 00 00 29 18 00 00 06 00 218 00 00 00 02 00 00 00 00 00 01 00 00 22 08 00 00 00 00 10 46 88 2 23H org 1w 00 00 00 00 O0 00 00 40 02 00 08 08 08 88 00 00 00 48 25 Feet 20 80 00 02 00 00 00 80 00 z 26H 78 SETIOS SET i 2 Reset PAG PR PB 7 PC PD7 PD6 PD PE7 PE URD 5115 5114 Download option Address D Project HT46RB70 Test Test 0PT Socket 0 ID 80 VER 01 Socket 1 ID h3 UER 5 Read 83 Socket 2 ID 8B UER 80 Read 8B Download D Project HT46RB76 Test Test TSK 166 Loading debug information Test Total 8 error s 8 warning s lt gt warene watchs 7 La7 Coli Emulstion 0001 Fig 5 2 Go Stepinto Step over Step Out Rese
6. void aDUMMY SECTION CODE CALL begin MAIN SECTION CODE nain begin h lt 74 int vari i 8 uar2 2 var3 5 CLR CR1 MOU 82H MOU CR2 MOU A 85H MOU Fig 6 10 Output The Output window shows the system messages from the HT IDE3000 when the Build Rebuild All commands are executing By double clicking on the error message line the window containing the source file will be displayed and the corresponding line containing the error highlighted The Output window also displays the Program Checksum and the Program Verify Code This can assist the user to know if the program has been modified 90 Chapter 6 Menu Window 9 Part Development Language and Tools Partll Development Language and Tools 93 Part l Development Language and Tools 94 Chapter 7 Assembly Language and Cross Assembler Chapter7 Assembly Language and Cross Assembler Assembly Language programs are written as source files They can be assembled into object files by the Cross Assembler Object files are combined by the Cross Linker to generate a task file A source program is made up of statements and look up tables giving directions to the Cross Assembler at assembly time or to the processor at run time Statements are constituted by mnemonics operations operands and comments Notational Conventions The following list describes the notations used by this document Exam
7. 60 Gh ape gue ce ent UI ue le 63 Reset the HT IDE3000 System 64 To Reset from the HT IDE3000 65 Emulation of Application Programs 65 To Emulate the Application 66 To Stop Emulating the Application 66 To Run the Application Program to a 66 To Directly Jump to a Line of an Application 66 Single 67 esens etas 68 Breakpoint Features 1 8 Description Breakpoint 69 How to Set 5 oed e ee 71 Trace the Application 73 Initiating the Trace 73 Stopping the Trace Mechanism se em 76 Trace Start Stop 76 Trace Record Format iei eee mee Pn P ere uen 79 CD api Et I RES 83 Window Menu Gomrmands rrt i eR p RI 84 ror EE 93 oer a esr t AEE 95 Notationa
8. er erie 41 e Rte WERE 42 it pe He RERO 43 e Link Activation 43 Bo kMarKS 47 Bookmarks 47 Bookmark Window Toolbar 47 eR DERBI e 48 ecce c OD e EH E ede 5 Create New 52 Step1 Project Location 52 Step2 Project Option 53 Step3 Project 54 Open soo Eas det d 55 Manage the Source Files of a 55 To Add a Source File to the 56 To Delete a Source File from the Project 56 To Move a Source File Up or Down 56 Build a Project s Task 5 To Build a Project Task File 58 To Rebuild a Project Task File 58 Assemble Compile 58 Assemble Compile a Program 58 Print Option Table Command 59 ll Conte nts Backup Restore Project
9. iud 3 Gao eaae 050 aafa Xaa c ucc 2181 Ge 12201 177 usb interrupt Gods aaa AuR org 10h STALL 24H GEER aaa aaa SIES 25 reti am n E Workspace io Check firmware file HTA6RB78 28080801 DES ID 48h Name Valve Address Firmware download wen frc wa Vict 1 1 1 Emwbton 0001 NUM Fig 6 1 83 Chapter 6 Menu Window Window Menu Commands Workspace The Workspace window lists out all of the source files in the project As shown in Fig 6 2 here chosen source files can be quickly selected Files can be added or removed here Work Space 2 Project test MCU 48 06 J Source Files LJ OBI Files 12 Header Files d External Files ad Work Space 2 Class View Fig 6 2 RAM The RAM window display the contents of the program Data Memory space as shown in Fig 6 3 The address spaces of the registers are not included in the RAM window because they are displayed in the register window The contents of the RAM window can be modified directly for debugging purpose The address displayed vertically is the base address while the horizontal single digit address is the offset All th
10. labell label1 mov tmp2 a label2 clr wdt1 clr sdz tmp2 jmp label2 sdz tmp1 jmp label1 ENDM The following source program refers to the macro Delay T ASM ListMacro Delay MACRO LOCAL 1 11 label2 542 jmp sdz jmp ENDM data section BCnt db SCnt db data code section at 0 code Delay BCnt end SCnt The Cross Assembler will expand the macro Delay as shown in the following listing file Note that the offset of each line in the macro from line 4 to line 17 is 0000 Line 24 is expanded to 11 lines and forms the macro body In addition the formal parameters tmp1 and tmp2 are replaced with the actual parameters BCnt and SCnt respectively 106 Chapter 7 Assembly Language and Cross Assembler File 10 01450 T asm Holtek Cross Assembler Version 2 80 Page 1 0000 T ASM 0000 Sample program for MACRO 0000 ListMacro 0000 Delay MACRO tmpl tmp2 0000 LOCAL 1 11 label2 0000 mov a 70h 0000 mov tmpl a 0000 labell 0000 mov tmp2 a 0000 label2 0000 clr wdt 0000 clr wdt2 0000 542 tmp2 0000 jmp label2 0000 sdz tmp 0000 jmp labell 0000 ENDM 0000 0000 data section data 0000 00 BCnt db 0001 00 SCnt db 0002 0000 code section at 0 code 0000 Delay BCnt SCnt 0000 0F70 mov a 70h 0001 0080 R mov BCnt a 0002 220000 0002 0080 SCnt 0003 220001 0003 0001 wdtl 0004 0005 clr wdt2
11. Chapter 1 Overview and Installation environment In addition the HT IDE3000 provides a software simulator for some devices which is capable of simulating the behavior of the company s 8 bit MCU range without connection to a hardware emulator More detailed information on the HT IDE3000 development system is contained within the HT IDE3000 User s Guide Installed in conjunction with the HT IDE3000 and to ensure that the development system contains information on new microcontrollers and the latest software updates the company provides regular HT IDE3000 Service Packs These Service Packs which can be downloaded from the the company website do not replace the HT IDE3000 but are installed after the HT IDE3000 system software has been installed Some of the special features provided by the HT IDE3000 include Emulation e Real time program instruction emulation Hardware ICE Easy installation and usage e Either internal or external oscillator Breakpoint mechanism e Trace functions and trigger qualification supported by trace emulation chip e Printer port for connecting the ICE to a host computer interface card for connecting the user s application board to the ICE Easy installation and usage e Either internal or external oscillator Breakpoint mechanism USB cable for connecting the e ICE to a host computer 2 54mm standard pins for connecting the user s application board to the e ICE e The EV use
12. of the ICE 22 HT ICE Diagnosis Connect to LPTI Options Code space 2190 Others Trace space Data space System space loEv 0 IoEV1 2 Test All Fig 3 7 24 Chapter 3 Menu File Edit View Tools Option Library Manager The Library Manager command in Fig 3 8 supports the library functions Program codes used frequently can be compiled into library files and then included in the application program by using the Project command in the Options menu Refer to the Cross Linker options item in the Options menu Project command The functions of Library Manager are Create a new library file or modify a library file Add Delete a program module into from a library file e Extract a program module from a library file and create an object file Part gives more details on the library manager Library Manager Library Name C Program MCU Development Tools HT IDE3000 V7 1LIB math6 lib Object in Library Object in Directory Ej E Objects information Directories d rh obj E Maximum ROM Size 0 words Minimum ROM Size 0 words Maximum RAM Size 1 words Minimum Size 1 words Public Name RH in module d rh obj d t10 0bj Maximum ROM Size 0 words Minimum ROM Size 0 words Maximum RAM Size 1 words Minimum RAM Size 1 words Public Name T10 in module d t10 obj d t11 0bj Maximum ROM Size 0
13. 0005 1780 R sdz SCnt 0006 2803 jmp 220001 0007 1780 sdz BCnt 0008 2802 jmp 220000 0009 end 0 Errors Assembly Instructions The syntax of an instruction has the following form where operand 1 operand Name mnemonic operand 2 commen label name instruction name keywords registers memory address registers memory address immediate value A name is made up of letters digits and special characters and is used as a label 107 Chapter 7 Assembly Language and Cross Assembler Mnemonic Mnemonic is an instruction name dependent upon the type of the MCU used in the source program Operand Operator and Expression Operands source or destination are the argument defining values that are to be acted on by instructions They can be constants variables registers expressions or keywords When using the instruction statements care must be taken to select the correct operand type i e source operand or destination operand The dollar sign is a special operand namely the current location operand An expression consists of many operands that are combined to describe a value or a memory location The combined operators are evaluated at assembly time They can contain constants symbols or any combination of constants and symbols that are separated by arithmetic operators Operators specify the operations to be performed while combining the
14. 56H 8F 41 fi 14H init asm 99 8007 57H A Br 88 fi 8H init asm 188 88D8 58H 1F66 66H init asm 114 1F67 67H init asm 115 8883 init asm 116 Fig 6 5 e Register The Register window displays all the registers defined in the MCU selected in the project Fig 6 6 shows an example of the Register window of HT48C70 1 The contents of the Register window can be modified for debugging Note that the Register window is dockable 98 STATUS INTCO 98 9 THROL 90H THROC 6EH 9FH THRAL 18 11H 12H z 13H T8E T1E PAS 6 6 87 Chapter 6 Menu Window Watch The Watch window displays the memory addresses and contents of the specified symbols defined in the data sections i e in the RAM space The contents of the registers can also be displayed by typing the symbol name or register name and then pressing the Enter key The memory address and contents of the specified symbol or register will be displayed to the right of the symbol Display the specified symbol that belongs to the or ROM space Address is displayed in hexadecimal format and data is displayed in decimal hexadecimal or binary format as shown in Fig 6 7 The symbol and their corresponding data will be saved by the HT IDE3000 and displayed the next time the Watch window is opened The symbols can be deleted from Watch wi
15. 8808 8806 1F40 CLR 40H 8 test c 18 a 8 8007 8887 1 1 CLR 8 0006 8808 GF61 HOU 1 test c 12 b 1 0005 80889 0062 NOU 42 1 8804 8800 1F43 CLR 43H 0003 9808 0202 MOU 8 2 2 test c 13 c 2 0002 0006 GOCH HOU 2 8081 8880 1FA5 CLR 45H 8 Fig 5 7 80 Chapter 5 Menu Debug Note To set the trace record fields by modifying the Trace Recoord Fields settings in the Debug option attribute page of Project Settings sub menu in the Options menu To view the trace record fields use Trace List command of the Window menu Clear the Trace Buffer The trace buffer can be cleared by issuing the Reset Trace command Hereafter the trace information will be saved from the beginning of the trace buffer Note that both the Reset command and the Power On Reset command also clear the trace buffer 81 Chapter 6 Menu Window Chapter6 Menu Window The HT IDE3000 provides various kinds of windows which assist the user to emulate or simulate application programs These windows as shown in Fig 6 1 include program Data Memory RAM program code memory ROM Trace List Register Watch Stack Program Output etc M HT IDE3000 DAProject HTAGRB7O Test Test Test asm File Edit Project Build Debug Options Help Cele SGH 8 00170 Spit s ID Project Test d Cle mo
16. name EQU expression e Description The EQU directive creates absolute symbols aliases or text symbols by assigning an expression to name An absolute symbol is a name standing for a 16 bit value an alias is a name representing another symbol a text symbol is a name for another combination of characters The name must be unique i e not having been defined previously The expression can be an integer a string constant an instruction mnemonic a constant expression or an address expression e Example EQU 5 bmove EQU mov 104 Chapter 7 Assembly Language and Cross Assembler In this example the variable accreg is equal to 5 and bmove is equal to the instruction mov Macro Directives Macro directives enable a block of source statements to be named and then that name to be re used in the source file to represent the statements During assembly the Cross Assembler automatically replaces each occurrence of the macro name with the statements in the macro definition A macro can be defined at any place in the source file as long as the definition precedes the first source line that calls this macro In the macro definition the macro to be defined may refer to other macros which have been previously defined The Cross Assembler supports a maximum of 7 nesting levels Syntax name MACRO dummy parameter statements ENDM The Cross Assembler supports a directive LOCAL for the macro definition Syntax na
17. 3 26 Editor Settings Format This command is used to set the foreground and background colours From the available options shown in Fig 3 27 Text Selection is used for the Edit menu Current line Breakpoint Line Trace Line and Stack Line are for the Debug menu and Error line is for Editor settings Format Editors Category Text Selection Current Line Error Line Breakpoint Line Trace Line Stack Line Selection Margin Keyword Comment Number String Chapter 3 Menu File Edit View Tools Option the Assembler output Fig 3 27 Editors This command is used to set the editor options such as tab size the Undo command count and some functions disable settings The Save Before Assemble option will save the file before assembly The automatic reload of extemally modified files will load the files automatically which have been modified externally The Disable Classview option will not display any information on the classview window The Disable Suggestions list is disable variable tip list The Disable Suggestions Tip is used to disable the function parameters tip Editor settings Format Editors Tab options Tab size O Insert spaces Keep tabs Auto Indent Save option Save before running tools Automatic reload of externally modified files Disable Classview Disable Suggestions List Disable Suggestions Tip ARH Fig 3 28 Languag
18. 5 seconds There are 3 step commands namely Step Into Step Over and Step Out e The Step Into command executes exactly one instruction at a time however it will enter the procedure and stop at the first instruction of the procedure when it encounters a CALL procedure instruction e The Step Over command executes exactly one instruction at a time however upon encountering a CALL procedure will stop at the next instruction after the CALL instruction instead of entering the procedure instructions of this procedure will have been executed and the register contents and status may have changed The Step Out command is only used when inside a procedure It executes all instructions between the current point and the RET instruction including RET and stops at the next instruction after the CALL instruction e To start Step Into Choose the Step Into command from the Debug menu or press the hot key F8 or press the Step Into button on the toolbar e To start Step Over Choose the Step Over command of the Debug menu or press the hot key F10 or press the Step Over button on the toolbar 67 Chapter 5 Menu Debug e To start Step Out Choose the Step Out command of the Debug menu or press the hot key Shift F7 or press the Step Out button on the toolbar Note The Step Out command should only be used when the current pointer is within a procedure or otherwise unpredictable results may happen If entering the automatic mode f
19. Country City Purchase Date 2013 1 31 Fig 3 31 Fill out the register information The e Mail field is required the others are optional fields After filling out the fields click on the Register button and you will receive an e mail in your mailbox after a short time The message header is e Writer Pro Registry Key Fill in the Registration Code field and click on the Active button The following message will be displayed which represent a successful register process HT IDE3000 activated successfully Fig 3 32 45 Chapter 3 Menu File Edit View Tools Option Bookmarks The Bookmark window is a useful companion tool for the Code Editor Lines in the user code can be marked with bookmarks This enables the user to open files and navigate directly to the lines marked simply by double clicking entries in the Bookmark window Bookmarks Window The Bookmark window can be selected from the Window menu Bookmarks Bookmarks File location number MO untitled C Documents and Settings holtek Desk 26 lt 88 Fig3 33 Bookmarks Displays the name of the bookmark Default names are created as Untitled Custom bookmark names can be created by double clicking on the bookmark name entry Each bookmark has its own check box To activate an existing bookmark select its check box in the Bookmarks window To hide but not remove an existing bookmark clear its check box in the Bookmarks wi
20. Read and Write check box are used for the executing conditions of the breakpoint 70 Chapter 5 Menu Debug Breakpoints The Breakpoints list box contains all the breakpoints that have been added including the effective breakpoints and non effective breakpoints The Add button should be used to add new breakpoints to the list box and the Delete button is to remove breakpoints from the list box Event Only the e Link supports events When the checked events occur the e Link will stop Note The breakpoint in data space is only available for ICE but e ICE Format of Description Items Location The allowed formats of Location items are Absolute address in code space or data space with 4 format types namely decimal hexadecimal suffix with or h or prefix with Ox binary and don t care bits For example 20 14h 0x14 00010100b 10 0011 represents decimal 20 hexadecimal 14h 0x14 binary 00010100b and don t care bits 4 and 5 respectively Note Don t care bits must be in binary format Format of Description Items Content The content format has five digital number options similar to the format of Location These four types of number are decimal hexadecimal suffix with or h binary and don t care bits How to Set Breakpoints There are four methods to set enable a breakpoint one is by using the Breakpoint command from the Debug menu the other
21. The directive NOLISTINCLUDE suppresses the addition of included files The default is NOLISTINCLUDE 99 Chapter 7 Assembly Language and Cross Assembler Syntax MESSAGE Text string Description The directive MESSAGE directs the Cross Assembler to display the text string on the screen The characters in the exft string must be enclosed by a pair of single quotation marks Syntax ERRMESSAGE error string Description The directive ERRMESSAGE directs the Cross Assembler to issue an error The characters in the error string must be enclosed by a pair of single quotation marks Program Directives Syntax comment text e Description A comment consists of characters preceded by a semicolon and terminated by an embedded carriage return line feed Syntax name SECTION align combine class e Description The SECTION directive marks the beginning of a program section A program section is a collection of instructions and or data whose addresses are relative to the section beginning with the name which defines that section The name of a section can be unique or be the same as the name given to other sections in the program Sections with the same complete names are treated as the same section The optional align type defines the alignment of the given section It can be one of the following BYTE uses any byte address the default align type WORD uses any word address PARA uses a paragraph addr
22. Trace command from the Debug Menu A Trace dialog box is displayed as in Fig 5 4 e Press the Qualify radio button e Press the Set Qualify button A Set Qualify dialog box is displayed as in Fig 5 5 e Enter the qualifier information e Press the OK button to close the Set Qualify dialog box e Press the Add button to add the qualifiers into the Qualify list box below e Press the OK button to close the Trace dialog box Delete a Trace Qualify Condition e Choose the Trace command from the Debug Menu A Trace dialog box is displayed as in Fig 5 4 e Choose the qualify line to be deleted from the Qualify list box e Press the Delete button e Press the OK button to confirm Delete All Qualify Conditions e Choose the Trace command from the Debug Menu A Trace dialog box is displayed as in Fig 5 4 e Press the Clear All button e Press the OK button to confirm Note If there is no qualifier all instructions are qualified by default 78 Chapter 5 Menu Debug Enable Disable a Trace Qualify Condition Choose the Trace command from the Debug Menu A Trace dialog box is displayed as in Fig 5 4 e Choose the disabled enabled qualifier line to be enabled disabled from the Qualify list box e Press the Enable disable button e Press the OK button to confirm Note At most 6 trace qualifications can be enabled at the same time The e ICE is limited to the Normal Mode the trace range is for the whole applicati
23. by step guide for relevant simulation of voice synthesis and tone generator applications as well as the tools for real time hardware LCD panel simulation This part contains all the information needed to program and debug relevant applications quickly and efficiently 125 126 Part lll Utilities Chapter 9 Library Manager Chapterg Library Manager What the Library Manager Does The Library Manager provides functions to process the library files The library files are utilized in the creation of the output file by the Cross Linker Alibrary is a collection of one or more object modules which are assembled or compiled and ready for linking It stores the modules that other programs may require for execution By using the Library Manager library files can be created Object files including common routines may be added to the library files Before creating these object files the names of all common routines must be made public by using the assembly directive PUBLIC refer to the chapter on Assembly Language and Cross Assembler The Cross Assembler generates the output object file OBJ while the Library Manager adds this object file into the specified library file When the Cross Linker has found unresolved names in a program during the linking process it will search the library files for these unresolved names and extracts a copy of the module containing that name If an unresolved name has been found in this library module th
24. development process the repeated modification and testing of source programs is an inevitable procedure The HT IDE3000 provides many tools not only to facilitate the debugging work but also to reduce the development time Included are functions such as single stepping symbolic breakpoints automatic single stepping trace trigger conditions etc After the application program has been successfully constructed refer to the chapter on Build a project s task files the first execution line of the source program is displayed and highlighted in the active window Fig 5 1 The HT IDE3000 is now ready to accept and execute the debug commands 124 HT IDE3OOD DAProjee TAGRETOWTesfiTest Test aem Ela Yew Ew Debug Iob Optom Hindov nayga include MTA6RB70 inc main section at org H ME PAT PAG Ph P87 6 PE PCT PD7 PET STLS STLA SETIOS gt option x M s D VPro ject WITA RE ao oject NTNORB7O Test Test TSK 100 g information Test Total error s 8 warning s Loading le ed Fig 5 1 63 Chapter 5 Menu Debug Reset the HT IDE3000 System There are 4 kinds of reset methods in the HT IDE3000 system Power on reset POR by plugging in the power adapter or pressing the reset button on the ICE e Reset from the target board e Softwar
25. have confirmed the Project Setting options Step 2 Build the Project e Click on Build menu and select the Build command e The system will assemble compile all source files in the project If there are errors the programs double click on the error message line and the system will prompt you to the position where the error has occurred f all the program files are error free the system will create a Task file and download it to the ICE for debug e These steps can be repeated until the program is fully debugged 13 Chapter 2 Quick Start Step 3 Programming the MCU Device Build the project to create the OTP file e Usethe general purpose writer e WriterPro together with the HOPE3000 to program the MCU devices Step 4 Transmit Code to the company e Click the Project menu and select the Option Table Viewer command Fig 2 1 will then be displayed after which click on the Print button to print the configuration options Send the COD file and the Option Approval Sheet to the company File Settings erichyx My Documents HTK_Project test test Browse Print Product Name MCU Name HT46CU25 File Name C DOCUMENTS AND SETTINGS ERICHYA MY DOCUMENTS HTK_PROJECT TESTY HT IDE Ver 07 71 Compiler Uer HGASM 828 Linker U8 4 CFG Ver 01 3 MASK File Checksum 6B34H Program Code Checksum MASK Checksum Program code checksum p
26. is known as the IDE while the operating software is known as the HT IDE3000 The software provides an extremely user friendly Windows based approach for program editing and debugging while the ICE and e ICE emulators and OCDS hardware provides full real time emulation with multi functional trace stepping and breakpoint functions With a complete set of interface cards for its full device range and regular software Service Pack updates the IDE development environment ensures that designers have the best tools to maximize efficiency in the design and release of their microcontroller applications IDE Development Environment The Integrated Development Environment otherwise known as the IDE is a high performance integrated development environment designed around the company s series of 8 bit MCU devices Incorporated within the system is the hardware and software tools necessary for rapid and easy development of applications based on the company range of 8 bit MCUs The key component within the IDE system is the ICE e ICE or OCDS Emulators and Debuggers capable of emulating the company 8 bit MCU in real time in addition to providing powerful debugging and trace features As for the software the HT IDE3000 provides a friendly workbench to ease the process of application program development by integrating all of the software tools such as editor Cross Assembler Cross Linker library and symbolic debugger into a user friendly Windows based 3
27. numbers respectively If all the fields of the Trace Record Fields the Trace Recoord Fields settings in the Debug option attribute page of Project Settings sub menu in the Options menu are selected the result is as shown in Fig 5 7 If No trigger mode is selected or the trigger point has not yet occurred the sequence number starts from 00001 and decreases 1 sequentially for the trace records Fig 5 6 Program count PC The program count of the instruction in this trace record Machine code CODE The machine code of this instruction Disassembled instruction INSTRUCTION The disassembled mnemonic instruction is disassembled using an HT IDE3000 utility e Execution data DAT The data content to be executed read write e Source file name with a line number FILE LINE The source file name and the line number of this instruction e Source file SOURCE The source line statement including symbols All the above fields are optional except the sequence number which is always displayed No PC CODE INSTRUCTION FILE LINE SOURCE 0019 8088 08 NOU test c 7 void nain 0018 6661 6084 HOU 8 8817 8882 2017 CALL 1 0016 8817 OFOG HOU test c 7 void main 8815 8818 808 HOU 4H A 8 0014 8019 2010 CALL 1D 0013 8810 0003 RET 8 test c 7 void main 0012 8810 OFOG HOU 8 0011 6618 808 MOV 8 0010 881 0003 RET 8 0009 8803 2806 JHP 6H 6
28. to enter a directory name Chapter 1 Overview Installation Select Destination Location Where should Holtek HT IDE3000 7 7 be installed A Setup will install Holtek HT IDE3000 V7 7 into the following folder To continue click Next If you would like to select a different folder click Browse C Program FilessHoltek MCU Development T oolssHT IDE 3000 7 At least 132 6 MB of free disk space is required Fig 1 7 Ready to Install Setup is now ready to begin installing Holtek HT IDE 3000 V7 7 on your computer Click Install to continue with the installation or click Back if you want to review or change any settings Destination location C Program FileskHoltek MCU Development ToolssHT IDE 30007 Fig 1 8 e Step4 Specify the path you want to install the HT IDE3000 to and click the Next button e Step5 SETUP will copy all files to the specified directory 9 Chapter 1 Overview Installation Installing Please wait while Setup installs Holtek HT IDE3000 V7 7 on your computer Extracting files C Program FilessHoltek MCU Development Tools HT IDE3000 7 32 Cancel Fig 1 9 10 Chapter 1 Overview Installation e Step6 If the process is successful the following dialogue box will be shown iB Setup Holtek HT IDE3000 V7 7 Completing the Holtek HT IDE3000 V7 7 Setup Wizard Setup has finis
29. 9 0600 E mov a bank extlab 36 000A OFOO mov offset extbl 37 0008 2800 E jmp extlab 38 000C 39 000C 1234 5678 dw 1234h 5678h Oabcdh Oef12h ABCD EF12 40 0010 end 0 Errors 116 Chapter 8 Cross Linker Chapters Cross Linker What the Cross Linker Does The Cross Linker creates task files from the object files generated by the Cross Assembler or the C compiler The Cross Linker combines both code and data in the object files and searches the named libraries to resolve external references to routines and variables It also locates the code and data sections at the specified memory address or at the default address if no explicit address is specified Finally the Cross Linker copies both the program codes and other information to the task file It is this task file that is loaded by the IDE Integrated Development Environment into the ICE In Circuit Emulator for debugging The libraries included by the Cross Linker were generated by the library manager Cross Linker Options The options specify and control the tasks performed by Cross Linker In chapter 3 Option Menu Project command provides a dialog box Cross Linker Options to specify these options to the Cross Linker These options are 117 Chapter 8 Cross Linker Project settings Project Option Debug Option Directories Document Production Micro Controller HIA6CUGTIHTAGRUS Language Tool Holtek Compiler V3 10 Assembler V Asse
30. DE macro def In this example the Cross Assembler inserts the source codes from the file macro def 98 Chapter 7 Assembly Language and Cross Assembler into the current source file Syntax PAGE size Description This directive specifies the number of the lines in a page of the program listing file The page size must be within the range from 10 to 255 the default page size is 60 e Example PAGE 57 This example sets the maximum page size of the listing file to 57 lines Syntax LIST NOLIST Description The directives LIST and NOLIST decide whether or not the source program lines are to be copied to the program listing NOLIST suppresses copying of subsequent source lines to the program listing file LIST restores the copying of subsequent Source lines to the program listing file The default is LIST e Example NOLIST mov a 1 mov b1 a In this example the two instructions the block enclosed by NOLIST and LIST are suppressed from copying to the source listing file Syntax LISTMACRO NOLISTMACRO Description The directive LISTMACRO causes the Cross Assembler to list all the source statements including comments in a macro The directive NOLISTMACRO suppresses the listing of all macro expansions The default is NOLISTMACRO Syntax LISTINCLUDE NOLISTINCLUDE Description The directive LISTINCLUDE inserts the contents of all included files into the program listing
31. ELSE Statements ENDIF Syntax IF expression IFE expression 97 Chapter 7 Assembly Language and Cross Assembler e Description The directives IF and IFE test the expression following them The IF directive grants assembly if the value of the expression is true i e non zero The IFE directive grants assembly if the value of the expression is false i e zero e Example IF debugcase ACC1 equ 5 extern username byte ENDIF In this example the value of the variable ACC1 is set to 5 and the username is declared as an external variable if the symbol debugcase is evaluated as true i e nonzero Syntax IFDEF name IFNDEF name Description The directives IFDEF and IFNDEF test whether or not the given name has been defined The IFDEF directive grants assembly only if the name is a label a variable or a symbol The IFNDEF directive grants assembly only if the name has not yet been defined The conditional assembly directives support a nesting structure with a maximum nesting level of 7 e Example IFDEF buf flag buffer DB 20 dup ENDIF In this example the buffer is allocated only if the buf flag has been previously defined File Control Directives Syntax INCLUDE file name or INCLUDE file name e Description This directive inserts source codes from the source file given by file name into the current source file during assembly Cross Assembler supports at most 7 nesting levels e Example INCLU
32. GH operator Syntax LOW expression MID expression HIGH expression The LOW MID HIGH operator returns the value of an expression if the result of the expression is an immediate value The LOW MID HIGH operators will then take the low middle high byte of this value But if the expression is a label the LOW MID HIGH operator will take the values of the low middle high byte of the program count of this label For example cs section at 456H code 1 Then mov 9840H mov a 40H mov a mid 9840H 84 mov a high 9840H mov a 98H mov lab1 mov a 56H mov a mid lab1 a 45H mov a high lab1 mov a 4H e BANK operator Syntax BANK name The BANK operator returns the bank number allocated to the section of the name declared If the name is a label then it returns the rom bank number If the name is a data variable then it returns the ram bank number The format of the bank number is the same as the BP defined For more information of the format please refer to the data sheets of the corresponding MCUs Note The format of the BP might be 109 Chapter 7 Assembly Language and Cross Assembler different between MCUs Example 1 mov A BANK start mov BP A start Example 2 A BANK var mov BP A A OFFSET var mov MP1 A mov A R1 e Operator precedence Precedence Operators 1 Highest 2 LOW MID HIGH OFFSET BANK 3 7 96 SH
33. HT IDE3000 User s Guide February 2014 Copyright 2013 by the company 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 the company The information appearing in this Users Guide is believed to be accurate at the time of publication However the company assumes no responsibility arising from the use of the specifications described The applications mentioned herein are used solely for the purpose of illustration and the company 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 the company s products are not authorized for use as critical components in life support Conte nts devices or systems the company reserves the right to alter its products without prior notification Contents Contents Peel T 1 3 IDE Development 3 In Circuit Emulator ICE e ICE and e Link ICE Interface Gardiano oie ete eger System Configuration 6 Installation ure etr eet eR ERE ERU ERR 7 System
34. L SHR 4 binary 5 gt greater than gt greater than or equal to less than less than or equal to equal to equal to bitwise NOT amp bitwise AND Lowest bitwise OR bitwise XOR ONO Miscellaneous Forward References The Cross Assembler allows reference to labels variable names and other symbols before they are declared in the source code forward named references But symbols to the right of EQU are not allowed to be forward referenced Local Labels A local label is a label with a fixed form such as number The number can be 0 29 The function of a local label is the same as a label except that the local label can be used repeatedly The local label should be used between any two consecutive labels and the same local label name may used between other two consecutive labels The Cross Assembler will transfer every local label into a unique label before assembling the source file At most 30 local labels can be defined between two consecutive labels Example Label label 110 Chapter 7 Assembly Language and Cross Assembler 1 local label mov a 1 jmp 3 2 local label mov a 2 jmp 1 3 local label jmp 2 Label2 labe Jmp 1 0 local label jmp Label1 1 jmp 0 Label3 111 Reserved Assembly Language Words Chapter 7 Assembly Language and Cross Assembler The following tables list all reserved words used by the assembly lang
35. Macro expansion nesting level Summary of Assembly The total warning number and total error number is the information provided at the end of the Cross Assembler listing file Miscellaneous If any errors occur during assembly each error message and error number will appear directly below the statement where the error occurred 115 Chapter 7 Assembly Language and Cross Assembler Example of Assembly Listing File File SAMPLE ASM Holtek Cross Assembler Version 2 86 Page 1 1 0000 page 60 2 0000 message Sample Program 1 3 0000 4 0000 listinclude 5 0000 listmacro 6 0000 7 0000 include sample inc 1 0000 C pa equ 12h 2 0000 C pac equ 13h 0000 C pb equ 14h 4 0000 pbc equ 15h 5 0000 pe equ 16h 6 0000 C pcc equ 17h 7 0000 8 0000 9 0000 extern extlab near 10 0000 extern extbl byte 11 0000 12 0000 clrpb macro 13 0000 clr pb 14 0000 endm 15 0000 16 0000 clrpa macro 17 0000 mov a 00h 18 0000 mov pa 8 19 0000 clrpb 20 0000 endm 21 0000 22 0000 data section data 23 0000 00 bl db 24 0001 00 b2 db 25 0002 00 bitl 26 0003 27 0000 code section 28 0000 OF55 mov a 055h 29 0001 0080 mov bl a 30 0002 0080 E mov extbl a 31 0003 mov Oaah 32 0004 0093 33 0005 1 33 0005 1 mov a 008 33 0006 0092 1 mov 12h a 33 0007 1 clrpb 33 0007 1 14 2 clr 14h 34 0008 0700 R mov a bl 35 000
36. The syntax to be converted is listed below 1 Absolute Variable A variable is designated to the fixed address for example char a 30x80 2 Built in Function For example clrwat 3 Flag Bit For example 80 1 4 Delay Function The built in function delay 5 Interrupt Interrupt function 6 Inline Assembly Embedded assembly language for example endasm 7 Bit Variable For example bit a Program Location Manager The position of each module in the memory can be setup by the user see Fig 3 10 27 Chapter 3 Menu File Edit View Tools Option Fe Start Address End Address Fig 3 10 1 Type Types of module These can be C ASM OBJ or LIB 2 Set Select modules in listbox use the Shift key or Ctrl key to select more than one module and then click the Set button This will generate the following dialog _ File C Program Files Holtek MCU Development Tools HT It size 7ffH Start Addr Fig 3 11 Finally enter the start address and end address Tip Removing the start address and the end address can reset the module settings 3 Reset Clear all settings Additionally this can be setup from the workspace 28 Chapter 3 Menu File Edit View Tools Option View Project Build Debug Tools Options Window Help char Project settings Open Project Add Files to Project Close Project Clone Project Rename Project F2 Delete Proje
37. a project with each user application described by a unique project When developing an HT IDE3000 application for the first time the development steps as described earlier are recommended HT IDE3000 C Documents and Settings erichyx fi Fan TestCode20130114 FanTestCode ADDA_DC_FAN Build Debug Tools Options Window Help CAPTURE CLOCK Save to Project dc fan prj Close Option Table Viewer Backup Restore Project Recent Projects f cav CA Work Output Find in Files Wetchl Wetch2 Watch Avto Local Ini Coli Emulsion PC 0001H Fig 4 1 51 Chapter 4 Menu Project Create a New Project Assemble Build Rebuild All In the Project menu Fig 4 1 select the New command to create a new project This command will call the CodeWizard to assist users to create a new project Note The project name is a file name with the extension PJT and PJTX CodeWizard flowchart Project Location Project Option Project Deployment Configuration Options Project Settings Finish Fig 4 2 Step1 Project Location This step will require the user to input a project name and a file path see Fig 4 3 Users can access all of the data and already existing projects to select an already existing project or can in
38. able easy access by other statements A name consists of the following characters A Z a z 0 9 Q with the following restrictions e 0 9 cannot be the first character of a name 96 Chapter 7 Assembly Language and Cross Assembler e cannot stand alone as a name e Only the first 31 characters are recognized Operation The operation defines the statement action of which two types exist directives and instructions Directives give directions to the Cross Assembler specifying the manner in which the Cross Assembler is to generate the object code at assembly time Instructions on the other hand give directions to the processor They are translated to object code at assembly time the object code in turn controls the behavior of the processor at run time Operand Operands define the data used by directives and instructions They can be made up of symbols constants expressions and registers Comment Comments are the descriptions of codes They are used for documentation only and are ignored by the Cross Assembler Any text following a semicolon is considered a comment Assembly Directives Directives give direction to the Cross Assembler specifying the manner in which the Cross Assembler generates object code at assembly time Directives can be further classified according to their behavior as described below Conditional Assembly Directives The conditional block has the following form IF Statements
39. al Studio Net 2005 is as the default e Restore Default LayOut Restore the default layout this command will restart the program automatically e Toolbar Display the toolbar information on the window The toolbar contains some groups of buttons whose function is the same as that of the command in each corresponding menu item When the mouse cursor is placed on a toolbar button the corresponding function name will be displayed next to the button If the mouse is clicked the 21 Chapter 3 Menu File Edit View Tools Option command will be executed Refer to the corresponding chapter for the functionality of each button The Toggle Breakpoint button will set the line specified by the cursor as a breakpoint highlighted The toggle action of this button will clear the breakpoint function if previously set e Status Bar Displays the status bar information on the window e Display Line Numbers Toggle line numbering on and off in your code e Cycle Count Count instruction cycles accumulatively Press the reset button to clear the cycle count The Hex and Dec buttons are used to change the radix of the count hexadecimal or decimal The maximum cycle count is 65535 Note There is a slight difference of maximum cycle count between two kinds of ICE the maximum cycle count of e ICE can up to 4294967295 while ICE can only count to 65535 HT IDE3000 File Edit View Project Build Debug Tools Options Window Help Wind
40. call procedure step option namely Step Into or Step Over Only one option can be selected Stack Uncheck this Detect Stack Overflow box if you do not want the system to show a 37 Chapter 3 Menu File Edit View Tools Option message while detecting a stack overflow Connection Port Display the PC connection port for the ICE The connection port has no effect if the simulation mode is selected Directories Command The command sets the default search path and directories for saving files Fig 3 22 Project settings Project Option Debug Option Directories Document Production Output files path SUTTTTITENST Show directories for Include paths Directories C Program Files Holtek MCU Development Tools HT IDE3000V7 xNINCLUDE Fig 3 22 e Include paths The search path referred to by the Cross Assembler to search for the included files e Library paths The search path referred to by the Cross Linker to search for the library files e Output files path The directory for saving the output files of the Cross Assembler obj Ist and Cross Linker tsk map dbg Document This command is used to add documents to the project When documents are added they will be listed on the Documents window on the left hand side as shown in Fig 38 Chapter 3 Menu File Edit View Tools Option Project settings Project Option Debug Option Directories Document Production
41. cking on the button will cause the configuration dialog box to be displayed This is used to set the Complier options e Language Tool The company permits Third Parties to provide C compilers for the company s MCUs Here the Hi Tech language tool can be selected as an alternative choice Assembler Compiler Options The command line options of the Cross Assembler Define symbol allows users to define values for specified symbols used in assembly programs The syntax is as follows symbol1 value 1 symbol2 value2 For example debugflag 1 newver 3 The check box of the Generate listing file is used to check if the source program listing file has been generated e Linker options To specify the options of the Cross Linker Libraries are used to specify the library files refered by Cross Linker For example libfile1 libfile2 Library files can be selected by clicking the Browse button Section address is used to set the ROM RAM addresses of the specified sections for example codesec 100 datasec 40 The check box of the Generate map file is used to check if the map file of Cross Linker is generated Debug Command This command sets the options used by the Debug menu The dialog box Fig 3 21 lists all the debug options with check boxes By selecting the options and pressing the OK button the Debug menu can then obtain these options during the debugging process 36 Chapter 3 Menu File Edit View To
42. ct Set as Active Project Import Project Export Project Configuration Option CthO 1 Coll DISCONNECT Emulation PC XXXXH Fig 3 12 Editor e Voice ROM Editor The company provides a Editor for the user to arrange the voice code for the specific MCU eg The HT86 series 29 Chapter 3 Menu File Edit View Tools Option 19 Tool demo V IP Project Build Help New Open Save Down Project Project Project Build Exit load MCU Body HT56R26 Flash Size System Frequency 99 792 free 130800 1FEFOh bytes Source File Voice Data Encode Type WAY oong 3 13 Data Editor Some the company MCUs eg the HT48E series include internal EEPROM memory The Data EEPROM Editor provides an interface for the user to arrange the data and download upload the data to from the ICE 30 Chapter 3 Menu File Edit View Tools Option Data Editor 00000000 00000008 00000010 00000018 00000020 Upload 00000028 00000030 00000038 00000040 00000048 00000050 00000058 00000060 00000068 00000070 00000078 00000080 00000088 00000090 00000098 00000040 00000048 00000080 00000088 000000 0 00000068 Fig 3 14 Download Body HT83F10 File File Path C DOCUMENTS AND SETTINGS File Size 131074 Download with Verify Fig 3 15 31 Chapter 3 Menu File Edit View Tools Option LCD Simulator The LCD simula
43. d to the last one in the current file As required it opens the file where the selected bookmark occurs in the Editor Scrolls that document to the bookmarked line and places the insertion point there Move the indicator to the next bookmark in the current folder Selects the next bookmark that is enabled within the current file in the Bookmark window When the last bookmark is reached it jumps back to the first one in the current file As required it opens the file where the selected bookmark occurs in the Editor Scrolls that document to the bookmarked line and places the insertion point there Clear all bookmarks Clears all bookmarks in the Bookmarks window Does not alter the bookmarked line code Bookmark menu In addition to using the Bookmarks in the Toolbar the same operation can be executed using the Bookmarks Menu The menu can be found in the edit drop down menu 48 HOLTEK Chapter Menu File Edit View Tools Option Toggle Bookmark Previous Bookmark Shift F2 Next Bookmark F2 4E Previous Bookmark In Document 5 Next Bookmark In Document Clear Bookmarks Ctr Shift F2 Fig 3 35 49 Chapter 4 Menu Project Chapter4 Menu Project amp Build The HT IDE3000 provides an example Project which will assist first time users in quickly familiarizing themselves with project development It should be noted that from the standpoint of the HT IDE3000 system a working unit is
44. digits e The 2nd field offset is the offset from the beginning of the current section to the code 4 hexadecimal digits 114 Chapter 7 Assembly Language and Cross Assembler The 3rd field code is present only if the statement generates code or data two hexadecimal 4 digit data The code shows the numeric value in hexadecimal if the value is known at assembly time Otherwise a proper flag will indicate the action required to compute the value The following two flags may appear behind the code field R gt relocatable address Cross Linker must resolve gt external symbol Cross Linker must resolve The following flag may appear before the code field gt EQU or equal sign directive The following 2 flags may appear in the code field gt section address Cross Linker must resolve nn xx DUP expression nn DUP The 4th field statement is the source statement shown exactly as it appears in the source file or as expanded by a macro The following flags may appear before a statement gt Macro expansion nesting level line from INCLUDE file Summary 0 1 2 3 4 5 6 123456789012345678901234567890123456789012345678901234567890 0000 hhhh hhhh source program statement line number 4 digits right alignment 0000 offset of code 4 digits hhhh two 4 digits for opcode E gt external reference statement from included file relocatable name n gt
45. e This command changes the language of the user interface Default is the language of the operation system 42 Chapter 3 Menu File Edit View Tools Option Customise This command can rearrange and modify the toolbar buttons menu and menu commands Users can customise the toolbars according to their own preferences e Link Activation The e link must be registered when first used Click the About HT IDE3000 options in the Help menu and a dialog box will be displayed as shown About HT IDE3000_ Holtek Integrated Development Environment Version 7 71 OCDS ICE FA 04 Date 2013 01 28 Beta Update Firmware Copyright C 2005 2012 Holtek Semiconductor Inc Register e Link Additional Information Voice Template Version 0 1c Build Date 2010 11712 Holtek Website httpvAvww holtek com tw Address MCU Tool Development Dept No 3 Creation 1 Science based Industrial Park Hsinchu Taiwan R O C Fig 3 29 Click on the Register e Link button and a dialog box will be displayed as follows 43 Chapter 3 Menu File Edit View Tools Option e Link Activation Activate Fig 3 30 Chapter 3 Menu File Edit View Tools Option Click on the Register Now button a dialog box will be displayed as follows Registration Sheet Writer Holtek 8 Bits MCU OCDS Writer ID 0012 0009 7303 L L 3237 7810 e Mail First name Last Name Company
46. e ERG RE ee ani Generate Map File dein ge tdem dde Linker Options ori re roc ces OP Cross Linker Task File and Debug File c e Chapter9 What the Library Manager Does Setup the Library Files 127 Create New Library 128 Add a Program Module into a Library File 129 Delete a Program Module from a Library 129 Extract a Program Module from Library and Create An Object File 130 Object Module Information 130 lv Conte nts AppendixA Reserved Assembly Language Words 133 Instt ction Sets ete bt RN 135 Part Integrated Development Environment Partl Integrated Development Environment Part Integrated Development Environment Chapter 1 Overview and Installation Chapter1 Overview and Installation To ease the process of application development the importance and availability of supporting tools for microcontrollers cannot be underestimated To support its range of MCUS the company is fully committed to the development and release of easy to use and fully functional tools for its full range of devices The overall development environment
47. e digits are displayed in hexadecimal format The Address field can input an address for direct location and the Column filed is used to specify the number of columns 84 Address Colunn 8 v ADDFO 1 2 3 4 5 6 7 40 00 50 Gao Ga 58 Ge Ga 60 68 70 Ge m 78 Ge Chapter 6 Menu Window gt RAM ROM Fig 6 3 The ROM window displays the contents of the program code memory space as shown in Fig 6 4 The ROM address range is from 0 to last address where the last address depends upon the MCU selected in the project The horizontal and vertical scrollbars can be used to view any address in the ROM window The contents in ROM window are displayed in hexadecimal format and cannot be modified ROM lt Address ADDR 0000 0010 0020 0030 0040 0050 0060 0070 80 0090 0040 0080 00 0 00 0 1 2 3 4 5
48. e file defining a byte that is named tmpbuf and is declared as a public variable Syntax name PROC 102 Chapter 7 Assembly Language and Cross Assembler name ENDP Description The PROC and ENDP directives mark a block of code which can be called or jumped to from other modules The PROC creates a label name which stands for the address of the first instruction of a procedure The Cross Assembler will set the value of the label to the current value of the location counter e Example toggle PROC mov tmpbuf a mov a 1 xorm a flag mov a tmpbuf ret toggle ENDP Syntax DC expression expression2 e Description The DC directive stores the value of expression2 etc in consecutive memory locations This directive is used for the CODE section only The bit size of the result value is dependent on the ROM size of the MCU The Cross Assembler will clear any redundant bits expression has to be a value or a label This directive may also be employed to setup the table in the code section e Example table DC 0128H 025CH In this example the Cross Assembler reserves two units of ROM space and also stores 0128H and 025CH into these two ROM units Data Definition Directives An assembly language program consists of one or more statements and comments A statement or comment is a composition of characters numbers and names The assembly language supports integer numbers An integer n
49. e first executable line of the source program will be displayed and highlighted on the active window Fig 5 1 At this point emulation of the 65 Chapter 5 Menu Debug application program can begin by using the HT IDE3000 debug commands Note During emulation of an application program the corresponding project has to be open To Emulate the Application Program Choose the Go command from the Debug menu or press the hot key F5 or press the Go button on the toolbar Other windows can be activated during emulation The HT IDE3000 system will automatically stop the emulation if a break condition is met Otherwise it will continue emulating until the end of the application program The Stop button on the toolbar is illuminated with a red color while the ICE is in emulation Pressing this button will stop the emulation process To Stop Emulating the Application Program There are three methods to stop the emulation shown as follows Set the breakpoints before starting the emulation Choose the Stop command of the Debug menu or press the hot key Alt F5 e Press the Stop button on the toolbar To Run the Application Program to a Line The emulation may be stopped at a specified line when debugging a program The following methods provide this function All instructions between the current point and the specified line will be executed except the conditional skips Note however that the program may not stop at the specifi
50. e module will be linked to the program To Setup the Library Files The Library Manager provides the following functions e Create new library files Add Delete a program module to from a library file 127 Chapter 9 Library Manager e Extract a program module from a library file and create an object file To select use the Tools Menu and the Library Manager command as shown in Fig 9 1 Fig 9 2 shows the dialogue box for processing the functions of the Library Manager Btk HT IDE3000 Configuration Options Diagnose Editor LCD Simulator Virtual Pe lnl Coll Emulation PC 0001H Fig 9 1 Library Manager Library Name C Program Files Holtek MCU Development Tools HT IDE3000 7 1 LIB Ynath6 lib Object in Library Object in Directory Directories Maximum ROM Size 0 words Minimum ROM Size 0 words Maximum RAM Size 1 words Minimum RAM Size 1 words Public RH in module d_rh obj d_t10 0bj Maximum ROM Size 0 words Minimum ROM Size 0 words Maximum RAM Size 1 words Minimum RAM Size 1 words Public Name T10 in module d t10 ohj d t11 0bj Maximum ROM Size 0 words Minimum ROM Size 0 words Maximum RAM Size 1 words Minimum RAM Size 1 words Public Name T11 in module d t11 obj Documents and Settings Downloads HTLIB Inetpub Keil Create a New Library File Press Open button Fig 9 3 is d
51. e reset command in the HT IDE3000 Debug menu Fig 5 2 e Software power on reset command in the HT IDE3000 Debug menu Fig 5 2 Ele Edit Yiew Project Build Osi 22 2 include HTA6RB78 in 2 E 4 5 8 0630 2819 0000 000 0000 0000 0000 0004 000 0004 0000 0000 0008 0063 0006 0000 0000 0003 2959 0000 0000 0000 0000 0000 0000 0000 0000 0000 006 96n 0006 0800 8000 0008 0000 0000 0000 0800 0000 006 Sep Ino 0000 0000 0000 0000 0000 0000 0000 0000 0000 Step Over 0000 0000 0000 0000 0000 0000 0000 0000 0008 dieu uo 0000 0000 0000 0000 0000 0000 0000 0000 006 2989 due 0080 0800 8008 0008 0000 0080 0800 0800 8008 006 Stepping 0000 0000 0000 0000 0000 0000 0000 0000 0000 00G 0880 0800 8008 0008 0080 0800 8008 006 oen 0000 0000 0000 0000 0000 0000 0000 0000 0000 006 orn J Power on Reset 0000 0000 0080 0000 0000 0000 0000 0000 198 Reset 8008 0000 8860 9888 0080 0008 0000 0000 00G uuu 8000 0008 8000 8000 0000 0000 0000 600 uo Breakpoints E 13H Insert Remove Breakpoint r Removes All Breakpoints Ctrl Shift F9 u s n via 4 5 6 7 8 9 ABCD EF PATH Trace uu 00 80 08 66 00 00 00 20 00 00 18H Command y
52. e same complete name to form a single contiguous section The c ass type defines the sections that are to be loaded in the contiguous memory Sections with the same class name are loaded into the memory one after another The class name CODE is used for sections stored in ROM and the class name DATA is used for sections stored in RAM The complete name of a section consists of a section name and a class name The named section includes all codes and data below after it until the next section is defined Syntax ROMBANK banknum section name section name Description This directive declares which sections are allocated to the specified ROM bank The banknum specifies the ROM bank ranging from 0 to the maximum bank number of the destination MCU The is the name of the section defined previously in the program More than one section can be declared in a bank as long as the total size of the sections does not exceed the bank size of 8K words If this directive is not declared bank 0 is assumed and all CODE sections defined in this program will be in bank 0 If a CODE section is not declared in any ROM bank then bank 0 is assumed Syntax RAMBANK banknum section name Description This directive is similar to ROMBANK except that it specifies the RAM bank the size of RAM bank is 256 bytes Syntax END Description 101 Chapter 7 Assembly Language and Cross Assembler Th
53. ecting the target board to the ICE box e Power Adapter output 16V 25 pin D type printer cable e Integrated MCU writer e ICE e The e ICE basically consists of two boards a mother board known as the MEV and into which is plugged a device daughter board known as the DEV 5 pin USB cable e Link e Link device e 2x6 double row male headers Flat Cable pin connector 2x6 female headers 25cm e FPC06A e USB cable e Important note card e Software CD Chapter 1 Overview and Installation Installation Caution System Requirement The hardware and software requirements for installing HT IDE3000 system are as follows PC AT compatible machine with Pentium or higher CPU e SVGA color monitor Atleast 256M RAM for best performance CD ROM drive for CD installation e Atleast 200M free disk space e Parallel or USB port to connect and ICE Windows XP Vista 7 Windows XP Vista 7 are trademarks of Microsoft Corporation Hardware Installation The company provides three kinds of ICE for the user to choose as follows ICE e Step 1 Plug the power adapter into the power connector of the ICE Step 2 Connect the target board to the ICE by using the I O interface card or flat cable Step 3 Connect the ICE to the host machine using the printer cable The LED on the ICE should now be lit if not there is an error and your dealer should be contacted Exercise care when using t
54. ed line due to conditional jumps or other situations e Move the cursor to the stopped line or highlight this line Choose the Go to Cursor command of the Debug menu or press the hot key F7 or press the Go to Cursor button on the toolbar To Directly Jump to a Line of an Application Program It is possible to jump directly to a line if the result of executed instructions between the current point and the specified line are not important This command will not change the contents of Data Memory registers and status except for the Program Counter The specified line is the next line to be executed 66 Chapter 5 Menu Debug Move the cursor to the appropriate line or highlight this line e Choose Jump to Cursor command of the Debug menu Single Step The execution results of some instructions in the above section may be viewed and checked It is also possible to view the execution results one instruction at a time i e in a step by step manner The HT IDE3000 provides two step modes namely manual mode and automatic mode In the manual mode the HT IDE3000 executes exactly one step command each time the single step command is executed the automatic mode the HT IDE3000 executes single step commands continuously until the emulation stop command is issued using the Stop command of the Debug menu In the automatic mode all user specified breakpoints are discarded and the step rate can be set from FAST 0 5 1 2 3 4 to
55. ess PAGE uses a page address For the CODE section the byte address is in a single instruction unit BYTE aligns the section at any instruction address WORD aligns the section at any even instruction address PARA aligns the section at any instruction address which is a multiple of 16 and PAGE aligns the section at any instruction address with a multiple of 256 For DATA sections the byte address is in one byte units 8 bits byte BYTE aligns the section at any byte address WORD aligns the section at any even address PARA aligns the section at any address which is a multiple of 16 and PAGE aligns the 100 Chapter 7 Assembly Language and Cross Assembler section at any address which is a multiple of 256 The optional combine type defines the way of combining sections having the same complete name section and class name It can be any one of the following COMMON Creates overlapping sections by placing the start of all sections with the same complete name at the same address The length of the resulting area is the length of the longest section AT address Causes all label and variable addresses defined in a section to be relative to the given address The address can be any valid expression except a forward reference It is an absolute address in a specified ROM RAM bank and must be within the ROM RAM range If no combine type is given the section is combinative i e this section can be concatenated with all sections having th
56. ettings Outlook Express EverPro K1000 Search 2 Remote Assistance Hi Tech C MCU Converter HT IDE3000 HT IDE3000 User s quide a Library Manager amp Option viewer Help and Support Run Log Off holtek GS Windows XP Professional Turn OFF Computer Fig 3 1 Click the Start Button select Programs and select HT IDE3000 Click the HT IDE3000 icon 17 Chapter 3 Menu File Edit View Tools Option e Fig 3 2 will be displayed if the following conditions occur connection between the ICE and the host machine or connection fails ThelCE is powered off HT IDE3000 A Unable to connect to Holtek ICE Fig 3 2 If Retry is selected and the connection between the ICE and the host machine has been made then Fig 3 3 will be displayed the HT IDE3000 will enter the emulation mode and the ICE begins to function HT IDE3000 A HT ICE is connected to Holtek ICE Fig 3 3 The HT IDE3000 software includes File Edit View Project Build Debug Tools Options Window and Help menus The following sections describe the functions and commands of each menu A dockable toolbar below the menu bar Fig 3 4 contains icons that correspond to and assist the user with more convenient execution of frequently used menu commands When the cursor is placed on a toolbar icon the corresponding command name will be displayed alongside Clickin
57. fter it has been added ToDelete a Breakpoint Choose the Breakpoint command from the Debug menu or press the hot key Ctrl B A breakpoint dialog box is displayed Fig 5 3 Choose or highlight the breakpoint to be deleted from the Breakpoints list box e Press the Delete button to delete this breakpoint from the Breakpoints list box e Press the OK button to confirm Delete all Breakpoints Choose the Breakpoint command from the Debug menu or press the hot key Ctrl B A breakpoint dialog box is displayed Fig 5 3 e Choose the Clear All button to delete all breakpoints from the Breakpoints list box e Press the OK button to confirm e You can also click the Clear All Breakpoint button on the toolbar to accomplish this 72 Chapter 5 Menu Debug gt task To Enable Disable a Breakpoint Choose the Breakpoint command from the Debug menu or press the hot key Ctrl B A breakpoint dialog box is displayed Fig 5 3 e Choose the disabled enabled breakpoint from the Breakpoints list box e Press the Enable Disable button to enable or disable this breakpoint e Press the OK button to confirm Trace the Application Program Note Note The HT IDE3000 provides a powerful trace mechanism which records the execution processes and all relative information when the HT IDE3000 is emulating the application program The trace mechanism provides qualifiers to filter specified instructions and trigger conditions in o
58. g of the application program can begin refer to the HT IDE3000 menu Debug chapter Assemble Compile To verify the integrity of application programs this command can be used to assemble or compile the source code and display the result message in the Output window To Assemble or Compile a Program Use the File menu to open the source program file to be assembled or compiled e Either select the Assemble Compile command of the Build menu or click the Assemble button on the toolbar to assemble compile this program file If the opened file has an asm file extension name the Cross Assembler will execute the assembly process If the file has C extension then the compiler will compile the program If no errors are detected an object file with extension OBJ is generated and stored in the directory which is specified in the Output Files Path refer to Options menu Directories command an error occurs a corresponding message displayed on the Output window one of the following commands can be used to move the cursor to the error line Double click the left button of the mouse or e Select the error message line on the Output window and press the Enter key 58 Chapter 4 Menu Project Print Option Table Command This command is used to view and check the files otp mtp pnd cod in the project Fig 4 8 The Browse button is used to open the files The Print button is used to print the current active o
59. g on the icon will cause the command to be executed A Status Bar in the bottom line Fig 3 4 displays the emulation or simulation present status and the resulting command status In the status bar the field PC 0001H displays the Program Counter while in debugging process Debug menu 18 Chapter 3 Menu File Edit View Tools Option File Edit View Project Build Debug Tools Options Window Help D sng 85 S e e 226 E Workspace Ready Lni Coll Emulation PC 0001H OVR NUM Fig 3 4 The Status Bar contains information that may be useful during program debug The Program Counter is used during program execution and indicates the actual present Program Counter value while the row and column indicators are used to show the present cursor position when using the program editor File Menu The File menu provides file processing commands the details behind which are shown the following list along with the corresponding toolbar icons New Create a new file Open Open an existing file e Close 19 Chapter 3 Menu File Edit View Tools Option Edit Menu Close the current active file Save Write the active windows data to the active file SaveAs Write the active windows data to the specified file Save All Write all windows data to the corresponding opened files Print Print active data to the
60. he power adapter Do not use a power adapter whose output voltage is not 16V otherwise the ICE may be damaged It is strongly recommended that only the power adapter supplied by the company be used First plug the power adapter to the power connector of the ICE e ICE Step 1 Install the correct DEV board for the MCU to be emulated Step 2 Chapter 1 Overview and Installation Use the USB cable to connect the e ICE to the PC The LED on the ICE should now be lit if not there is an error and your dealer should be contacted e Link e Step 1 Connect the EV board to the e Link using the flat cable e Step 2 Use the USB cable to connect the e Link to the PC The LED on the e Link should now be lit if not it must be reconnected or contact your agent Caution HT IDE3000 software version must be 7 6 or above when using the e Link to debug Software Installation e Step 1 First click the HT IDE3000 install icon to start the HT IDE3000 installation Step 2 Press the lt Next gt button to continue setup or press lt Cancel gt button to abort Setup Holtek HT IDE3000 V7 7 TER Welcome to the Holtek HT IDE3000 V7 7 Setup Wizard This will install Holtek HT IDE3000 V7 7 on your computer It is recommended that you close all other applications before continuing Click Next to continue or Cancel to exit Setup Fig 1 6 Step3 The following dialogue will be shown to ask the user
61. hed installing Holtek HT IDE 3000 V7 7 on your computer The application may be launched by selecting the installed icons If this is the first installation of HT IDE3000 please restart your computer Fig 1 10 Step 7 Press the lt OK gt button and then press the lt Finish gt button to finish the setup If this is the first installation of HT IDE3000 please restart the computer system Driver digital signature During the setup note that the driver digitial signature is a protection mechanism for Win driver installation If a problem should occur the solution is as follows Restart the computer then press the F8 key select Disable Driver Signature Enforcement to enter the system and then setup the HT IDE3000 In addition if the ICE can not be connected it also needs to select Disable Driver Signature Enforcement to enter the system 11 Chapter 1 Overview Installation Chapter 2 Quick Start Chapter2 Quick Start This chapter gives a brief description of using HT IDE3000 to develop an application project Step 1 Create a New Project with the CodeWizard e Click on the Project menu and select New command e Enter a project name and select an MCU from the combo box e Choose the file type from either ASM or C e Click on the Next button and the system will ask you to setup the configuration options e Setup all configuration options and click on the OK button e Finally click OK when you
62. hen the Cross Assembler or C compiler is called to assemble compile this source file and to generate a new object file e f one of the tasks object files has a later creation date time than that of the task file then the Cross Linker is called to link all object files of this task and to generate a new task file The Build command downloads the task file into the ICE automatically whether there is an action or not The Rebuild All command carries out the same task as the Build command The difference is that the Rebuild All command will execute the task immediately without first checking the creation date time of the project files The result message of executing a Build or Rebuild All command are displayed on the 57 Chapter 4 Menu Project Output window If an error occurs in the processing procedure the actions following it are skipped and no task file is generated and no download is performed To Build a Project Task File Click the Open command of the Project menu to open the project e Click either the Build command of the Build menu or the Build button on the toolbar Fig 4 1 to start building a project To Rebuild a Project Task File Click the Open command of the Project menu to open the project e Click either the Rebuild All command of the Project menu or the Rebuild all button on the toolbar Fig 4 1 to start building a project once the project task has been built successfully emulation and debuggin
63. his instruction will become the next one to be executed Although an instruction is an effective breakpoint the ICE may not stop at this instruction due to execution flow or conditional skips If an effective breakpoint is in the Data Space RAM the instruction that matches this conditional breakpoint data will always be executed The ICE will stop at the next instruction Note 1 The ICE can only have a maximum of 3 breakpoints active at the same time while e ICE can enjoy up to 65536 effective breakpoints 2 Itis acceptable to set breakpoints in Free Run mode for ICE however e ICE is not Description of Breakpoint Items A breakpoint consists of the following descriptive items It is not necessary to set all items Fig 5 3 Breakpoint Space O Code Data Locetion ents and Documents HTK_Project test test c 10 O address Variable read x means don t care Breakpoints Space Location Content CODE 10 CODE 4 Clear All Fig 5 3 e Space 69 Chapter 5 Menu Debug The location of the breakpoints can be set in Program Code space Data space or EEData space e Location For the actual location of the breakpoint there are two different methods to comfirm the location Address and Line number Line number method Input the file name which the location of the breakpoint belongs to This file can be either a C or ASM file If there is no f
64. ile name then the current file will be taken as a default Input the line number of the breakpoint For the ICE and e ICE multiple line settings are not allowed They can only be set one line at a time Therefore only the first edit box is active and there is no need to input the second edit box For the e Link if setting one line then the second edit box does not need to be filled out If setting multiple lines the first line number and the last line number should be written in the two edit boxes respectively n addition to the line number the symbol name is also allowed to input to the first edit box When it is Code Space the allowed symbols are as follows Label name If programming in C language the label name is a name in the ASM file Section name Procedure name which is the function name If programming in C language the procedure name is the name in the ASM file When it is Data Space the allowed symbols are as follows Dynamic data symbols defined in data section If programming in C language the name is a name in the ASM file and must be a global variable Address method nthis mode only the address is needed When it is Code Space this address is an address in Program Whenit is Data Space this address is an address in RAM When it is EEData Space this address is EEPROM address e Content The data content of the breakpoint This item is effective only when the Space is assigned to the Data space The
65. irst choosing the Debug option attribute page of the Project Settings from the Options menu to set the two step commands Step Into or Step Over in the automatic mode e To start automatic single step mode Choose the Stepping command from the Debug menu also choose the stepping speed the step command is set in the Debug command from the Options menu e To end automatic single step mode Choose the Stop command from the Debug menu To change automatic single step command for the automatic mode Choose the Project Settings command from the Options menu Choose the Step Into or the Step Over command in the Debug option attribute page of the Project Settings dialog box Breakpoints The HT IDE3000 provides a powerful breakpoint mechanism which accepts various forms of conditioning including program address source line number and symbolic breakpoint etc Breakpoint Features The following are the main features of the HT IDE3000 breakpoint mechanism Any breakpoint will be recorded in the breakpoints list box after it is set however this breakpoint may not be immediately effective It can be set to be effective later as long as it is not deleted i e still in the breakpoints list box Breakpoints of address or data in binary form with don t care bits are permitted 68 Chapter 5 Menu Debug When an instruction is set to be an effective breakpoint the ICE will stop at this instruction but will not execute it i e t
66. is directive marks the end of a program Adding this directive to any included file should be avoided Syntax ORG expression e Description This directive sets the location counter to expression The subsequent code and data offsets begin at the new offset specified by expression The code or data offset is relative to the beginning of the section where the directive ORG is defined The attribute of a section determines the actual value of offset absolute or relative e Example ORG 8 mov A 1 In this example the statement mov A 1 begins at location 8 in the current section Syntax PUBLIC name7 name2 EXTERN name 7 type name2 type e Description The PUBLIC directive marks the variable or label specified by a name that is available to other modules in the program The EXTERN directive on the other hand declares an external variable label or symbol of the specified name and type The type can be one of the three types BYTE BIT these two types are for data variables and NEAR a label type and used by call or jmp e Example PUBLIC start setflag EXTERN tmpbuf byte CODE SECTION CODE start mov a 55 call setflag setflag proc mov tmpbuf a ret setflag endp end In this example both the label start and the procedure setflag are declared as public variables Programs in other sources may refer to these variables The variable tmpbuf is also declared as external There should be a sourc
67. isplayed 128 Chapter 9 Library Manager Type in a new library file name and press the OK button Fig 9 4 is displayed for confirmation If the Yes button is chosen a new library file will be created but will not contain any program modules Open Library File Look in LIB t e HT45R PCM12 lib E lib Es math mrmc lib HT45R_UPCMB lib HT95R HTADPCMM lib 5 math_mrsc lib 2 HTADPCM4 LIB HTOSR_PCM12 LIB Es math srsc lib HTS6R_PCM12 LIB HT95R LIPCIMS lib E stdlib mrmc lib Es HTS6R_UPCMS LIB libholtekgcc lib 2 stdlib_mrsc lib HTS3 lib 2 math lib 2 stdlib_srsc lib lt Files of type Library files Data v Open as read only Fig 9 3 Open Library File D Program Files Holtek MCU Development Tools HT IDE3000 7 71 LIB new lib This file does not exist Create the file Mo Fig 9 4 Add a Program Module into a Library File Select an object module from the Object in Directory box and press the ADD button to add this object module into this library file Delete a Program Module from a Library File Select an object module from the Object In Library box and press the Delete button to delete this object module from the library file 129 Chapter 9 Library Manager Extract a Program Module from Library and Create An Object File Selec
68. l Conventions ist RR cu 95 eicere M 97 m 97 Comtinent 5 4 i nM 97 Assembly 97 Conditional Assembly Directives 97 File Control Directives 98 Program Directives ie pep mp ene 100 C o n tents Data Definition Directives 103 eere 105 Assembly Instructions ette bete e de e 107 107 E iia 108 Operand Operator and 108 Miscellaneous epe e tn 110 Forward 5 110 erede He anis 110 Reserved Assembly Language Words 112 Gross Assembler Options epe OR o e I OR NER Assembly Listing File Format Source Program Listing esee eene 114 Summary of Assembly 115 Miscellaneous 115 8 117 What the Cross Linker 117 Gross Linker Options rr Ee ERES ER ER UR dn 117 eie iei ue PERRA n RR RUE SPUR Ed qe ea Section Address en
69. le inker Uptions Libraries Browse Section address Generate Map File Fig 7 1 Syntax value 1 symbo l2 value2 e Example debugflag 1 newver 3 113 Chapter 7 Assembly Language Cross Assembler The check box of the Generate listing file is used to decide whether the listing file should be generated or not If the check box is checked the listing file will be generated Otherwise it won t be generated There is an assembly case sensitive check box in the Project s Build Opion menu the check box is checked it represents case sensitive When programming in different languages this check box is checked in general If the check box is not checked it is not case sensitive Project s Build Option Compiler Settings Linker Options Compiler Flags Preprocessor Categories Assembler v C Generate listing file Fig 7 2 Assembly Listing File Format The Assembly Listing File contains the source program listing and summary information The first line of each page is a title line which include company name the Cross Assembler version number source file name date time of assembly and page number Source Program Listing Each line in the source program has the following syntax line number offset code statement e Line numberis the number of the line starting from the first statement in the assembly source file 4 decimal
70. le Edit View Tools Option Project settings Project Option Debug Option Directories Document Production S Micro Controller HT66FB550 vi with BootLoader Startat ISP mode w Language Tool Start at ISP mode Holtek Compiler 3 10 Assembler v Startat User mode _ JOption Assembler Compiler Options Define Symbol C Generate listing file Linker Options Libraries Section address Generate Map File Fig 3 20 Note Before issuing the Build command ensure that the project options are set correctly e Micro Controller The chosen MCU for this project is selected here Use the scroll arrow to browse the available MCUs and select the appropriate one e With Bootloader This function is only suitable for the USB Flash MCU series Check the With BootLoader box when programming in the ISP mode and then select the program block which is first executed when powered on Start at the ISP mode then excute the BootLoader program block first when powered on Wait until the AP excutes the USB Link then jump to the User code block when the update is finished Start at theUser mode then excute the User code block first when powered on Only if an update is necessary will it call the Library and return to the BootLoader to update It 35 Chapter 3 Menu File Edit View Tools Option will jump to the new User code block when the update is finished e Project s Build Option Cli
71. lized global static varibles are automatically set to 0 If a global has no initial value the default initial value is 0 this value will be cleared when the program starts running Warn if the address of the alias variable is overlap Check whether the address of the alias variable is overlapping or not If the address is address is overlapping then a warning will be generated Arrange the ROM space by address order linker will arrange the function in a small space priority if not select this option 119 Chapter 8 Cross Linker Project settings Project s Build Option Compiler Settings Linker Options Cate gories vj JOptimize data memorytif not nesting interrupts occur v Remove unused function only for C Uninitialized global static variables are automatically set to 0 if the address of alias variable is overlap Arrange the ROM space by address order Fig 8 2 Map File The map file lists the names and loads the addresses and lengths of all sections in a program as well as listing the messages it encounters The Cross Linker gives the address of the program entry point at the end of the map file The map file also lists the names and loads addresses of all public symbols The names and file names of the external symbols or procedures are recorded in the map file if no corresponding public symbol or procedure can be found The contents of the map file are as fol
72. lows Input Object File Input Object File C WSTARTUP1_L OBJ Input Library File C Program Files Holtek MCU Development Tools HT IDE3000V7 81 LIB LIBHOLTEKGCC LIB 120 Chapter 8 Cross Linker Input Library File C Program Files Holtek MCU Development Tools HT IDE3000V7 81 LIB v3_mrsc lib Input Library File C Program Files Holtek MCU Development Tools HT IDE3000V7 81 LIB v3_tabrd_mrsc lib Bank Start End Length Class Name 00h 0000h 0000h 0001h CODE code C t T OBJ 00h 0001h 0001h 0001h CODE main 00h 0002h 0002h 0001h CODE ROMDATA BASE C NSTARTUP1_L OBJ 00h 0004h 0007h 0004h CODE isr04_code C t T OBJ 00h 0008h 0028h 0021h CODE start 00h 0029h 0033h 000bh CODE _isr04 C t T OBJ 00h 0034h 0038h 0005h CODE _fun C t T OBJ 00h 0080h 0081h 0002h DATA HCCINITO C t T OBJ Local Sections Bank Start End Length Class Name 00h 0085h 0085h 0000h LOCAL dummy4 C t T OBJ 00h 0082h 0084h 0003h LOCAL _isr04 C t T OBJ 00h 0085h 0085h 0000h LOCAL dummy C t T OBJ 00h 0085h 0085h 0000h LOCAL _main 00h 0085h 0085h 0000h LOCAL _fun C t T OBJ Public Symbols Information Address Public by Name 0034h _fun 0080h 0029h _isr04 0082h _isr04fs 0001h main 0001h startup value 1 Address Public by Value 0001h main 0001h startup value 1 0029h _isr04 0034h _fun 0080h 0082h _isr04fs Error L2001 Unresolved exter
73. ly SZ m Skip if Data Memory is zero SZA m Skip if Data Memory is zero with data movement to ACC SZ m i Skip if bit i of Data Memory is zero SNZ Skip if bit i of Data Memory is not zero SIZ m Skip if increment Data Memory is zero SDZ m Skip if decrement Data Memory is zero SIZA m Skip if increment Data Memory is zero with result in ACC SDZA m Skip if decrement Data Memory is zero with result in ACC CALL addr Subroutine call RET Return from subroutine RET A x Return from subroutine and load immediate data to ACC RETI Return from interrupt Table Read Instructions TABRDC m Read ROM code current page to Data Memory and TABRDL m Read ROM code last page to Data Memory and Miscellaneous Instructions NOP No operation CLR m Clear Data Memory SET m Set Data Memory CLR WDT Clear Watchdog Timer CLR WDT1 Pre clear Watchdog Timer CLR WDT2 Pre clear Watchdog Timer SWAP m Swap nibbles of Data Memory SWAPA m Swap nibbles of Data Memory with result in ACC HALT Enter Power Down Mode 137
74. mand to add or remove source program files from the opened project The order from top to bottom of each source file in the list box is the order of the input files to the Cross Linker The Cross Linker processes the input files according to the order of these files in the box Two buttons namely Move Up and Move Down can be used to adjust the order of a source file in the project Fig 4 7 is the dialog box of the Project menu s Edit command 55 Chapter 4 Menu Project Project Edit Look in 29 test test asm 4 2 test c My Recent Documents Desktop Documents 59 Computer 4 Network Files of type Files asm as c Files in project C Documents and Settings holtek Desktop testitest c Fig 4 7 To Add a Source File to the Project Choose a source file name from the file list box Double click the selected file name or choose the Add button to add the source files to the project When the selected source file has been added This file name is displayed on the list box of the Files in project To Delete a Source File from the Project e Choose the file to be deleted from the project e Click the Delete button Note Deleting the source files from the project does not actually delete the file but refers to the removal of the file information from the project To Move a Source File Up or D
75. mbler Compiler Options Define Symbol C Generate listing file Linker Options Libraries Section address _ERROR 160 Generate Map File Fig 8 1 Libraries e Syntax libfile 1 libfile2 This option informs the Cross Linker to search the specified library files if the input object files refer to a procedure or variable which is not defined in any of the object files If a module of a library file contains the referred procedure or variable then only this module not the whole library file will be included in the output task file refer to Chapter 9 Library Manager Section Address e Syntax section name adaress section namec address This option specifies the address of the sections section name is the name of the section that is to be addressed The section name must be defined in at least one input object file otherwise a warning will occur The address is the specified address whose format is xxxx in hexadecimal format 118 Chapter 8 Cross Linker Generate Map File The check box of this option is to specify whether the map file is generated or not Linker Options Linker options is only available for the Compiler V3 10 Assembler Optimize data memory not nesting interrupts occur the project select the option can save data memory Remove unused function If a function is not called then the system will not assign space for it this option is enabled by default Uninitia
76. me LOCAL e Description The LOCAL directive defines symbols available only in the defined macro It must be the first line following the MACRO directive if it is present The dummy name is a temporary name that is replaced by a unique name when the macro is expanded The Cross Assembler creates a new actual name for dummy name each time the macro is expanded The actual name has the form digit where digit is a hexadecimal number within the range from 0000 to FFFF A label should be added to the LOCAL directive when labels are used within the MACRO ENDM block Otherwise the Cross Assembler will issue an error if this MACRO is referred to more than once in the source file In the following example tmp1 and tmp2 are both dummy parameters and are replaced by actual parameters when calling this macro label1 and label2 are both declared LOCAL and are replaced by 0000 and 0001 respectively at the first reference if no other MACRO is referred If no LOCAL declaration takes place label1 and label2 will be referred to labels similar to the declaration in the source program At the second reference of this macro a multiple define error message is displayed Delay MACRO tmp1 tmp2 LOCAL label1 label2 mov a 70h mov tmp1 a 105 Chapter 7 Assembly Language and Cross Assembler Sample program for MACRO tmp tmp2 labell label2 a 70h tmp tmp2 wdt2 tmp2 label2 tmp
77. n Data All Range Select _ Voice All Range Select Fig 3 17 This function refers to Chapter four the 00 documentation Options Menu The Options menu Fig 3 18 provides the following commands which can set the working parameters for other menus and commands HT IDES000 File Edit View Project Build Debug Tools Options Window Help 2 Project Settings Editor Settings Language Customize LPT1 Emulation 0000 Fig 3 18 33 Chapter 3 Menu File Edit View Tools Option Project Settings Project Option The Project Option sets the default parameters used by the Build command in the Project menu During development the project options may be changed according to the needs of the application According to the options set the HT IDE3000 will generate a proper task file for these options when the Build command of the Project menu is issued The dialog box Fig 3 19 is used to set the Project options Project settings Project Option Debug Option Directories Document Production HT45FM30 Micro Controller Language Tool Compiler PLE dil Lc Assembler Compiler Options Define Symbol C Generate listing file Linker Options Libraries Section address Generate Map File Fig 3 19 34 Chapter 3 Menu Fi
78. nal symbol g b in file C t T OBJ ROM Usage Statistics Size Used Percentage 2000h 0038h 0 RAM Usage Statistics Bank Size Used Percentage 121 Chapter 8 Cross Linker 00h 0080h 0005h 396 01h 0080h 0000h 0 02 0080h 0000h 096 Total 0180h 0005h 196 Use Stack Count _isr04 0 main 1 Call Tree dummy4 _isr04 dummy _main _fun Total 1 error s Total 0 Warning s Cross Linker Task File and Debug File One of the Cross Linker s output files is the task file which consists of two parts a task header and binary code The task header contains the Cross Linker version the MCU name and the ROM code size The binary code part contains the program codes The other Cross Linker output file is the debug file which contains all information referred to by the IDE debugging program This information includes source file names symbol names and line numbers as defined in the source files The IDE will refer to the symbolic debugging function information This file should not be deleted unless the debugging procedure is completed otherwise the IDE will be unable to support the symbolic debugging function 122 Chapter 8 Cross Linker 123 Part Ill Utilities Partlll Utilities In addition to the previously discussed general purpose 8 bit MCU development tools the comapny also supplies several other utilities for its range of special purpose Voice and LCD MCU devices by supplying all the necessary tools and step
79. ndow File Location Lists the fully qualified path for the file Line Number Lists the line code numbers where the bookmarks are located Tip Double clicking on the file location or line number will open the file and navigate directly to the marked lines Bookmark Window Toolbar 099329 4 HOLTEK Chapter 3 Menu File Edit View Tools Option Fig3 34 Toolbars from left to right are Toggle a bookmark on the current line Adds or removes a bookmark on the selected line of the document in the active Editor Does not alter the code line bookmarked Move the indicator to the previous bookmark Selects the previous enabled bookmark in the Bookmark window When the first bookmark is reached it jumps ahead to the last one As required it opens the file where the selected bookmark occurs in the Editor Scrolls that document to the bookmarked line and places the insertion point there Move the indicator to the next bookmark Selects the next bookmark that is enabled in the Bookmark window When the last bookmark is reached it jumps back to the first one As required it opens the file where the selected bookmark occurs in the Editor Scrolls that document to the bookmarked line and places the insertion point there Move the indicator to the previous bookmark in the current file Selects the previous bookmark that is enabled within the current file in the Bookmark window When the first bookmark is reached it jumps ahea
80. ndow by pressing the delete key Note that the Watch window is dockable Address Space 1 6x 6646 Ram b 1 8x 88542 Ram Hexadecimal Display Decimal Display Binary Display Output Gis Find Wat Wat E Wat Wat Auto ZzlLocal Fig 6 7 Stack The Stack window displays the contents of the stack buffer for the MCU selected in the current project The maximum stack level is dependent upon the MCU selected Fig 6 8 shows an example of the Stack window The growth of the stack is numbered from 0 The number is increased by 1 for a push operation CALL instruction or interrupt and decreased by 1 for a pop operation RET or RETI instructions The top stack line is highlighted E g The 01 shown in Fig 6 8 is the top stack line While executing a RET or RETI instruction the program line number specified in the top stack line 134 in this example will be used as the next instruction line to be executed Also the line above the top stack line 00 in this example will be used as the new top stack line If there is no stack line anymore no line in the Stack window will be highlighted The format of the stack line is 88 Chapter 6 Menu Window Stack level program counter source file name line number where the stack level is the level number of the stack program counter is the hexadecimal return address of the calling procedure or the program address of the interrupted in
81. ols Option Project settings Proiect Option Debug Option Directories Document Production Trace Record Fields Auto Stepping Command y Step Into O Step Over progr AEC machine code CODE Stack execution data DATA Detect Stack Overflow file line number FILE LINE source line SOURCE Connection Port General v Display variable value when debugging C Hexadecimal display Download EEPROM data Fig 3 21 e Trace Record Fields This location specifies the information to be displayed when issuing the Trace List command contained within the Window menu For each source file instruction the information will be displayed in the same order as that of the items in the dialog box from top to the bottom If no item has been selected the next selected item will be moved forward The default trace list will display the file name and line number only The de assembled instruction is obtained from the machine code and the source line is obtained from the source file e General Several items are used to display certain actions when in the debug mode such as displaying variable values hexadecimal displays and downloading EEPROM data The Download EEPROM data check box is only checked when the selected IC has an EEPROM function If the check box is checked the EEPROM will be downloaded to the hardware simulator automatically when executing the Build command Auto Stepping Command Selects the automatic
82. on program Trace Record Format Once the trace qualify and trigger conditions have been setup those instructions which satisfy the qualify conditions will be recorded in the trace buffer The trace recorded fields may not all be displayed on the screen except for the sequence number and disassemble instructions These fields are dependent upon the Trace Recoord Fields settings in the Debug option attribute page of Project Settings sub menu from the Options menu The text enclosed by the parentheses are the headings shown in the Trace List command of the Window menu Fig 5 6 and Fig 5 7 illustrate the contents of the trace list under the different debug options No PC CODE INSTRUCTION FILE LINE SOURCE 0819 0808 8018 6661 4H A 8 0917 0082 CALL THO 17 8816 8817 Hov 0815 0818 HOU 8 9014 0819 CALL 8813 8810 RET 8 0812 081A HOU 0811 8618 8 8818 Bate RET 8 0809 0803 JHP H 6 0808 0806 CLR 40H 8807 0887 CLR 0806 0808 HOU 1 0005 0009 9 2 1 8804 080A CLR 43H 0803 0808 2 8002 BHAC 2 8801 9000 CLR 5 lt 5 6 Sequence number No For any of the trigger modes the sequence number of a trigger point is 0 The trace 79 Chapter 5 Menu Debug records before and after the trigger point are numbered using negative and positive line
83. operands of an expression The Cross Assembler provides many operators to combine and evaluate operands Some operators work with integer constants some with memory values and some with both Operators handle the calculation of constant values that are known at the assembly time The following are some operators provided by the Cross Assembler Arithmetic operators MOD SHL SHR operators Syntax expression SHR count expression SHL count The values of these shift bit operators are all constant values The expression is shifted right SHR or left SHL by the number of bits specified by count If bits are shifted out of position the corresponding bits that are shifted in are zero filled The following are such examples mov 011101116 SHRS ACC 00001110b mov 011101116 SHL4 result ACC 01110000b e Bitwise operators AND OR XOR Syntax NOT expression expression expression2 expression OR 2 108 Chapter 7 Assembly Language and Cross Assembler expression expression2 NOT isa bitwise complement AND isa bitwise AND OR is a bitwise inclusive OR XOR isa bitwise exclusive OR OFFSET operator Syntax OFFSET expression The OFFSET operator returns the offset address of an expression The expression can be a label a variable or other direct memory operand The value returned by the OFFSET operator is an immediate operand e LOW MID HI
84. own e Choose the file to be moved in the list box Files in project by moving the cursor to this file and clicking the mouse button e Click the Move Up button or the Move Down button 56 Chapter 4 Menu Project Build a Project s Task Files Be sure that the following tasks have been completed before building a new project e The project has been opened e The project options have all been set e The project source files have been added The MCU options have been set refer to the Tools menu chapter There are two commands related to the building of a project file the Build command and the Rebuild all command The Project menu s Build command performs the following operations e Assemble or compile all the source files of the current project by calling the Cross Assembler or C compiler depends on the file extension asm or C e Link all the object files generated by the Cross Assembler C compiler and generate a task file and a debugging file e Load the task file into the ICE if it is powered on e Display the source program of the execution entry point on the active window the HT IDE3000 refers to the source files the task file and the debugging file for emulation Note The Build command may or may not execute the above tasks as the execution is dependent on the creation date time of all corresponding files The rules are e f the creation date time of a source file is later than that of its object file t
85. ows 2000 Restore Default Layout Office XP Windows Display Line Numbers Office 2003 Cycle Count Visual Studio NET 2005 Office 2007 gt Ln 1 Coll _ Emulation PC 0000H Fig 3 5 Tools Menu The Tools menu provides the special commands to facilitate user application debug These commands are Configuration Options Import Configuration Options Diagnose Writer Library Manager Editor LCD Simulator Voice amp Flash Download and Switch OCDS Mode 22 Chapter 3 Menu File Edit View Tools Option htk HT IDE3000 it View Project Build Debug Tools Options Window Help RA Ra A onem 2 pij pij La d 0 C on Lni Coli LPT1 Emulation PC 0000H Configuration Option This command generates an option file used by the Build command in the Build menu The contents of the option file depend upon the specified MCU This command allows options to be modified after creation of the project Choosing the Clock Source When creating a new project or modifying the configuration options it is necessary to choose an internal or external clock source for ICE If an internal clock source is used the system application frequency has to be specified The HT IDE3000 system will calculate a frequency which can be supported by the ICE one which will be the most approximate value to the specified system frequency Whenever the calculated frequency is not equal to the specified frequency a warning message and
86. ping the trace mechanism is issued the trace recording will be stopped A Qualify list box records and displays all qualifiers used by the Trace Mode Up to 20 qualifiers can be added into the list box and and up to 6 qualifiers can be effective A 75 Chapter 5 Menu Debug Qualifier can be disabled or deleted from the list box In the Qualify list box the format of the qualifier is status space and read write location data content external signal where status is effective status is effective enabled and is non effective disabled space and read write gt is the space type and operating mode C is the code space D R is the data space with read D W is the data space with write D RW is the data space with read and write location data content and external signal have the same data format as the input form respectively Stopping the Trace Mechanism There are 3 methods to stop the trace recording mechanism Set the trigger point Trigger Mode and Forward Rate as shown above e Set breakpoints to stop the the emulation and the trace recording Issue a Trace Stop command from the Debug menu Fig 5 2 to stop the trace recording Fig 5 4 lists all the requirements to use the trace mechanism This is the result of the Trace command from the Debug menu Trace Start Stop Setup Set the Trace Mode e Choose the Trace command from the Deb
87. ple of convention Description of convention Syntax elements that are enclosed by a pair of brackets are optional For example the syntax of the command line is as follows optional items HASM options filename In the above command line options and semicolon are both optional but filename is required except for the following case 95 Chapter 7 Assembly Language and Cross Assembler cho ce1 choiceZ Repeating elements Statement Syntax Brackets in the instruction operands In this case the brackets refer to memory address Braces and vertical bars stand for a choice between two or more items Braces enclose the choices whereas vertical bars separate the choices Only one item can be chosen Three dots following an item signify that more items with the same form may be entered For example the directive PUBLIC has the following form PUBLIC name In the above form the three dots following name2 indicate that many names can be entered as long as each is preceded by a comma The construction of each statement is as follows name operation operands comment All fields are optional e Each field except the comment field must be separated from other fields by at least one space or one tab character e Fields are not case sensitive i e lower case characters are changed to upper case characters before processing Name Statements can be assigned labels to en
88. printer Print Setup Setup printer PrintPreview Preview the printed output Recent Files List the most recently opened and closed four files Exit Exit from HT IDE3000 and return to Windows Du Eg oc Sw M Ni m Paste Undo Cancel the previous editing operation Redo Cancel the previous Undo operation Cut Remove the selected lines from the file and place onto the clipboard Copy Place a copy of the selected content onto the clipboard Paste Paste the clipboard information to the present insertion point Delete Delete the selected content 20 Chapter 3 Menu File Edit View Tools Option e Select All Select the entire document e Find Search the specified word from the editor active buffer e Find Next Find the next occurrence of the specified text e Find Previous Find the previous occurrence of the specified text e Findin Files Search for a string in multiple files Replace Replace the specified source word with the destination word in the editor active buffer e GoTo Moves to a specified location Read Only Read only mode View Menu The View menu provides the following commands to control the window screen of the HT IDE3000 Refer to Fig 3 5 Full Screen Toggles Full Screen Mode on off e Appliaction Look Multiple styles can be selected Windows 2000 Office XP Windows XP Office 2003 Visual Studio Net 2005 Office 2007 including blue black sliver and green Visu
89. ption file to the specified printer The printer may be selected when the option file is to be printed out It is recommended to use a different printer port from the port which is connected to the ICE If both the printer and the ICE are using the same printer port issuing this command will cause the loss of all debug information and corresponding data After the printing job has finished the user should proceed to the very beginning of the development procedure and use the Build command of the Project menu if further emulation debugging of the application program is required 2 x File D Projects FanTestCode ADDA_DC_FAN HMTP Product Name HCU Name HTh5FH38 File Name D PROJECTS FANTESTCODE ADDA_DC_FAN MTP HT IDE Uer U7 71 Compiler Uer HCC2 88 Linker 08 5 CFG Uer 01 9 MTP Code File Checksum 2C88H Program Code Checksum D5BCH Code Checksum 157CH Program code checksum Option code checksum Data code Fig 4 8 59 Chapter 4 Menu Project Backup Restore Project The Backup Project command will use PROJECT DATE VERSION format to compress the current project and also allow users to add some project description in Description editing box if necessary The Restroe Project command will restore the compressed project which selected in the backup list box currently 60 Chapter 4 Menu Project 61 Chapter 5 Menu Debu Chapter5 Menu Debug In the
90. ram section and data section Project Deployment Step3 Code Wiz creates the following items for you File name Header file HTA5FM program section data section cs ds Import configuration options from other project Fig 4 6 54 Chapter 4 Menu Project And finally is the Configuration Option and Project Setting operations For this consult the related chapters Open and Close a Project Note The HT IDE3000 can work with only one project at a time which is the opening project at any time If a project is to be worked upon the project should first be opened by using the Open command of the Project menu Fig 4 1 Then insert the project name directly or browse the directories and select a project name Use the Close command to close the project When opening a project the current project is closed automatically Within the development period i e during editing setting options and debugging etc ensure that the project is in the open state This is shown by the displaying of the project name of the opening project on the title of the HT IDE3000 window Otherwise the results are unpredictable The HT IDE3000 will retain the opening project information if the system exits from the HT IDE3000 without closing the opening project This project will be opened automatically the next time the HT IDE3000 is run Manage the Source Files of a Project Use the Edit com
91. rder to stop the trace recording It also provides a method to record a specified count of the trace records before or after a trigger point When the HT IDE3000 starts emulating refer to the section on Emulation of the Application Programs the trace mechanism will begin to record the executing instructions and relative information automatically but not vice versa Only the ICE supports the trace mechanism function The and OCDS do not support this function Initiating the Trace Mechanism The basic requirement for initializing the trace mechanism is to set the Trace Mode with or without Qualify The Trace Mode defines the trace scope of the application program and Qualify defines the filter conditions of the trace recording The available Trace Modes are e Normal Sets the trace scope to all application programs and is the default mode e Trace Main 73 Chapter 5 Menu Debug Sets the trace scope to all application programs except the interrupt service routine programs e Trace INT Sets the trace scope to all interrupt service routine programs According to Qualify the trace mechanism decides which instructions and what corresponding information should be recorded in the trace buffer during the emulation process The rule is that an instruction will be recorded if its information and status satisfy one of the enabled qualifiers If all the program steps are required to be recorded then No Qualif
92. s an OCDS On Chip Debug Support architecture which only requires two signal lines for debug e The EV has the same number of pins as the IC or 1 2 more pins than the IC It can be soldered to the application board and easily debugged e Contains several types of breakpoint functions e Includes RAM real time monitoring function e Wide operating voltage range of 1 7V 5 5V Chapter 1 Overview and Installation Software Windows based software utilities Source program level debugger symbolic debugger Workbench for multiple source program files allows for more than one source program file in one application project All tools are included for the development debug evaluation and generation of the final application program code e Library for the setting up of common procedures which can be linked at a later date to other projects In Circuit Emulator ICE e ICE and e Link Developed alongside the the company 8 bit microcontroller device range the company ICE is a fully functional in circuit emulator for the company s 8 bit microcontroller devices Incorporated within the system are a comprehensive set of hardware and software tools for rapid and easy development of user applications Central to the system is the in circuit hardware emulator capable of emulating all of the company s 8 bit devices in real time while also providing a range of powerful debugging and trace facilities Regarding software functions the
93. s are by using the Toggle Breakpoint button on the toolbar double clicking on the gray bar in the edit window or pressing key F9 The rules of the breakpoint mechanism are as follows If the breakpoint to be set is not in the Breakpoints list box Fig 5 3 then the descriptive items must be designated first then added to the Breakpoints list box 7 Chapter 5 Menu Debug e As long as the breakpoint exists in the list box it can be made effective by Enabling the breakpoint if it fails to be initially effective e Press the OK button for confirmation Otherwise all changes here will not be effective When using the Toggle Breakpoint button on the toolbar the cursor should first be moved to the breakpoint line and then the Toggle Breakpoint button pressed If an effective breakpoint is to be changed to a non effective breakpoint this can be achieved by merely pressing the Toggle breakpoint button To Add a Breakpoint e Choose the Breakpoint command from the Debug menu or press the hot key Ctrl B A breakpoint dialog box is displayed Fig 5 3 Designate the descriptive items of the breakpoint Set Space Location items Set Content item and Read Write check box if Space is the data space e Press the Add button to add this breakpoint to the Breakpoints list box e Press the OK button to confirm Note If the total count of the effective breakpoints is less than 3 the newly added one will take effect automatically a
94. sembler Logic Operation Instructions AND A m OR A m A m ANDM A m ORM A m XORM A m AND OR A x XOR A x CPL m CPLA m AND Data Memory to ACC OR Data Memory to ACC Exclusive OR Data Memory to ACC AND ACC to Data Memory OR ACC to Data Memory Exclusive OR ACC to Data Memory AND immediate data to ACC OR immediate data to ACC Exclusive OR immediate data to ACC Complement Data Memory Complement Data Memory with result in ACC Increment amp Decrement Instructions INCA m INC m DECA m DEC m Increment Data Memory with result in ACC Increment Data Memory Decrement Data Memory with result in ACC Decrement Data Memory Rotate Instructions RRA m RR m RRCA m RRC m RLA m RL m RLCA m RLC m Rotate Data Memory right with result in ACC Rotate Data Memory right Rotate Data Memory right through carry with result in ACC Rotate Data Memory right through carry Rotate Data Memory left with result in ACC Rotate Data Memory left Rotate Data Memory left through carry with result in ACC Rotate Data Memory left through carry Data Move Instructions MOV A m MOV m MOV A x Move Data Memory to ACC Move ACC to Data Memory Move immediate data to ACC 136 Appendix Reserved Words Used By Cross Assembler Bit Operation Instructions CLR m i Clear bit of Data Memory SET m i Set bit of Data Memory Branch Instructions JMP addr Jump unconditional
95. stead input a new project name Additionally users can select the required microcontroller for their project and the lauguage tools For some certain MCUs a BootLoader option is available and this option provides an IAP function see Fig 4 4 52 Chapter 4 Menu Project Project Location Stepi Project Name Project Location C Documents and Settngs erichyx My DocumentssHTE Project L J Project MCU Create directory for project HTITSPMED MCU Information with Boot Loader RAM Size 2 Benk s ROM Size 800H Stack Size 8 BootLoader Size Choose Language Tool Holtek C Compiler V 10 A ssembler More project settings Fig 4 3 Project Location 5 Project Name Project Location C Documents and SettingserichyxMy Documents H TK_Project Project MCU Create directory for project HT66FB550 vj MCU Information with Boot Loader StartatISP mode RAM Size 6 Bankis Start at ISP mode ROM Size 2000H Choose Language Too Holtek C Compiler 3 10 Assembler v Stack Size 8 BootLoader Size 200 More project settings Fig 4 4 Step2 Project Option The second step is to select whether assembly files or C language files are to be used in the project 53 Chapter 4 Menu Project Project Option Step2 005 Fig 4 5 Step3 Project Deployment This step is to change the source program File name prog
96. struction source file name is the complete name of the source file containing the calling or interrupted instruction and line number is the decimal line number of the instruction after the call instruction or interrupted instruction in the source file D Project HT46RB7 8NTestXTest asm 59 1 1 1 1 1 1 1 1 1 2 1 2 FFFF 2 FFFF 2 FFFF 2 FFFF Fig 6 8 Variable This window can view and modify variable values including two tabs Auto tab this tab can observe and set both local variables and global variables related to the current function Local tab this tab can observe and set local variables related to the current function Address 8 6x 6646 Ram b 1 6x 6642 Ram ec 2 8x 0044 Ram 2 Output Gis Find gal Wate Wate ga Wate Wate Auto amp xlLocal Fig 6 9 Program 89 Chapter 6 Menu Window The Program window displays the program code memory or ROM in disassembly format The address range is from 0 to last address where the last address depends upon the MCU selected in the project Disassembly The Disassembly Window shows mixed high level source code and its associated assembler code Each instruction is marked with code coverage indicators that show execution status Disassembly include HT46RB76 inc aCODE SECTION ttinclude HT46RB76 h
97. system incorporates a user friendly Windows based workbench which integrates together functions such as program editor Cross Assembler Cross Linker and library manager ICE Interface Card The interface cards supplied with the ICE can be used for most applications however it is possible for the user to omit the supplied interface card and design their own interface card By including the necessary interface circuitry on their own interface card the user has a means of directly connecting their target boards to the CN1 and CN2 connectors of the ICE Fig 1 1 Chapter 1 Overview Installation System Configuration The IDE system configuration is shown below in which the host computer is a Pentium compatible machine with Windows 2000 XP or later Note that if Windows 2000 XP or later systems are used then the HT IDE3000 software must be installed in the Supervisor Privilege mode Power Adapter Emulator Flat Cable RAY Emulator Box Interface Target Printer Cable HandyWriter Fig 1 2 The IDE system contains the following hardware components ICE e The ICE box contains the emulator box with 1 printer port connector for connecting to the host machine I O signal connector and one power on LED interface card for conn
98. t Power on Reset X ANARA 21 09 Toggle Break Point Clear All Break Point 0 cursor Stop 64 Chapter 5 Menu Debug The effects of the above 4 types of reset are listed in table 5 1 Target Software Software Power On Reset Item Board Reset Power On Reset Reset Command Reset Command Clear Registers Clear Options Yes No No No Clear PD TO Yes No No Yes PC Value 0 0 0 Emulation Stop No Yes Yes Check Stand Alone Yes No No No Table 5 1 Note Refer to the Data Book of the corresponding MCU for the effects of registers under the different resets The PC value is 0 and the emulation stops If the reset is from the target board the MCU will start emulating the application after the reset is completed PC Program Counter PDF Power Down Flag TO Time out Flag To Reset from the HT IDE3000 Commands e Either choose the Reset command from Debug menu or click the Reset button on the toolbar to execute a software reset e Either choose the Power on Reset command from the Debug menu or click the Power on Reset button to execute a software power on reset Emulation of Application Programs After the application program has been successfully written the Build or Rebuild command should be executed to build the project files and download the programs to the hardware simulator If successful th
99. t an object module from the Object in Library box and press ExTract button A file will then be created with the same name and same content as the selected object module It is displayed on the Object in Directory box Object Module Information Press the Open button Fig 9 3 is displayed Select a library file from the box below the File Name box press OK button From Fig 9 2 all the object modules of the selected library file are listed in the Object in Library box The following information about each object module is also listed in the Objects Information box Maximum ROM size The maximum size used by this object module program code Dependent upon the code section align type Minimum ROM size The minimum actual size used by this object module program code Maximum RAM size The maximum size used by this object module program data It depends on the data section align type Minimum RAM size The minimum actual size used by this object module program data Public Name The names of all public symbols in this object module 130 Appendix 131 Reserved Words Used Cross Assembler 132 Appendix Reserved Words Used By Cross Assembler AppendixA Reserved Words Used By Cross Assembler Reserved Assembly Language Words The following table lists all reserved words used by the assembly language e Reserved Names direc
100. the specified frequency along with the calculated frequency will be displayed Confirmation will then be required to confirm the use of the calculated frequency or to specify another system frequency Otherwise an external clock source is the only option No matter which kind of clock source is chosen the system frequency must be specified Note More information about choosing the clock source for e ICE please refer to the e ICE User s Guide Import Configuration Options Import the configuration options files Diagnose This command Fig 3 7 helps to check whether the ICE is working correctly There are a total of 9 items for diagnosis Multiple items can be selected by clicking the check box and pressing the Test button or press the Test All button to diagnose all items These 23 Chapter 3 Menu File Edit View Tools Option items are listed below e MCU resource option space Diagnose the MCU options space of the ICE Code space Diagnose the program code memory of the ICE e Trace space Diagnose the trace buffer memory of the ICE Data space Diagnose the program Data Memory of the ICE System space Diagnose the system Data Memory of the ICE EV 0 Diagnose the EV chip socket 0 of the ICE EV 1 Diagnose the EV chip in socket 1 of the ICE EV 2 Diagnose the EV chip in socket 2 of the ICE EV 3 Diagnose the EV chip in socket
101. tion This is the default case e Trigger at Condition A The trigger point is at condition A e Trigger at Condition B The trigger point is at condition B e Trigger at Condition A or B The trigger point is at either condition A or condition B e Trigger at Condition B after A The trigger point is at condition B after condition A has occurred e Trigger when meeting condition A for k times The trigger point is when condition A has occurred k times e Trigger at Condition B after meeting A for k times The trigger point is at condition B after condition A has occurred for k times Condition A and Condition B specify the trigger conditions The format of condition A or B is the same as that of the Qualify The Loop Count specifies the number of occurrences of the specified condition A It is used only when the Trigger Mode is from one of the last two modes in the above list The Forward Rate specifies the approximate rate of the trace recording information between the trigger point and stop trace point in the whole trace buffer The trigger point divides the trace buffer into two parts before and after trigger point The forward rate is used to limit the trace recording scope after the trigger point The percentage is adjustable between 0 and 100 Note It is not necessary for the trace recording scope to be equal to the forward rate If breakpoint is met before reaching the trace recording scope or a trace stop command refer to Stop
102. tion code checksum Pull high PC Non Pull high Pull high PD Non Pull high Pull high PF Non Pull high Pull high PG Non Pull high PA3 PFD Disable PFD PFD clock source TIMER 8 mode 7 1 mode I2C Disable Enable CLRUDT Two clear instructions lt gt Fig 2 1 The Programming and data flow is illustrated by the following diagram 14 Chapter 2 Quick Start Project Assemble Compile Build Rebuild Alle 1 Assemble C ompile 2 Linker 3 Loader 4 Code Generatore Tools Library Manager Loader Download to Tools Mask Option Code Generatore Tools Print Option Table Option Approval Sheet Fig 2 2 15 Create Task File LST Linker Debug Gow Go to Cursore Jump to Cursore Stop Trace Stope Reset Power on Reset Reset Trace Step Into Over Out Stepping Tools OnBoard Writere Chapter 3 Menu File Edit View Tools Option Chapter3 Menu File Edit View T ools Options This chapter describes some of the menus and commands of the HT IDE3000 Other menus are described in the Project Debug and Window chapters Start the HT IDE3000 System Set Program Access and Defaults ee Windows Catalog 4 Windows Update Programs Games gt Documents fan Holtek MCU Development Tools HT IDE3000 BinToAsm Startup Diagnosis S
103. tives operators DUP INCLUDE NOT LABEL OFFSET ELSE LIST OR END LISTINCLUDE ORG ENDIF LISTMACRO PAGE ENDM LOCAL PARA ENDP LOW PROC EQU MACRO PUBLIC ERRMESSAGE MESSAGE RAMBANK 133 Appendix Reserved Words Used By Cross Assembler AND EXTERN MID ROMBANK BANK HIGH MOD SECTION BYTE IF NEAR SHL DB IFDEF NOLIST SHR DBIT IFE NOLISTINCLUDE WORD DC IFNDEF NOLISTMACRO XOR 134 Appendix Reserved Words Used Cross Assembler e Reserved Names instruction mnemonics ADC HALT RLCA SUB ADCM INC RR SUBM ADD INCA RRA SWAP ADDM JMP RRC SWAPA AND MOV RRCA SZ ANDM NOP SBC SZA CALL OR SBCM TABRDC CLR ORM SDZ TABRDL CPL RET SDZA XOR CPLA RETI SET XORM DAA RL SIZ DEC RLA SIZA DECA RLC SNZ e Reserved Names registers names A WDT WDT1 WDT2 Instruction Sets Arithmetic Instructions ADD Add Data Memory to ACC ADDM m Add ACC to Data Memory ADD Add immediate data to ACC ADC A m Add Data Memory to ACC with carry m Add ACC to Data Memory with carry SUB Subtract immediate data from ACC SUB A m Subtract Data Memory from ACC SUBM A m Subtract Data Memory from ACC with result in Data Memory SBC A m Subtract Data Memory from ACC with carry m Subtract Data Memory from with carry and result in Data Memory DAA m Decimal adjust ACC for addition with result in Data Memory 135 Appendix Reserved Words Used By Cross As
104. tor LCDS provides a mechanism to simulate the output of the LCD driver According to the designed patterns and the control programs the LCDS displays the patterns on the screen in real time LCD Simulator only supports part of MCUs based on the ICE architecture Additionally this part is no longer being updated Voice amp Flash Download The Voice amp Flash Download downloads the contents of a specified voice data file with the extension or DAT to the ICE for emulation or burn the voice data to SPI Flash by e Writer It also uploads from ICE VROM or SPI Flash saving the data to a specified or DAT file Fig 3 15 displays the dialog box which shows the name of the download voice VOC which was generated by the VROM editor The File Size box below the File Path box displays the voice ROM size in bytes for microcontroller device in the current project Ensure that the voice file has been generated by the editor before downloading Switch OCDS Mode This command is only used for OCDS ICE two modes can be selected here and correspond to different package types respectively Fig 3 16 OCDS Mode Fig 3 16 Smart Programming Settings This function is available for OTP and MTP type MCUs 32 Chapter 3 Menu File Edit View Tools Option Programming Setting Check ID Current MCU BS82B16 3 Operation Setting Program Range Select User Specified Data Optio
105. uage e Reserved Names directives operators DUP ELSE END ENDIF EQU ERRMESSAGE AND EXTERN BANK HIGH BYTE IF DB IFDEF DBIT IFE DC IFNDEF e Reserved Names instruction mnemonics ADC HALT ADCM INC ADD INCA ADDM JMP AND MOV ANDM NOP CALL OR CLR ORM CPL RET CPLA RET DAA RL DEC RLA DECA RLC e Reserved Names registers names A WDT 112 INCLUDE LABEL LIST LISTINCLUDE LISTMACRO LOCAL LOW MACRO MESSAGE MID MOD NEAR NOLIST NOLISTINCLUDE NOLISTMACRO RLCA RR RRA RRC RRCA SBC SBCM SDZ SDZA SET SIZ SIZA SNZ WDT1 NOT OFFSET OR ORG PAGE PARA PROC PUBLIC RAMBANK ROMBANK SECTION SHL SHR WORD XOR SUB SUBM SWAP SWAPA SZ SZA TABRDC TABRDL XOR XORM WDT2 Chapter 7 Assembly Language and Cross Assembler Cross Assembler Options The Cross Assembler options can be set via the Options menu Project command in HT IDE3000 The Cross Assembler Options is located on the center part of the Project Option dialog box as shown in Fig 7 1 The symbols could be defined in the Define Symbol edit box Project settings Project Option Debug Option Directories Document Production Micro Controller HT46CU26 gt Language Tool Holtek Compiler V3 10 Assembler Project s Build Option Assembler Compiler Options Define Symbol debugflag 1 C Generate listing fi
106. ug Menu A Trace dialog box is displayed as in Fig 5 4 e Choose a trace mode from the Trace Mode pull down list box e Press the OK button 76 Chapter 5 Menu Debug Trace Mode Normal Trigger Mode Trigger at condition Cancel Forward Rate 50 lt 4096 frames Condition Set Qualify Quality 12 Qualify List 101b 2 Fig 5 4 Set the Stop Trace Trigger Mode Choose the Trace command from the Debug Menu A Trace dialog box is displayed as in Fig 5 4 Choose a trigger mode from the Trigger Mode pull down list box e press the OK button Change the Forward Rate Choose the Trace command from the Debug Menu A Trace dialog box is displayed as in Fig 5 4 Use the Forward Rate scroll bar to specify the desired rate e Press the OK button ToSetup the Condition A Condition B Choose the Trace command of the Debug Menu A Trace dialog box is displayed as Fig 5 4 e Press Condition A Condition B radio button e Press the Set Condition button A Set Qualify dialog box is displayed as in Fig 5 5 e Enter the conditional information 71 Chapter 5 Menu Debug e Press the OK button to close the Set Condition dialog box e Press the OK button to close the Trace dialog box Space Code Location Content read Fig 5 5 To Adda Trace Qualify Condition Choose the
107. umber is a collection of binary octal decimal or hexadecimal digits along with an optional radix If no radix is given the Cross Assembler uses the default radix decimal The table lists the digits that can be used with each radix Radix Type Digits B Binary 01 01234567 D Decimal 0123456789 103 Chapter 7 Assembly Language and Cross Assembler H Hexadecimal 0123456789ABCDEF Syntax name DB valueT value2 name DB repeated count DUP Description These directives reserve the number of bytes specified by the repeated count or reserve bytes only va ue and va ue2 should be due to the microcontroller The Cross Assembler will not initialize the RAM data DBIT reserves a bit The content denotes uninitialized data i e reserves the space of the data The Cross Assembler will gather every 8 DBIT together and reserve a byte for these 8 DBIT variables e Example DATA SECTION DATA tbuf DB flag1 DBIT sbuf DB cflag DBIT In this example the Cross Assembler reserves byte location 0 for tbuf bit O of location 1 for flag1 location 2 for sbuf and bit 1 of location 1 for cflag Syntax name LABEL Description The name with the data type has the same address as the following data variable e Example lab1 LABEL WORD d1 DB d2 DB In this example d1 is the low byte of lab1 and d2 is the high byte of lab1 Syntax
108. words Drives Minimum ROM Size 0 words me Maximum RAM Size 1 words Minimum Size 1 words Public T11 in module d t11 0bj About Fig 3 8 CH2 Config Msi Documents and Settings Downloads HTLIB Inetpub Keil MSOCache Holtek C V2 gt V3 syntax converter As Holtek s C V2 and C V3 have different syntax this converter can assist with the conversion of C V2 projects to C V3 projects The main screen is shown in in Fig 3 9 25 Chapter 3 Menu File Edit View Tools Option tov3 2 Project Convert Setting Convert To convert the syntax multiple choice Absolute Variable Settings Save Path Buildin Fonction Default Flag Bit Delay Function Intenupt Inline Assembly Bit Variable Not recommened Other Path 1 Add Add a project for conversion More than one can be added at a single time allowing multiple projects to be converted at the same time 2 Remove Delete the selected project 3 Clear Clear all projects 4 Convert Start Conversion 5 Convert To This only support conversion to Holtek C V3 6 Settings Save Path Save the path of the converted project 1 Default Automatically generates a folder named V3 in the original project folder 2 Other Path Stored in the user specified path 26 Chapter 3 Menu File Edit View Tools Option 7 To convert the syntax multiple choice
109. y is needed do not set the Qualify The default is No Qualify Qualify format e source file name line number where the source file name is a name of the optional source file If there is no file name the current active file is assumed The exclamation point is necessary only when a source file name is specified The dot must prefix the line number which is decimal Forexample C HIDE USER GE ASM 42 Only the code executed at the 42nd line of the file GE ASM is recorded For example 48 Only the code executed at the 48nd line of the current active file is recorded e source name symbol name All are the same as the line number location format except that the line number is replaced with symbol name The following program symbols are acceptable Label name Section name Procedure name Dynamic data symbols defined in data section In contrast to the Trace Mode and Qualify which specify the conditions of trace recording both the Trigger Mode and Forward Rate specify the conditions to stop the trace recording The Trigger Mode specifies the kind of the stop trace trigger point and is a standard used 74 Chapter 5 Menu Debug to determine the location of the stop trace point The Forward Rate specifies the trace Scope between the trigger point and the stop trace point The available Trigger Modes are e Trigger No stopping of the trace recording condi

Download Pdf Manuals

image

Related Search

Related Contents

Singer ET Series User's Manual  取扱説明書(ヘルプガイド)  Pyle PHST94IPBK docking speaker  A-83 - Comtec  Mode d´emploi Magnetolink  Jazzy Select Elite - Pride Mobility Products  

Copyright © All rights reserved.
Failed to retrieve file