WICE Lite INTEGRATED DEVELOPMENT ENVIRONMENT USER’S GUIDE Doc. Version 1.0 (Applicable to WICE Lite Version 2.965 & later) ELAN MICROELECTRONICS CORP. June 2005 Trademark Acknowledgments: IBM is a registered trademark and PS/2 is a trademark of IBM. Windows is a trademark of Microsoft Corporation. ELAN and ELAN logo are trademarks of ELAN Microelectronics Corporation. Copyright © 2005 by ELAN Microelectronics Corporation All Rights Reserved Printed in Taiwan The contents of this User’s Guide (publication) are subject to change without further notice. ELAN Microelectronics assumes no responsibility concerning the accuracy, adequacy, or completeness of this publication. ELAN Microelectronics makes no commitment to update, or to keep current the information and material contained in this publication. Such information and material may change to conform to each confirmed order. In no event shall ELAN Microelectronics be made responsible for any claims attributed to errors, omissions, or other inaccuracies in the information or material contained in this publication. ELAN Microelectronics shall not be liable for direct, indirect, special incidental, or consequential damages arising from the use of such information or material. The software (WICE Lite) described in this publication is furnished under a license or nondisclosure agreement, and may be used or copied only in accordance with the terms of such agreement. ELAN Microelectronics products are not intended for use in life support appliances, devices, or systems. Use of ELAN Microelectronics product in such applications is not supported and is prohibited. NO PART OF THIS PUBLICATION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY ANY MEANS WITHOUT THE EXPRESSED WRITTEN PERMISSION OF ELAN MICROELECTRONICS. ELAN MICROELECTRONICS CORPORATION Headquarters: Hong Kong: USA: No. 12, Innovation Road 1 Hsinchu Science Park Hsinchu, Taiwan 308 Tel: +886 3 563-9977 Fax: +886 3 563-9966 http://www.emc.com.tw Elan (HK) Microelectronics Corporation, Ltd. Elan Information Technology Group Rm. 1005B, 10/F Empire Centre 68 Mody Road, Tsimshatsui Kowloon , HONG KONG Tel: +852 2723-3376 Fax: +852 2723-7780 [email protected] 1821 Saratoga Ave., Suite 250 Saratoga, CA 95070 USA Tel: +1 408 366-8223 Fax: +1 408 366-8220 Europe: Shenzhen: Shanghai: Elan Microelectronics Corp. (Europe) Elan (Shenzhen) Microelectronics Corp., Ltd. Elan Electronics (Shanghai) Corporation, Ltd. Siewerdtstrasse 105 8050 Zurich, SWITZERLAND Tel: +41 43 299-4060 Fax: +41 43 299-4079 http://www.elan-europe.com SSMEC Bldg., 3F, Gaoxin S. Ave. Shenzhen Hi-Tech Industrial Park Shenzhen, Guandong, CHINA Tel: +86 755 2601-0565 Fax: +86 755 2601-0500 23/Bldg. #115 Lane 572, Bibo Road Zhangjiang Hi-Tech Park Shanghai, CHINA Tel: +86 021 5080-3866 Fax: +86 021 5080-4600 Contents Contents 1 Overview 1 1.1 WICE Lite System Hardware Introduction .................................................................1 1.1.1 Hardware Environment......................................................................................1 1.1.2 E8-ICE Overview...............................................................................................2 1.2 WICE Lite Program Introduction ................................................................................3 1.2.1 WICE Lite Main User Interface.........................................................................3 1.2.2 WICE Lite Sub-Windows ..................................................................................4 1.2.2.1 The “Project” Window ..........................................................................4 1.2.2.2 The “Editor” Window ...........................................................................4 1.2.2.3 The “Special Registers” Window..........................................................5 1.2.2.4 The “General Registers (Bank)” Window.............................................5 1.2.2.5 The “Watch” Window ...........................................................................6 1.2.2.6 The “Output” Window ..........................................................................6 1.2.2.7 The “Data RAM” Window....................................................................6 1.2.2.8 The “LCD Data” Window (ePV series is not support) .........................7 1.2.3 WICE Lite Menu Bar and its Commands ..........................................................8 1.2.3.1 File Menu ..............................................................................................8 1.2.3.2 Edit Menu..............................................................................................8 1.2.3.3 View Menu............................................................................................9 1.2.3.4 Project Menu.........................................................................................9 1.2.3.5 Debug Menu........................................................................................10 1.2.3.6 Tool Menu ........................................................................................... 11 1.2.3.7 Option Menu ....................................................................................... 11 1.2.3.8 Window Menu.....................................................................................12 1.2.3.9 Help Menu ..........................................................................................12 1.2.4 WICE Lite Tool Bar and its Functions.............................................................13 1.2.5 Status Bar .........................................................................................................13 2 System Installation 15 2.1 System Requirements ................................................................................................15 2.1.1 Host Computer.................................................................................................15 2.1.2 E8-ICE External Power Source .......................................................................15 2.1.3 Printer Port Cable ............................................................................................15 2.2 Hardware Installation and Setup................................................................................16 2.2.1 Connecting E8-ICE to Host Computer and Power Source..............................16 2.3 WICE Lite Program Installation ................................................................................16 WICE Lite IDE User’s Guide Contents • iii Contents 3 Getting Started with WICE Lite IDE System 17 3.1 Hardware Power-up...................................................................................................17 3.2 Starting the WICE Lite Program ...............................................................................17 3.2.1 Connect Dialog ................................................................................................17 3.2.1 Code Option Dialog.........................................................................................18 3.3 Create a New Project .................................................................................................18 3.4 Add and Remove Source Files from/to Project .........................................................20 3.4.1 Create and Add a New Source File for the Project...........................................20 3.4.2 Add Existing Source Files to the New Project.................................................21 3.4.3 Deleting Source Files from Project..................................................................21 3.5 Editing Source Files from Folder/Project..................................................................22 3.5.1 Open Source File from Folder for Editing.......................................................22 3.5.2 Open Source File from Project for Editing ......................................................22 3.6 Assemble and Link the Project..................................................................................23 3.7 Dumping the Compiled Program to ICE ...................................................................24 3.8 Debugging a Project ..................................................................................................24 3.8.1 Breakpoints Setup............................................................................................25 3.8.1.1 Setting Breakpoint Pass Count ...........................................................26 3.8.1.2 Other Settings in the “Debug Setting” Dialog ....................................27 3.8.1.3 Defining Address as Breakpoint .........................................................27 3.8.2 Run Program from a Chosen Starting Point with Step Log ............................29 4 Assembler and Linker 31 4.1 Process Flow..............................................................................................................31 4.2 Assembler Conventions.............................................................................................32 4.2.1 Statement Syntax .............................................................................................32 4.2.2 Numeric Presentation.......................................................................................33 4.2.3 Arithmetic Operations......................................................................................33 4.2.3.1 True and False.....................................................................................33 4.2.3.2 Summary of the Operators (In the Order of Priority) .........................33 4.3 Program Directives....................................................................................................34 4.4 Conditional Assembly ...............................................................................................39 4.5 Reserved Words .........................................................................................................42 4.5.1 Directives, Operators .......................................................................................42 4.5.2 Instruction Mnemonics ....................................................................................42 4.5.3 Register Name..................................................................................................42 iv • Contents WICE Lite IDE User’s Guide Contents Appendix A. Error Messages 43 A.1 Introduction ...............................................................................................................43 A.2 Main Program Error Messages (Group M) ...............................................................43 A.3 Assembler Error Messages (Group A) ......................................................................45 A.4 Linker “Error Messages (Group L) ...........................................................................50 A.5 Debugger Error Messages (Group D)........................................................................51 B Frequently Asked Questions WICE Lite IDE User’s Guide 55 Contents • v Contents User’s Guide Revision History Doc. Version 1.0 vi • Contents Revision Description User’s Guide initial version Date 2005/06/23 WICE Lite IDE User’s Guide Chapter 1 Chapter 1 Overview WICE Lite IDE is a project oriented integrated development environment (IDE) system that is used to edit user’s application programs and generate emulation/layout files for ELAN's EM78 series and ePV series microcontrollers. The WICE Lite IDE system consisted of the WICE Lite software tool and its relevant E8 in-circuit emulator (E8 ICE). With this integrated tool, you will be able to monitor, test, and evaluate on-line, as well as modify your application programs. The final executable program file (*.CDS) can then be applied and used for the commercial production of the EM78 series and ePV series microcontrollers. 1.1 WICE Lite System Hardware Introduction 1.1.1 Hardware Environment Fig. 1-1 The WICE Lite IDE System Hardware Environment WICE Lite IDE User’s Guide Overview • 1 Chapter 1 1.1.2 E8-ICE Overview FORWARD SIGHT 2 31 32 17((((((((((((((1 18((((((((((((((2 TARGET CONNECTOR 1 2 1 3 LEFT SIGHT TOP SIGHT RIGHT SIGHT PRINTER PORT OFF ON POWER Reset POWER LED RUN LED 4 TARGET LED CRYSTAL SIT 5 RC SIT ADAPTOR E8 - ICE BACKWARD SIGHT Fig. 1-2 E8-ICE Components Overview 1 Printer Port – E8-ICE uses the printer port to communicate with host PC. 2 Target Connector – Connect ICE to the target board through a emulation probe. 3. Reset Button – is used to reset the ICE. 4 3 LED’s Indicators for POWER, RUN, and TARGET. POWER LED indicates the proper connection of the power adaptor between the E8-ICE and AC power. RUN LED indicates that the E8-ICE is currently executing the program. The TARGET LED lights on to indicate that the target board power is supplied by target board. 5 6x2 Pin Socket – This socket is used to adapt the various clock oscillator schemes. The top row of the socket is used for RC type oscillator, and the bottom row is used for CRYSTAL type oscillator. The suitable components (resistor, capacitor, and crystal) should be connected to the socket (see Fig. 1-3 below). Fig. 1-3: Oscillator Connector 2 • Overview WICE Lite IDE User’s Guide Chapter 1 1.2 WICE Lite Program Introduction The WICE Lite program, which runs under WIN95/98, WinME, WinNT4.0, Windows 2000 and Window XP environment; is used among other things, to develop embedded programs for EM78 and ePV series microcontrollers. The embedded program is developed by taking one or more source files in assembly language and translates them into object files that are linked to each other along with one or more libraries. The created executable program (*.CDS) is then downloaded to E8-ICE for simulation, verification, and debugging. See Chapters 2 and 3 for the details on how the WICE Lite program should be installed and how it performs its assigned tasks. 1.2.1 WICE Lite Main User Interface Project Window Editor Window Special Registers Window Menu Bar Tool Bar Data RAM Window Output Window Status Bar LCD Data Window Watch Window Gen. Registers (Bank) Fig. 1-4 WICE Lite Main Window Layout WICE Lite IDE User’s Guide Overview • 3 Chapter 1 1.2.2 WICE Lite Sub-Windows The sub-window may be displayed or hidden by clicking on the pertinent window commands from the View menu (see Section 1.2.3.3) 1.2.2.1 The “Project” Window Project Filename (*.prj) The Project window holds the Source and List Files. Target Microcontroller Where: Files (*.dt) – are the assembly source files that are added into the current project. Fig. 1-5 Project Window References (*.h)– are the files referred to in the Include command line. List Files (*.lst) – are the list files generated by assembler. Map Files (*.map) – are the files generated by the linker. The Title Bar of the Project window shows your current microcontroller and project filename. 1.2.2.2 The “Editor” Window The Editor window is a multi- windowed editing tool for creating, viewing, and modifying source files. The Editor’s major features are – Unlimited file size Multiple files can be opened and displayed at the same time Fig. 1-6 Editor Window Insert (overstrike) mode for editing Undo/Redo Clipboard support (text can be cut, copied, moved, and pasted onto the clipboard using a keystroke) Drag and drop text manipulation (highlighted text can be dragged and dropped between any of the IDE windows) 4 • Overview WICE Lite IDE User’s Guide Chapter 1 1.2.2.3 The “Special Registers” Window The Special Registers window provides the accumulator, control registers, a program counter, general registers from Address 0 to Address 0X1F, and I/O control registers. When value changes, it is shown in red To update register values, click on the existing value and key in the new value. NOTE 1. Only values from 0 to 9 or A to F are recognized when changing register in hexadecimal format. Fig. 1-7 Special Registers Window 2. Likewise, only 0 & 1 are recognized when changing registers in binary format. 3. Modified registers are automatically downloaded to the hardware. 1.2.2.4 The “General Registers (Bank)” Window When value changes, it is shown in red Fig. 1-8 General Registers (Bank) Window The General Registers (Bank) window provides the updated contents of RAM in the same way as in an updated content of the Special Registers. Its contents are updated in the same way as with Special Registers described in the previous section (Section 1.2.2.3). WICE Lite IDE User’s Guide Overview • 5 Chapter 1 1.2.2.5 The “Watch” Window Fig. 1-9 Watch Window Watch window depicts the user defined variables which include addresses and its corresponding values. 1.2.2.6 The “Output” Window Fig. 1-10 Output Window The Output window displays messages indicating the results of project compilation just performed, such as assembler, linker, trace log history, and their respective error messages. Double clicking on the error message will link the error to the corresponding program text line where the source of error occurs. The pertinent source file is automatically opened in the Editor window if not already on display. 1.2.2.7 The “Data RAM” Window Data RAM window is accessible only if RAM is available from the target microcontroller currently in use. The Data RAM format is similar to that of RAM discussed in Section 1.2.2.4, The “General Registers (Bank)” Window. When value changes, it is shown in red Fig. 1-11 Data RAM Window 6 • Overview WICE Lite IDE User’s Guide Chapter 1 Updating of the RAM registers contents is accomplished the same way as that of the Special registers contents (see Section 1.2.2.3, The “Special Register” Window). 1.2.2.8 The “LCD Data” Window (ePV series is not support) LCD Data or LCD Window is accessible only if supported by the target microcontroller currently in use. 2 3 1 Fig. 1-12 LCD Data Window 1. Update: Update the current LCD data to ICE. 2. L: define the top-left corner as the base point (0, 0) of the coordinates. 3. R: define the bottom-right corner as the base point (0, 0) of the coordinates. LCD data Expressions: COM ADDR 1 Bit : common value : LCD data address : with color :which bit of data SEG : segment value DATA :data 0 : no color To update the LCD data, click on the grid block to be modified (toggled) from no color (0) to colored (1) and vise-versa. WICE Lite IDE User’s Guide Overview • 7 Chapter 1 1.2.3 WICE Lite Menu Bar and its Commands Fig. 1-13 Menu Bar 1.2.3.1 File Menu New… Create a new project or source file Open… Open an existing document or project Close Close the active document or project Open/Save/Close Open/Save/Close the active project Project Save Save current active document Save As Save current active document with new filename Save All Save all current active documents Fig. 1-14 File Menu Print Print the active document Recent Files View the record of the recently used file Recent Projects View the record of the recently used project Exit Exit from WICE Lite Program 1.2.3.2 Edit Menu Undo Cancel the last edit action Redo Repeat the last edit action Cut/Copy/Paste Same as standard clipboard function Clear Same function as Delete key Select ALL Select all contents of the active window Fig. 1-15 Edit Menu 8 • Overview Go to Line… Move cursor to the defined line number within the active window Find… Find the defined strings in the active window Replace… Same as standard “find and replace” editing functions WICE Lite IDE User’s Guide Chapter 1 1.2.3.3 View Menu Project Show/hide Project window Special Registers Show /hide Special Register window General Registers Show /hide General (Bank) Register (Bank) window Output Show /hide Output window Fig. 1-16 View Menu Stack Not used in this version Watch Show /hide Watch window Data RAM Show /hide Data RAM window (if supported by the target chip) LCD Data Show/hide LCD Data window (if supported by the target chip) 1.2.3.4 Project Menu New… Create a new project Open Open an existing project Save Save the active project together with all related files Close Close the active Project window Add Files to Project… Delete Files from Project… Assemble File Add the existing source file into project Remove source file from project Assemble the active file only Build Compile modified files only Rebuild All Compile all files regardless of their recent change status Fig.1-17 Project Menu Dump to ICE Dump the program code to ICE Create trace log for “Go,” “Free Run,” or “Go to Trace Log Cursor” command (trace log display is available only after performing this command) Work On External Rom/ Read Line Number/ Not used in this version Software ID Entry/2 Generate Approval Form... Generate an Approval Form (applicable to EM7886x series only) WICE Lite IDE User’s Guide Overview • 9 Chapter 1 1.2.3.5 Debug Menu Go Run program starting from the current program counter until a breakpoint is matched Free Run Run program starting from the current program counter until the OK button of the “Stop Running” dialog is clicked Reset Perform ICE reset (register contents are displayed with initial values) Step Into Execute instructions step-by -step (with register contents updated simultaneously) Step Over Execute instructions as in “Step Into” (see above), but the CALL instruction will execute as “step over” Fig.1-18 Debug Menu Go to Cursor Run program starting from the current program counter up to the location where the cursor is anchored (applies to ICE debug mode only) Continue Step Into Execute “Step Into” command at continues pace (non step-by-step) Select a line from which to start running the Run from Selected Line program Toggle Breakpoint Set or remove a breakpoint Show All Breakpoints Show all breakpoints set-up data in the Output window Add Label to Watch Add or delete variables from the Watch window Reset and Free Run Reset ICE, then execute “Free Run” instruction Reset and Go Reset ICE then execute “Go” instruction Run from Run program from the chosen starting point (selected from the resulting submenu) Address Breakpoint Define breakpoint using address Clear All Breakpoints Clear all breakpoints Clear Watch Clear all variables in Watch window Trace Back Trace the Trace Log step-by-step backward, i.e., from the most recent address toward previous ones Trace Forth Trace the Trace Log step-by-step forward, i.e., from the earliest address toward recent ones 10 • Overview WICE Lite IDE User’s Guide Chapter 1 1.2.3.6 Tool Menu Check ICE Check ICE ROM condition. Memory Response provided only if error is found Piggyback MIX Create a MIX file to write into Format the piggybacked EPROM Fig. 1-19 Tool Menu Piggyback Hi/Lo Create two files with Format extensions “*.hi” and “*.lo” respectively to write into the piggybacked EPROM Get checksum Calculate checksum of the CDS from project file Clear all output Clear program mapping lines mapping line from output window Get Code=1FFF Size Check available space in ROM Get TBL code position Obtain "TBL" position and check available space Piggyback MIX2 Format Create a MIX2 file to write into the piggybacked EEPROM (applicable to EM78813 only) 1.2.3.7 Option Menu Connect Define printer port connection with ICE (default is 378H) Register View Define display format of the Special Registers, hex (default) or binary Debug option Set debugger environment Setting options Fig. 1-20 Option Menu ICE code option Set code option for the selected microcontroller Environment setting Set WICE Lite program mode settings Font… Define font for Editor & Output windows (fonts for other windows are fixed) Dump ASPCM Dump voice data to voice RAM WICE Lite IDE User’s Guide Overview • 11 Chapter 1 1.2.3.8 Window Menu Fig. 1-21 Window Menu Cascade Rearrange all open widows so that they appear overlapping in sequence with their respective title bar fully visible Tile Rearrange and resize all open windows so that they appear fully on the screen without any overlap Arrange Icons Arrange all opened files (minimized into multiple file icons) in a single line formation at the bottom of the Editor window Close All Close all open files 1.2.3.9 Help Menu About… Show the current version of WICE Lite program Help Go to Help dialog Fig. 1-22 Help Menu 12 • Overview WICE Lite IDE User’s Guide Chapter 1 1.2.4 1 2 WICE Lite Tool Bar and its Functions 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Fig. 1-23 WICE Lite Tool Bar The following are the designated function for each of the icons: File Manager Editor Project Manager 1. New File (Ctrl+N) 5. Find (Ctrl+F) 11. Assemble File 2. Open File (Ctrl+O) 6. Cut (Ctrl+X) 12. Build (F9) 3. Save File (Ctrl+S) 7. Copy (Ctrl+C) 4. Save All 8. Paste (Ctrl+V) 9. Undo (Ctrl+Z) 10. Redo (Ctrl+A) Debugger 13. Insert/Remove Breakpoint 14. Go (F5) 15. Reset (F6) 16. Step Into (F7) 17. Step Over (F8) 18. Go to Cursor (F4) 19. Run from the Line 20. Trace Backward 21. Trace Forward 1.2.5 Status Bar 3 Keyboard mode 1 Testing ROM progress indicator Fig. 1-24 WICE Lite Status Bar 2 Editor Window cursor position 1 Whenever WICE Lite is communicating with ICE (during start-up or “Connect” instruction execution), a progress indicator will appear on this field. Otherwise, “READY” will display or the field remains empty. 2 This field indicates the cursor position within the text Editor window. 3 The following keyboard key modes are displayed in these fields: Insert key – “OVR” is displayed when overtype mode is on, and “INS” is displayed when off. Caps Lock key – “CAP” is displayed when uppercase character mode is on. Field is empty when off. Num Lock key – “NUM” is displayed when the numeric keypad calculator mode is on. Field is empty when off. WICE Lite IDE User’s Guide Overview • 13 Chapter 1 14 • Overview WICE Lite IDE User’s Guide Chapter 2 Chapter 2 System Installation 2.1 System Requirements 2.1.1 Host Computer The WICE Lite IDE System requires a host that meets the following configuration: 1. IBM PC or compatible computer (Pentium 100 or greater recommended) 2. Runs under WIN98, WinME, WinNT, Win2000, or WinXP 3. 10MB free hard disk space and 16MB RAM 2.1.2 E8-ICE External Power Source Requires power source of +15.0VDC , 800mA (power adapter) to provide power the E8-ICE. 15VDC Fig. 2-1 E8-ICE DC Connector Configuration NOTE Use of ELAN provided AC power adapter is recommended. 2.1.3 Printer Port Cable Standard 25-pin with DB-25 male connector at one end and DB-25 female connector at the other end. Length of cable should not exceed two meters (6.6 feet) NOTE Use of ELAN provided printer cable is recommended. WICE Lite IDE User’s Guide System Installation • 15 Chapter 2 2.2 Hardware Installation and Setup NOTE Unless otherwise recommended, switch OFF power while mounting or removing modules to and from the E8-ICE. 2.2.1 Connecting E8-ICE to Host Computer and Power Source Plug the DB-25 female connector of the Printer Cable to ICE and the male connector to the printer port of your host computer. With the ICE power switch OFF, plug the power jack of the power adapter to the ICE power connector and plug the adapter to the power source. Connect appropriate clock oscillator (resistor, capacitor, and crystal) to the ICE 6x2 pin socket as discuss and illustrated in Section 1.1.2, E8-ICE Overview in Chapter 1. 2.3 WICE Lite Program Installation The latest version of the WICE Lite IDE System software is available from the ELAN’s website (http//www.emc.com.tw) under Products button. Then click on Microcontroller Line Ä 8-Bit MCU for LCD Product Ä Supporting Tools ÄWICE Lite under which the WICE Lite software is located as illustrated below. You may either download the files to your disk or directly install from the website. Click to download or install the WICE Lite program Fig. 2-2 WICE Lite Program Location within ELAN Website 16 • System Installation WICE Lite IDE User’s Guide Chapter 3 Chapter 3 Getting Started with WICE Lite IDE System 3.1 Hardware Power-up With the E8-ICE properly connected to target board, PC, and power source, switch on ICE power and observe its red power LED lights up. If the target board derives its power from ICE, the yellow LED lights up as well. Then launch your WICE Lite IDE software when ICE and target board power-up is confirmed to function normally. 3.2 Starting the WICE Lite Program To start WICE Lite Program, click on the WICE Lite icon from desktop or from Windows Start menu. When starting from the Start menu, click Programs, then look for ELAN group and click on WICE Lite icon. 3.2.1 Connect Dialog Once the program is started, the main window of the program will initially display the Connect dialog to prompt you to set the proper connection between your existing target microcontroller and printer port (default is 378H). You may also enable the “Check ICE Memory” check box to check the condition of the ICE memory. “I/O Wait Time” depicts the I/O response speed. Increase the value for slower speed and decrease for faster speed. Click OK button when done. Select MCU Port address setup Enable to check ICE memory condition Printer port speed Fig. 3-1 WICE Lite Program Connect Dialog WICE Lite IDE User’s Guide Getting Started with WICE Lite IDE System • 17 Chapter 3 3.2.1 Code Option Dialog Fig. 3-2 WICE Lite Program Code Dialog The Code Option dialog is displayed next. Check all items to confirm the actual status of the ICE and make appropriate changes as required. Then click OK button. 3.3 Create a New Project To create a new project, you need to configure your project with the following steps: 1. From the Menu bar click on File or Project menu and choose New command from the resulting pull-down menu. 2. The New dialog (shown below) will then display if you have clicked the New command from the File menu. Otherwise, New Project dialog will display (Fig. 3-5) if the New command is derived from Project menu. Fig. 3-3 “Project” Menu 3 4 5 6 7 Fig. 3-4 “New” Dialog Showing Project Tab for Creating New Project (Derived from File Menu) 18 • Getting Started with WICE Lite IDE System WICE Lite IDE User’s Guide Chapter 3 3. Select Projects tab from the NEW dialog 4. Assign a name for the new project in the Project Name box (suffix .prj will auto-append to the filename). 4 5 6 7 Fig. 3-5 “New Project” Dialog for Creating New Project (Derived from Project Menu) 5. Locate the folder where you want to store the new project. You may use the Browse icon to find the appropriate folder. 6. Select the target microcontroller for your project from the Micro Controller list box. 7. Click OK button after confirming all your choices and inputs. The new project is created with the defined project name and microcontroller you have selected is displayed on top of the Project window. Target Microcontroller Project Filename (*.prj) Fig. 3-6 “Project (File View)” Window WICE Lite IDE User’s Guide Getting Started with WICE Lite IDE System • 19 Chapter 3 3.4 Add and Remove Source Files from/to Project You can either insert existing source files into the new or existing project, or create new ones with WICE Lite text Editor and insert them into the project. 3.4.1 Create and Add a New Source File for the Project If your source file is yet to be created, you can take advantage of the New dialog (by clicking New command from the File menu) to create your new source file and use the WICE Lite text editor to compose its content. 1. Click the File tab of the NEW dialog and select the type of source file you want to create from the EMC Source File list box, i.e., *.dt (default) for assembly file; *.h for header file, and *.txt for text file. 2 1 3 4 5 Fig. 3-7 “New” Dialog Showing Project Tab for Creating a New Source File 2. Check Add to Project check box (default) if you want to automatically add the new file into your project. Otherwise clear the check box. 3. Assign a filename for the new source file in the File Name box. 4. Locate the folder where you want to store the new source file in your disk. You may use the Browse icon to find the appropriate folder. 5. Click OK button after confirming your inputs. You will be prompted to start writing the newly defined source file in the Editor window. 20 • Getting Started with WICE Lite IDE System WICE Lite IDE User’s Guide Chapter 3 3.4.2 Add Existing Source Files to the New Project If your source file is ready, you can immediately insert it into your new project. 1. From the Menu bar, click on Project menu. Choose Add Files to Project command from the resulting pull-down menu, and then the Open dialog is displayed. Fig. 3-8a “Add Files to Project” Command Fig. 3-8b “Open” Dialog 2. Browse and select the file (or multiple files) you intend to insert into the new project. 3. Click OK button after confirming your choice. 3.4.3 Deleting Source Files from Project 1. From the Project window, select the file(s) you wish to delete. Then press the Delete key from your keyboard. 2. You may also click on the Delete Files from Project… Fig. 3-9a Deleting Project Files Directly from “Project” Window command from the Project pull-down menu to delete files from project. Select the file(s) to delete from the Delete files from project dialog and click Deleted files from project button. Fig. 3-9b Deleting Project Files from “Delete File from Project” Dialog WICE Lite IDE User’s Guide Getting Started with WICE Lite IDE System • 21 Chapter 3 3.5 Editing Source Files from Folder/Project 3.5.1 Open Source File from Folder for Editing You can also open an existing source file in the Editor window for a last minute editing before adding it into the new project. To do this– 1. From the Menu bar click on File or Project menu, choose Open command from the resulting pull-down menu. 2. From the resulting Open dialog (Fig. 3.8b above) click on the source file and the file is automatically opened in the Editor window. To edit source files that are already added into the Project, see next Section. 3.5.2 Fig. 3-10 Open &Edit Source File from “File“ & “Project” Menus Open Source File from Project for Editing You can edit source files that are already inserted in the project. To do so, double click the source file you wish to edit from the Project window and the file will open in the Editor window. Double click to open & edit file Source file opened for editing Fig. 3-11 Editing Source File Directly from Project 22 • Getting Started with WICE Lite IDE System WICE Lite IDE User’s Guide Chapter 3 3.6 Assemble and Link the Project With your source file(s) embedded into the project, you are now ready to compile your project using the following commands from Project menu. Click Assemble File command to assemble and link the active file only (generates *.bbj & *.lst files). Click Build command from the Project menu to assemble and link only those source files that are recently modified. Fig. 3-12 Assemble & Link Commands Click Rebuild All command to assemble and link all files in the project regardless of whether they were modified or not. Build and Rebuild All will generate objective (*.bbj) file, list (*.lst) file, binary (*.cds) file, and map (*.map) file. The compiled files are automatically saved in the same folder where your other source files are located. Status of the assembly operation can be monitored from the Output window as shown below. Fig. 3-13 Output Window Showing Successful Assembly & Link Compilation If error is detected during compilation, pertinent error message will also display in the Output window. Double click on the error message to link to the source of error (text line) in the corresponding source file displayed in the Editor window. If the corresponding source file is not currently opened, it will open automatically. Double click to link to the source of error Fig. 3-14 Output Window Showing Assembly & Link Compilation Errors Modify source files to correct the errors and repeat assemble and link operations. WICE Lite IDE User’s Guide Getting Started with WICE Lite IDE System • 23 Chapter 3 3.7 Dumping the Compiled Program to ICE With the source files deprived of its errors and successfully compiled, download your compiled program to ICE using the Dump to ICE command from Project drop-down menu or its corresponding shortcut key (F3). Fig. 3-15 “Dump to ICE” Command 3.8 Debugging a Project With the compiled program successfully downloaded to ICE, you are now ready to debug the files. Be sure the ICE is properly connected to your computer. Full debugging commands are available from the Debug Menu (shown with its corresponding shortcut keys in the drop-down menu at right). A number of the frequently used debugging icons are also available from the WICE Lite Program Toolbar. Fig. 3-16a Toolbar for Debugging Commands Toggle Breakpoint – Click with cursor positioned on the line where a breakpoint is going to be set or removed. F5 Fig. 3-16b Debugging Commands Drop-Down Menu Go – Run program starting from the current program counter until breakpoint is matched and breakpoint address is executed. Reset – Perform hardware reset (register contents are displayed with initial values). ICE will return to its initial condition. F6 Step Into – Execute instructions step-by-step (with register contents updated at the same time). F7 Step Over – Same as “Step Into” command (see above), but the CALL instruction is executed as “Go” command. F8 24 • Getting Started with WICE Lite IDE System WICE Lite IDE User’s Guide Chapter 3 Go to Cursor – Run program starting from the current program counter up to the location where the cursor is anchored (applies to ICE debug mode only). F4 Run from Selected Line – Select a line from which to start running the program. Trace Backward – Trace the Trace Log step-by-step backward, i.e., from the most recent address toward previous ones Trace Backward – Trace the Trace Log step-by-step forward, i.e., from the earliest address toward recent ones F10 Free Run – Run program starting from the current program counter until the OK button of the “Stop Running” dialog is clicked. All defined breakpoints are ignored while the program is running. During debugging, the contents of Program Counter, Registers, and RAMs are read and displayed each time the program is stopped to provide important interim information during program debugging. 3.8.1 Breakpoints Setup To assign a breakpoint, position cursor on the line where a breakpoint is going to be set, then double click. Observe the line highlighted in brown. You can also click on the Insert/ Remove Breakpoint icon (hand shape) on the toolbar to set a breakpoint. Breakpoints Fig. 3-17 Active Source File with a Defined Breakpoint Likewise, the defined breakpoint is cleared if you double click on it again, or the hand icon is clicked the second time while the cursor positioned on the defined breakpoint. To clear all existing breakpoints, click Clear All Breakpoints command from Debug menu. WICE Lite IDE User’s Guide Getting Started with WICE Lite IDE System • 25 Chapter 3 3.8.1.1 Setting Breakpoint Pass Count Breakpoints are the combinations of addresses and pass count (breakpoint counter). A program will stop as the contents of the program counter matches with one of the defined addresses and its corresponding pass count decreases to zero. The default pass count (breakpoint counter) is one. To modify the pass count, click Debug Option Setting command from Option menu and redefine pass count (1 ~ 255) from the resulting Debug Setting dialog. Fig. 3-18a “Debug Option Setting” Command Set to “0” to display breakpoint Input Counter dialog every time a breakpoint is set. Fig. 3-18b “Debug Setting” Dialog If you need to change the pass count setting every time you set a breakpoint, set the pass count in the Debug Setting dialog to “0” before setting breakpoint. At every subsequent breakpoint setup, you will be then prompted to provide a new pass count through the following Input Counter dialog. Fig. 3-18C “Input Counter” Dialog To disable the feature, change the breakpoint counter value in the Debug Setting dialog to any value from 1 to 255. 26 • Getting Started with WICE Lite IDE System WICE Lite IDE User’s Guide Chapter 3 3.8.1.2 Other Settings in the “Debug Setting” Dialog 1 2 3 Fig. 3-19 Other Settings in the “Debug Setting” Dialog 1 When check box is enabled, WICE Lite will check the ICE memory before dumping codes. 2 Interrupt will be disabled as a breakpoint occurs when the check box is enabled. This is to avoid any interrupt from occurring during screen update, as the TCC, COUNTER1, and COUNTER2 will keep on working after program has stopped. Therefore, the interrupt must be disabled; otherwise you cannot debug the program. 3 By default, the Output window displays the trace log of disassembler contents. Enable this check box to make Output window display the address source level breakpoint produced by trace log. 3.8.1.3 Defining Address as Breakpoint The address breakpoint method is in conflict with source level breakpoint. Hence, by default, address breakpoint is inactive when the source level breakpoint is in effect and vise-versa. To define address as breakpoint, click Address Breakpoint command from Debug menu (or Alt+A) and the Address Breakpoint dialog (shown below) will display. Fig. 3-20a “Address Breakpoint” Command from Debug Menu Fig. 3-20b Address Breakpoint Dialog WICE Lite IDE User’s Guide Getting Started with WICE Lite IDE System • 27 Chapter 3 From the dialog, click one of the address breakpoint option (Group, OR, & Nest) buttons. These options are explained below: NOTE ■ By default, the dialog shows “Address breakpoint not active” selected. ■ The three (Group, OR, & Nest) types of address breakpoint are unique from each other. However, the syntax set-up for OR and Nest is the same, but different from that of Group. Breakpoint Group: There can be 63 breakpoint groups at most and each group has its own individual start address, end address, and pass count. Every time an instruction is executed between start address and end address, pass count value is reduced by 1. When pass count is equal to “0,” the executing program is stopped at once. All breakpoint groups are independent from each other. Breakpoint OR: There can be 63 breakpoint groups at most. Each group is composed of several addresses and a pass counts. When an address is executed within a group, the pass count value is reduced by 1. When the pass count is to equal “0,”, a breakpoint occurs. All breakpoint groups are independent from each other. Breakpoint Nest: Assign a number of address locations as groups and specify those groups as a breakpoint nest. The outer (most recently specified) groups must be satisfied first before the inner groups can take effect. Breakpoint nest and program line breakpoints are exclusive. i.e., if breakpoint nest is active, then program line breakpoints are inactive. Likewise, if breakpoint nest is inactive, then program line breakpoints are active. The steps below explain how breakpoint nest is set: Step 1 Click the “Breakpoint nest” option button from the Address Breakpoint dialog. Step 2 Input breakpoint address. If address breakpoint is for (0x10 0x20 0x30, 0x55) and (0x15 28 • Getting Started with WICE Lite IDE System Fig. 3-21 Breakpoint Nest Setup WICE Lite IDE User’s Guide Chapter 3 0x100 0x170, 0x10), assign address locations 0x10, 0x20, and 0x30 to the same group or Group 1. A breakpoint is then attached to Group 1. The associated pass count for this breakpoint is 0x55. Address locations 0x15, 0x100, and 0x170 are assigned to another group or Group 2 and a breakpoint is attached to this group. The associated pass count of this breakpoint is 0x10. Step 3 Press OK button. Step 4 Execute Go command (F5). Step 5 If Group 2 must be satisfied (pass count decrements to 0) then Group 1 will take effect (decrease its pass count on matching the breakpoint condition). As soon as all groups are satisfied, the execution is stopped at the breakpoint. 3.8.2 Run Program from a Chosen Starting Point with Step Log You can run program from initial address or current PC with step log stored in the trace buffer. The stored execution history may be 8K or 4K–4K in size. To activate this feature, click and hold on the Run from command of Debug menu and click on the preferred running configuration as explained below. Fig. 3-22 “Run from” Command Sub-Menu Initial with 8K Step Log: Run program starting from the initial address until breakpoints are matched. The last 8K steps of execution history are logged and stored in the trace buffer. Current PC with 8K Step Log: Run program starting from the current program counter (PC) until breakpoints are matched. The last 8K steps of execution history are logged and stored in the trace buffer. WICE Lite IDE User’s Guide Getting Started with WICE Lite IDE System • 29 Chapter 3 Initial with 4K-4K Step Log: Run program starting from the initial address until breakpoints are matched. The execution history of the last 4K steps before breakpoint and the 4K steps following it, are logged and stored in the trace buffer. Current PC with 4K-4K Step Log: Run program starting from the current program counter (PC) until breakpoints are matched. The execution history of the last 4K steps before breakpoint and the 4K steps following it, are logged and stored in the trace buffer. 30 • Getting Started with WICE Lite IDE System WICE Lite IDE User’s Guide Chapter 4 Chapter 4 Assembler and Linker 4.1 Process Flow *.dt or *.asm Including files EASM EASM EASM List file (*.lst) Object file (*.obj) ELAN Linker Map file(*.map) Target file (*.cds) Fig. 4-1 Assembler & Linker Process Flow WICE Lite IDE User’s Guide Assembler and Linker • 31 Chapter 4 4.2 Assembler Conventions 4.2.1 Statement Syntax The statement syntax is shown in the following format: [label[:]] operator [operand] [,operand] [; comment] Where: [ ]: Characters enclosed in brackets are optional Space & Tab: Used to separate elements from each other Label: The colon ( : ) is optional and is followed by one or more spaces or tabs. A label may consists of alphabets, digits, and underscores (Ex: A~Z a~z 0~9 _ ). NOTE ■ The digit character (0~9) must not be the first character of a label. ■ Only the first 31 characters are recognized ■ Use of colon ( : ) is recommended as it is more legible. Operator: An assembler instruction or directive. Directives provide the direction to the assembler, specifying the manner with which the assembler is to generate object code during assembly execution. Instruction Examples: MOV ADD A,@0X20 A,@0X20 Directive Examples: ORG 0X20 END Operand: There can be one or more operands separated by commas. Comment: A comment can be a line comment or block comment. Line comment is preceded by a semi-colon ( ; ). Example: MOV A,@0X20 ; move constant value 32 to accumulator Block comment begins with “/*” and ends with “*/”. NOTE All fields are NOT case-sensitive and are separated by spaces or tabs. 32 • Assembler and Linker WICE Lite IDE User’s Guide Chapter 4 4.2.2 Numeric Presentation Type Expression 1 Expression 2 Expression 3 0D<digits> <digits>D <digits> Decimal Hexadecimal 0X<digits> - - Octal 0Q<digits> <digits>Q - Binary 0B<digits> <digits>B - Note: In Expression 2, hexadecimal presentation, if the first character is not a digit (A~F or a~f)), it must be prefixed with a zero ( 0 ). 4.2.3 Arithmetic Operations All the assembler arithmetic operations are evaluated during assembly period. Errors will be generated if a value is not successfully calculated while assembling. The assembler uses integer operation and will translate floating point value to integer automatically. 4.2.3.1 True and False The assembler uses 0xFF as TRUE and 0x00 as FALSE. 4.2.3.2 Summary of the Operators (In the Order of Priority) 1. Parentheses: (and) 2. Unary operators: ! Logical NOT ~ Complement − Unary minus 3. Multiplication arithmetic operators/shift operators: × Multiplication / Division % Modulo << Logical shift left >> Logical shift right 4. Addition arithmetic operators: + Addition − Subtraction 5. Bit AND: & 6. Bit OR: |; Bit XOR: ^ 7. Logical AND: && 8. Logical OR: || WICE Lite IDE User’s Guide Assembler and Linker • 33 Chapter 4 9. Comparison operators: == equal (double =) != not equal > greater than < less than >= greater than or equal <= less than or equal 4.3 Program Directives ORG: Set value of program counter ORG <expression> Example: ORG 0x200 EQU or ==: (Double =); define a constant in assembler time <label> EQU <expression> <label> = = <expression> Example: R20 R20 EQU == 0x20 0x20 Line Comment: Use semicolon (;) ; <string> Example: ; This is a line comment Block Comment: Use /* and */ /* <strings> */ Example: /* This is a multi-line block comment */ 34 • Assembler and Linker WICE Lite IDE User’s Guide Chapter 4 EOP: End of the program ROM page of the current EOP instruction EOP Examples: ORG MOV INC EOP INC 0x10 0x20,A 0x20 0x20 Above program source will be allocated as follows: Address Source Program 0010 0011 0400 ORG MOV INC EOP INC 0x10 0X20, A 0x20 0x20 END: End of the program END All codes after the END directive will be discarded (NOT ASSEMBLED). Examples: org mov inc end mov 0x10 0x20,a 0x20 0x20,a Above program source will be allocated as follows: Address Source Program 0010 0011 0400 ORG MOV INC END MOV WICE Lite IDE User’s Guide 0x10 0X20, A 0x20 0x20, A Assembler and Linker • 35 Chapter 4 PROC, ENDP: Procedure definition keywords <label> PROC <statements> ENDP These keywords are used in defining subroutines and to improve program legibility. Examples: Bank0: PROC BC BC RET ENDP 0x04, 6 0x04, 7 NOTE The PROC/ENDP directives will not take effect while assembling. They only improve the legibility of the program. You have to use the “RET” instruction for subroutine return. INCLUDE: Two types of include statement are available, one applies to System Default files, and the other is applicable to User Defined files. a) The Include System Default files are suffix with *.INC, e.g., EMC456.INC, EMC32.INC, etc. INCLUDE <filename> Example: INCLUDE <EMC456.INC> b) The Include User Defined files must have its full path specified. Otherwise, the default path will be used, that is, the location of the current source files. INCLUDE “file path + file name” Example: INCLUDE 36 • Assembler and Linker “C:\EMC\TEST\TEST456.INC” WICE Lite IDE User’s Guide Chapter 4 PUBLIC and EXTERN: The defined scope for the global label is public or external. Although WICE Lite software is project oriented, a project can contain two or more files. If the global label is referenced by another file, the global label must be defined as PUBLIC in the defined file, and must be defined as EXTERN in the referenced file. PUBLIC <label> [,<label>] EXTERN <label>[,<label>] PUBLIC and EXTERN instructions can be defined in any place of a file that contains one or more PUBLIC or EXTERN instructions. Example: A project contains two files, one is TEST1.DT; the other is TEST2.DT. TEST1.DT: org Public Extern Start: mov mov jmp 0x00 start loop1 a,@0x02 0x20,a loop1 TEST2.DT: Org 0x100 Public loop1 Extern start Loop1: inc 0x20 jmp start The “Start” label, which is defined in the “TEST1.DT” file and is referenced by the “TEST2.DT”file, must be announced as “PUBLIC” in the “TEST1.DT” file and “EXTERN” in the “TEST2.DT” file. The “Loop1” label, which is defined in the “TEST2.DT” file and is referenced by the “TEST1.DT” file, has to be addressed as “EXTERN” in the “TEST1.DT” file and “PUBLIC” in the “TEST2.DT” file. WICE Lite IDE User’s Guide Assembler and Linker • 37 Chapter 4 VAR: Defines assembler time variables Label VAR <expression> The value of the variable is valid only during assembly time Example: test var 1 mov test mov a,@test var test+1 a,@test MACRO, ENDM: Macro definition statement <label> MACRO <parameters> statements ENDM Example: Bank0 MACRO 0x04, 6 0x04, 7 BC BC ENDM MACEXIT: Macro exit statement MACEXIT The command is only applicable to macro defined instruction. If the MACEXIT instruction is assembled, then the remaining instructions in the macro are not assembled. Examples: Source: test bank0 var 5 macro bc 0x04,6 if test>4 macexit endif bc 0x04,7 endm bank0 After assembly, the following will result: Address 0000 Source Program bc 0x04,6 Because “test” variable is equal to five, so the expression “test>4” is true, and the MACEXIT instruction is assembled. And because MACEXIT instruction is assembled, the remaining instructions of the macro “bc 0x04,7” are not assembled. 38 • Assembler and Linker WICE Lite IDE User’s Guide Chapter 4 MESSAGE: Displays user defined message in the Output window MESSAGE “<characters>” Examples: ORG 0x0000 MESSAGE “set bank to 0 !!” BC 0x04, 6 BC 0x04, 7 The output window will display: “USER MESSAGE: set bank to 0 !!” $: Current program counter value $ User can use this directive as operand Example: JMP $ Jump to current line which is an infinite idle loop. 4.4 Conditional Assembly IF, ELSEIF and ENDIF: IF conditional directives IF <expression> <statements> [ELSEIF <expression> <statements>] [ELSE <statements>] ENDIF If the expression after the IF directive is “true,” the assembler will assemble the subsequent source lines until ELSEIF/ELSE/ENDIF directives are encountered. WICE Lite IDE User’s Guide Assembler and Linker • 39 Chapter 4 Example: ORG 0x0000 Bank MACRO num IF num==0 BC 0x04, 6 BC 0x04, 7 ELSEIF num==1 BS 0x04, 6 BC 0x04, 7 ELSEIF num==2 BC 0x04, 6 BS 0x04, 7 ELSEIF num==3 BS 0x04, 6 BS 0x04, 7 ELSE MESSAGE Error: bank num over max !!!” ENDIF ENDM IFE, ELSEIFE, and ENDIF: IFE conditional directives IFE <expression> <statements> [ELSEIFE <expression> <statements>] [ELSE <statements>] ENDIF If the expression after the IFE directive is “false,” the assembler will assemble the subsequent source lines until ELSEIFE/ELSE/ENDIF directives are encountered. 40 • Assembler and Linker WICE Lite IDE User’s Guide Chapter 4 IFDEF, ELSEIFDEF, and ENDIF: IFDEF conditional directives IFDEF <label> <statements> [ELSEIFDEF <label> <statements>] [ELSE <statements>] ENDIF If the label after the IFDEF directive has been defined, the assembler will assemble the subsequent source lines until ELSEIFDEF/ELSE/ENDIF directives are encountered Example: org ifdef 0x00 ice456 equ ice456 bc 0x04,6 bc 0x04,7 456 endif IFNDEF, ELSEIFNDEF, and ENDIF: IFNDEF IFNDEF conditional directives <label> <statements> [ELSEIFNDEF <label> <statements>] [ELSE <statements>] ENDIF If the label after the IFNDEF directive has been defined, the assembler will assemble the subsequent source lines until ELSEIFNDEF/ELSE/ENDIF directives are encountered WICE Lite IDE User’s Guide Assembler and Linker • 41 Chapter 4 4.5 Reserved Words 4.5.1 Directives, Operators 4.5.2 + != ) >> || $ ! & < * @ ~ | <= / # % ^ > == ( << && >= DS ELSEIFNDEF ENDP IFDEF MODULE PUBLIC ELSE END EQU IFNDEF NOP ELSEIF ENDIF EXTERN INCLUDE PAGE ELSEIFDEF ENDM IF MACRO ORG ELSEIFE ENDMOD IFE MACEXIT PROC BC COMA DECA INC JBC MOV RETL SLEP XOR BS CONTR DISI INCA JBS NOP RLC SUB CALL CONTW DJZ INT JMP OR RLCA SWAP Instruction Mnemonics ADD CLR DAA DJZA IOR JZ RET RRC TBL 4.5.3 AND COM DEC ENI IOW JZA RETI RRCA WDTC Register Name A 42 • Assembler and Linker WICE Lite IDE User’s Guide Appendix A Appendix A Error Messages A.1 Introduction Error messages are categorized into the 4 groups, i.e., Groups M, A, L, and D, whereby: Group M error messages pops out when the main program is executed incorrectly. Group A error messages are displayed whenever syntax errors occur, for instance, during assembly. Group L error messages show up when linking errors occur during a project built or rebuilt process. Group D error messages describe the errors that take place during debugging of the program. A.2 Main Program Error Messages (Group M) “Error M001: Numbers of opening editor windows are over limitation” Cause: Opened number of Editor windows exceeds maximum limit. Solution: Close some unnecessary Editor windows. “Error M002: Memory is not enough to allocate Editor Window” Cause: Inadequate allocated memory for system Editor window. Solution: Close some unnecessary Editor windows or unexecuted application programs in the system. “Error M003: File: [filename] is existed.” Cause: Filename already exist and cannot be duplicated. Solution: Rename file to make its filename unique from others and save again. “Error M004: File: [filename] can not be created" Cause: The application is notified that OS cannot create the defined file. Solution: Check whether the disk is already full or whether the system is unstable. WICE Lite IDE User’s Guide Error Messages • 43 Appendix A “Error M005: One project has been opened.” Cause: If a project is already opened in WICE, then you cannot open a second one. Solution: Close the current open project, and then open another one. “Error M006: Project: [filename] can not be created.” Cause: The application is notified that OS cannot create the defined project. Solution: Check whether the project is empty or not. “Error M007: The file [filename] has already existed in the project.” Cause: The file you are trying to add is already included in the project. Solution: Stop trying to add the file into the project again. “Error M008: File: [filename] can not be saved.” Cause: The file cannot be saved into the disk. Solution: Check whether filename has been entered, disk is full, system is in error, or system is infected with virus. “Error M009: The project: [filename] is not the format of EMC project file.” Cause: The contents of the project are not in ELAN project format. Solution: Create a completely new project, and add the file into the project. “Error M010: The file: [filename] does not exist.” Cause: The file cannot be found in the corresponding folder. Solution: Check whether the file is in error or whether it exists in the corresponding folder. “Error M011: The File: [filename] can not be opened.” Cause: The file cannot be opened by OS. Solution: Check whether the file is in error or whether it exists in the corresponding folder. “Error M012: The file: [filename] exceeds [number]k of the max size [number]k.” Cause: The file size exceeds the maximum allowed size for the buffer allocated for editing. Solution: Partition the file into two or more files. “Error M013: The copy size: [number] exceeds [number]k of the max size [number]k.” Cause: The contents of the copy parameter exceed the maximum size allowed for the copy buffer. Solution: Reduce the contents of the copy parameter. 44 • Error Messages WICE Lite IDE User’s Guide Appendix A “Error M014: Memory can not be allocated.” Cause: System can not allocate more memory for your use. Solution: Close unnecessary Editor windows or unexecuted application programs in the system. “Error M015: Over 250 characters of a line.” Cause: The maximum number of characters in an Editor window line should not exceed 250. Solution: Break the line into two or more lines. “Error M016: The extension name of the active file [filename] is not .dt or .asm.” Cause: The extension name of the active file is invalid (does not have the required “DT” or “ASM” extension). Solution: Change the active file with another file that has an extension name of “DT” or “ASM.” “Error M017: No file to be assembled.” Cause: Cannot find the file to be assembled or the file is not selected. Solution: Select a file to be assembled. “Error M018: Project file must be created.” Cause: Project file not available. Solution: Open or create a project. “Error M019: The editor number is over the max. editor number.” Cause: The number of opened Editor windows exceed limit. Solution: Close some of the unnecessary Editor windows. “Error M020: No active editor window.” Cause: The current active window is not the Editor window. Solution: Select Editor window as the current active window. “Error M021: Text field must be input by characters.” Cause: The text field is empty (should contain characters). Solution: Input characters. A.3 Assembler Error Messages (Group A) “Error A001: Can not find the [filename] file.” Cause: The file is not found in the folder. Solution: Check whether the file is in error or whether it exists in the corresponding folder. WICE Lite IDE User’s Guide Error Messages • 45 Appendix A “Error A002: Main and subroutine programs can not define [label name] local label.” Cause: The local label (prefixed with label symbol “$”) is incorrectly defined in the main and subroutine programs. Solution: Remove the local label from the main or subroutine program. “Error A003: The syntax form should be: operation [operand] [,operand]” Cause: The syntax format of the statements is in error. Solution: To correct format as “operation [operand][,operand]” “Error A004: The label [label name] is redefined.” Cause: The defined label already exists. Solution: Redefine the label name to make unique from others. “Error A005: The EQU syntax is: label EQU operand.” Cause: The EQU syntax is in error. Solution: Correct error of the line with appropriate syntax. “Error A006: The INCLUDE nest depth is over 256.” Cause: The maximum “INCLUDE” nest depth level is exceeded. Solution: Decrease the nest depth to within 256 maximum level. “Error A007: “The IF conditional expression is error.” Cause: The expression “IF conditional” is in error. Solution: Modify the “IF conditional” with correct expression. “Error A008: Attempt to divide by zero.” Cause: An attempt is made to divide the number expression by zero. Solution: Avoid dividing number expression by zero which is illegal. “Error A009: The assembler does not support floating point.” Cause: A non-supported floating point arithmetic is defined as the assembler number system. Solution: Change the floating point to an integer. “Error A010: The symbol [symbol name] is not defined.” Cause: The pertinent symbol is not found (not defined). Solution: Define the proper symbol. “Error A011: The macro name [macro name] is redefined.” Cause: The defined macro name already exists (duplicated). Solution: Change the macro name to an unique one. 46 • Error Messages WICE Lite IDE User’s Guide Appendix A “Error A012: The parameter name [parameter name] is the same as label.” Cause: The parameter name and label are identical (should be unique from each other). Solution: Redefine the parameter name to differ from label. “Error A013: The parameter name [parameter name] is the same as another one.” Cause: The parameter name is duplicated (must be unique from others in the macro definition). Solution: Redefine the parameter name with unique one. “Error A014: The number of actual parameter does not match with formal parameter.” Cause: The ordinal number of actual parameter does not match with the number of formal parameter (or vise-versa). Solution: Change the ordinal number of either actual or formal parameter to correct one to make them match with each other. “Error A015: The parameter number [number] does not exist.” Cause: The ordinal number in the actual parameter is incomplete or not defined. Solution: Provide the missing ordinal number or change the number of actual or formal parameter with correct one. “Error A016: The external symbol [symbol name] is the same name as defined label.” Cause: The external symbol name and the internal defined label are identical. Solution: Modify the internal defined label to differ from external symbol name. “Error A017: Address of ORG is error.” Cause: The defined ORG address definition is in error. Solution: Redefine the ORG definition with correct address. “Error A018: MACEXIT can not be set outside macro.” Cause: The “MACEXIT” instruction is set outside the macro definition. Solution: Either remove the “MACEXIT” macro instruction or insert inside the macro definition. “Error A019: Parameter must be string variable.” Cause: The formal parameter is not defined as a string. Solution: Change the formal parameter to string. WICE Lite IDE User’s Guide Error Messages • 47 Appendix A “Error A020: Memory can not be allocated.” Cause: OS memory already full. Solution: Close some Editor windows or applications that are not currently needed. “Error A021: The source statements exceed [number] lines.” Cause: The number of lines in the source file exceeds the system default limit. Solution: Split the program into two or more smaller programs. “Error A022: The tree is error because of parser error.” Cause: The program line syntax is in error. Solution: Rewrite to correct the program line. “Error A023: [allocated memory type] memory fault when memory is allocated.” Cause: OS memory already full. Solution: Close some Editor windows or applications that are not currently needed. “Error A024: Setting assembler variable must be integer value.” Cause: The result of the expression to the right of “SET” instruction in not an integer value. Solution: Change the expression into an integer value. “Error A025: Address of ORG must be integer value.” Cause: The ORG address is not an integer value. Solution: Rewrite the ORG address expression as an integer value. “Error A026: The [number] address of PC is out of [number] ROM size.” Cause: The program counter address exceeds the program ROM size. Solution: Decrease the code size. “Error A027: The assembler exceeds max. pass [number].” Cause: The assembler pass exceeds the maximum default pass. Solution: Check the assembler for errors. “Error A028: The operand [number] value does not include the valid data. “ Cause: The operand value is invalid. Solution: Change the operand with valid value. 48 • Error Messages WICE Lite IDE User’s Guide Appendix A “Error A029: The [number] address is conflicted.” Cause: The program address is in conflict with another address. Solution: Use the “[Edit][Find]” menu to find the conflicting address in the list file; then update the program position with proper address. “Error A030: The file [file name] can not be opened.” Cause: The indicated file cannot be opened, i.e., in error or missing. Solution: Check whether filename is in error or the file does not exist. “Error A031: The configure file read error.” Cause: The file configuration format is not correct. Solution: Set up WICE Lite software again. “Error A032: The file [file name] can not be opened.” Cause: The indicated file cannot be opened, i.e., in error or missing. Solution: Check whether filename is in error or the file does not exist. “Error A033: The macro is not defined.” Cause: The stated macro name cannot be found, i.e., not defined or in error. Solution: Define a new macro or correct the existing macro name. “Error A034: The expression can not be calculated.” Cause: The expression format is in error. Solution: Modify the expression with correct format. “Error A035: The operation [operation name] is not defined.” Cause: The operation name is missing or not defined by WICE. Solution: Check WICE Lite user menu for valid operators. “Error A036: The PUBLIC or EXTERN label [label name] must be address label.” Cause: The label defined by “PUBLIC” or “EXTERN” instruction is not an address label. Solution: Remove the Public or Extern variable. “Error A037: The operand value can not be calculated.” Cause: The operand expression format is incorrect. Solution: Modify the operand expression with correct format. “Error A038: The symbol [symbol name] is not extern symbol.” Cause: The symbol is not defined as internal or external. Solution: Redefine the symbol with appropriate symbol name. WICE Lite IDE User’s Guide Error Messages • 49 Appendix A “Error A039: The reference number is over [number] limitation.” Cause: The number of references in the “PUBLIC” or “EXTERN” instruction exceeds limit. Solution: Split the number of references into two or more lines. “Error A040: The length of file name [file name] exceeds 256.” Cause: The length of filename is over 256 characters. Solution: Decrease the length of filename to within 256 characters. A.4 Linker “Error Messages (Group L) “Error L001: Memory of [stack type] stack overflows.” Cause: OS cannot allocate extra memory (memory full). Solution: Close Editor windows or applications that are not currently used. “Error L002: The file [file name] can not be found.” Cause: The file is not found in the folder. Solution: Check whether the file is in error or whether it exists in the corresponding folder. “Error L003: The Object file format does not belong to EMC object file format.” Cause: The object file is not in ELAN format. Solution: Reassemble the source file. “Error L004: Symbol [symbol name] is not defined.” Cause: The symbol is missing, i.e., not defined. Solution: Define the symbol. “Error L005: Public symbol [symbol name] is conflicted.” Cause: The public symbol is in conflict with another symbol. Solution: Redefine the public symbol. “Error L006: ROM address [number] is conflicted.” Cause: The program address is in conflict with another address. Solution: Use the “[Edit][Find]” menu to find the conflicting address in the list file; then update the program position with proper address. “Error L007: The file [file name] can not be created.” Cause: The system refuses to create the file. Solution: Check whether the disk is full or not. If disk is okay, try rebooting the system. 50 • Error Messages WICE Lite IDE User’s Guide Appendix A “Error L008: Line [number]: The machine address [number] exceeds ROM size [number].” Cause: The program address exceeds ROM size. Solution: Decrease the program code. “Error L009: No project file is active.” Cause: No project is opened or created. Solution: Open or create a project. “Error L010: No output window is found.” Cause: Output window is not displayed. Solution: Click on “[View][Output]” menu. The Output window should now display. A.5 Debugger Error Messages (Group D) “Error D001: The ICE memory is error.” Cause: The SRAM in the ICE is error. Solution: Change the ICE SRAM. “Error D002: CDS size = [number] does not match the ROM size = [number].” Cause: The CDS size does not match with what ROM has defined. Solution: Check the ICE microcontroller type (part number) to be sure that it is the same as defined by WICE. “Error D003: The project MCU type [type name] does not match [ICE name] ICE.” Cause: The project MCU type (part number) is not the same as defined by WICE. Solution: Create a new project or reconnect to ICE with correct MCU.. “Error D004: The line of file does not transfer to machine address.” Cause: The program line is unable to assemble. Solution: Check the syntax of the program line for error. “Error D005: The breakpoint group number is over 64 .” Cause: The number of breakpoint groups is over maximum limit of 64. Solution: Remove the extra breakpoint groups. “Error D006: The ICE is not connected to PC.” Cause: ICE not properly connected to PC. Solution: Check power supply, ICE crystal, printer port connector, etc. WICE Lite IDE User’s Guide Error Messages • 51 Appendix A “Error D007: The printer port is not connected.” Cause: The printer port not properly connected to PC. Solution: Check power supply, parallel port connector, etc. “Error D008: The number is invalid.” Cause: The number expression is invalid. Solution: Rewrite with correct number expression. “Error D009: The number of messages is over [number].” Cause: The number of messages exceeds the Output window capacity. Solution: Decrease the defined number of message, e.g., in the “MESSAGE” instruction. “Warning D010: The address [number] does not match the source file.” Cause: The program address does not match with the source file line. Solution: Add the missing program source to the address, or check and verify that crystal is functioning normally. “Warning D011: Memory checked is error.” Cause: The ICE SRAM memory is in error. Solution: Change the ICE SRAM or check and verify that crystal is functioning normally. “Error D012: Syntax error.” Cause: The source file syntax has severe error. Solution: Rewrite and correct the source file. “Error D013: Memory address [number] is error !” Cause: The ICE SRAM address is in error. Solution: Replace the ICE memory. “Error D014: Can't find the breakpoint address of [program line].” Cause: The breakpoint line does not have program address. Solution: Redefine the breakpoint. “Error D015: The number of symbols is over [number].” Cause: Too many symbols are defined. Solution: Split the program into two or more smaller ones. “Error D016: Please dump program before adding label to watch. “ Cause: Sequence of dumping program and adding label to watch in error. Solution: Correct sequence is – [Project][Dump to ICE], then [Debug][Add Label to Watch] 52 • Error Messages WICE Lite IDE User’s Guide Appendix A “Error D017: Trace log is empty. “ Cause: No data is available from trace log. Solution: Trace log is generated only when Go, Free Run, or Got to Cursor command is executed. “Error D018: No trace item in trace log. “ Cause: No trace item is found in trace log. Solution: Trace log is generated only when Go, Free Run, or Got to Cursor command is executed. WICE Lite IDE User’s Guide Error Messages • 53 Appendix A 54 • Error Messages WICE Lite IDE User’s Guide Appendix B Appendix B Frequently Asked Questions What to do if ICE can not link with PC? Answer: Perform the following check list: 1. Check the power supply output. Voltage should be around the range of 17~23 VDC. 2. Check the printer cable between ICE and PC. Be sure the connectors at both ends of the cable are tightly fit into ICE and PC connectors. 3. Check the oscillator on the hardware for proper operation. From the Option menu, click on ICE Code Option command to verify the type of oscillator stated in the code option is correct. Change the Code Option dialog setting to match with actual oscillator in use. 4. If the problem still persists, try again with another PC and repeat the above steps. 5. If problem is still not solved, please call ELAN. What actions are needed if ICE has successfully linked with PC, but program dumping fails? Answer: 1. From the Option menu, click ICE Code Option command to ensure that the correct oscillator setting is shown in the Code Option dialog. If incorrect, change Code Option setting to match with actual oscillator in use. 2. Check whether the type of microcontroller defined in WICE Lite matches with that in the hardware. WICE Lite IDE User’s Guide Frequently Asked Questions • 55 Appendix B What to do if ICE memory is checked and found to be in error. Answer: 1. From the Option menu, click ICE Code Option command to ensure that the correct oscillator setting is shown in the Code Option dialog. If incorrect, change Code Option setting to match with actual oscillator in use. 2. Check whether the type of microcontroller defined in WICE Lite matches with that in the hardware. 3. Change ICE SRAM. When WICE Lite tries to connect with the same ICE several times, why does the execution become slower and slower? Answer: Due some error, the communication timing between ICE and PC is stretched if the connection is tried again and again. Check oscillator and microcontroller setup as decribed above. Why “Step Into” cannot be executed? Answer: Microcontroller may be unmatched. Check whether the type of microcontroller in software is the same as that in hardware. If source files are located in Novell file server, why is the program has to be reassembled again at each execution time? Answer: It is because of the time difference between PC and server. Therefore, it is better to locate all source files in one single storage source, be it in a local computer or network one. 56 • Frequently Asked Questions WICE Lite IDE User’s Guide