background image

 2001 Microchip Technology Inc.

DS51159B-page 97

MPLAB

®

 ICE USER’S GUIDE

12

Chapter 6.  Advanced Features

6.1

 Introduction

MPLAB ICE provides a wide variety of tools to emulate and debug an 
application. MPLAB ICE offers a basic set of in-circuit debugging tools, 
including the ability to run, halt, reset and single step the processor, plus 
additional tools for advanced debugging techniques.

Specialized features are available in the MPLAB IDE when using the MPLAB 
ICE emulator. A general description of these features is provided in the 
MPLAB User’s Guide (DS51025), but a more detailed discussion is provided 
here.

6.2

 Highlights

MPLAB ICE advanced features include the following:

• Using Complex Triggering

- Complex Trigger Settings Dialog

- Dialog Syntax

- Memory Access Selection

- Event  Selection

- Complex Triggering Examples

- Complex Trigger Break Points with the Right Mouse Button

• Using Code Coverage

• Using the Trace Memory Window

- Viewing the Trace Memory Window

- Customizing the Trace Memory Window

Содержание MPLAB ICE

Страница 1: ...2001 Microchip Technology Inc DS51159C MPLAB ICE EMULATOR USER S GUIDE M...

Страница 2: ...orporated Printed in the U S A All Rights Reserved Printed on recycled paper Microchip received QS 9000 quality system certification for its worldwide headquarters design and wafer fabrication facilit...

Страница 3: ...19 Warranty Registration 21 Recommended Reading 22 Troubleshooting 22 The Microchip Internet Web Site 23 Development Systems Customer Notification Service 24 Customer Support 26 Chapter 1 Overview and...

Страница 4: ...reak Points 50 2 10 Using Hardware Break Points 51 2 11 Using the Complex Trigger 52 2 12 Using Code Coverage 55 2 13 Going Forward 57 Chapter 3 Tutorial PIC18CXXX 3 1 Introduction 59 3 2 Highlights 5...

Страница 5: ...ware 87 4 9 Using MPLAB Projects 89 Chapter 5 Basic Features 5 1 Introduction 91 5 2 Highlights 91 5 3 Resetting the Processor 91 5 4 Viewing Processor Memory 92 5 5 Viewing Files 93 5 6 Using the Sta...

Страница 6: ...LAB ICE 135 Appendix A Debugging Techniques A 1 Introduction 141 A 2 Highlights 141 A 3 Complex Triggering Examples 141 A 4 Additional Debugging Examples 142 Appendix B Pod Electrical Specification B...

Страница 7: ...Table of Contents 2001 Microchip Technology Inc DS51159B page vii Glossary Introduction 169 Highlights 169 Terms 169 Index 185 Worldwide Sales and Service 192...

Страница 8: ...MPLAB ICE User s Guide DS51159B page viii 2001 Microchip Technology Inc...

Страница 9: ...ftware and of general emulator operation Highlights This chapter discusses MPLAB ICE System Components Installing MPLAB ICE Setting Up MPLAB ICE Using MPLAB ICE MPLAB ICE System Components The MPLAB I...

Страница 10: ...to the parallel connector on the MPLAB ICE pod and connect the other end to the LPT port on the PC chassis Secure both ends with the cable screws Parallel Cable 2 Power Supply Cable 3 Emulator Pod 1...

Страница 11: ...position before completing this step Plug the appropriate ends of the power supply into a power outlet and into the back of the MPLAB ICE pod If using a target board with the MPLAB ICE system install...

Страница 12: ...the development mode by clicking on each tab of the dialog and setting options as specified below Click Apply to accept the setting of each tab Click OK to accept the setting and close the Developmen...

Страница 13: ...s tab is not available for all processors In order for Off Chip Memory to be used the Processor Mode Options Development Mode Con figuration tab must be set to Microprocessor or Extended Microcon trol...

Страница 14: ...in to the MPLAB IDE software For more detailed information on each of these features consult the MPLAB User s Guide DS51025 MPLAB ICE Advanced Features MPLAB ICE advanced features include the followin...

Страница 15: ...rated when the final event occurs Any Event Select Any Event if any single event will generate the trig ger Time Between Events Select Time Between Events to specify a starting and terminating event T...

Страница 16: ...his code is highlighted in the Program Memory window To enable code coverage select Debug Code Coverage and choose either Enabled Reset on Run or Enabled Manual Reset If Enabled Reset on Run is select...

Страница 17: ...ination data if applicable External Inputs Ex Value of the external inputs Time Stamp Cycles or Seconds Time stamp value Select Data Reload to force an upload of whatever data has currently been colle...

Страница 18: ...MPLAB ICE User s Guide DS51159B page 18 2001 Microchip Technology Inc NOTES...

Страница 19: ...o emulate and debug firmware on a target board The manual layout is as follows Quick Start How to get up and running quickly using MPLAB ICE Chapter 1 Overview and Installation What MPLAB ICE is and h...

Страница 20: ...ocations and telephone numbers worldwide Conventions Used in this Guide This manual uses the following documentation conventions Table 1 Documentation Conventions Description Represents Examples Code...

Страница 21: ...page number The numbering convention for the DS Number is DSXXXXXA where Warranty Registration Please complete the enclosed Warranty Registration Card and mail it promptly Sending in your Warranty Reg...

Страница 22: ...1194 Consult this document for information on transition sockets available for use with MPLAB ICE device adaptors Microchip Technical Library CD ROM DS00161 This CD ROM contains comprehensive applicat...

Страница 23: ...com The file transfer site is available by using an FTP service to connect to ftp ftp microchip com The web site and file transfer site provide a variety of services Users may download files for the...

Страница 24: ...ined the names of the lists that you are interested in you can subscribe by sending a message to listserv mail microchip com with the following as the body subscribe listname yourname Here is an examp...

Страница 25: ...ronment for development systems tools This list is focused on MPLAB IDE MPLAB SIM MPLAB IDE Project Manager and general editing and debugging features For specific information on MPLAB IDE compilers l...

Страница 26: ...Local sales offices are also available to help customers See the back cover for a listing of sales offices and locations Corporate Applications Engineers CAEs may be contacted at 480 792 7627 In addi...

Страница 27: ...devices It uses the latest emulation processors to provide full speed emulation and visibility into both the instruction and the data paths during execution MPLAB ICE 2000 performs basic functions suc...

Страница 28: ...necessary to perform the common emulator functions such as trace break and emulate The processor module inserts into a slot in the front of the emulator pod It contains the hardware necessary to emul...

Страница 29: ...timing between events Set break points based on internal and or external signals Monitor internal file registers Emulate full speed up to 40 MHz depending on the device Select the oscillator source in...

Страница 30: ...ct the emulator pod to a PC 4 Emulator pod 5 Power supply and cable 6 Emulator stand 7 Processor module with cable Order separately 8 Logic Probes 9 Device adapter to connect the processor module to t...

Страница 31: ...Secure both ends with the cable screws Install the processor module Insert the processor module firmly into the front of the MPLAB ICE pod To remove the processor module place one finger behind each t...

Страница 32: ...er target application parts See Section 1 8 2 before using low voltage emulation if this feature is desired 1 Assemble the MPLAB ICE emulator system For instructions on how to assemble the emulation s...

Страница 33: ...for additional information 1 8 2 Turning On the System Components Low Voltage Emulation MPLAB ICE also supports low voltage emulation from 2 0V to 4 5V In this configuration power MUST BE SUPPLIED by...

Страница 34: ...click OK As there is no power on the target board you will get an error message that says Processor Cannot Be Halted Click OK 5 Plug the device adapter into the transition socket on the target board 6...

Страница 35: ...DE Software To install the MPLAB IDE software refer to the installation instructions found in the MPLAB User s Guide DS51025 The MPLAB ICE emulator functions with MPLAB IDE software under the followin...

Страница 36: ...MPLAB ICE User s Guide DS51159B page 36 2001 Microchip Technology Inc NOTES...

Страница 37: ...ts Using the Complex Trigger Using Code Coverage Going Forward 2 3 Reviewing the Hardware The hardware setup used for this tutorial is listed below PC LPT Port LPT1 Bidirectional mode MPLAB ICE pod MP...

Страница 38: ...rochip Technology Inc 2 4 Running MPLAB After installing MPLAB IDE software invoke it by executing the file MPLAB EXE For more information on using MPLAB refer to the MPLAB User s Guide DS51025 and th...

Страница 39: ...orts Tab The Ports tab displays information about the available LPT ports on the host PC Figure 2 2 Development Mode Dialog Ports Tab Select an available LPT port from the dropdown list To determine h...

Страница 40: ...essor to emulate from the dropdown list Below the processor is a brief description of any limitations that exist for emulating this processor on the MPLAB ICE emulator A more detailed description of l...

Страница 41: ...to change the global break and trace point environment options The default values are Clear Breakpoints On Download Global Break Enable and Freeze Peripherals On Halt For this tutorial uncheck Freeze...

Страница 42: ...Watchdog Timer and or Processor Mode i e internal and external memory The default is Watch Dog Timer disabled None Processor mode is not available for the selected processor Pins tab Use this tab to s...

Страница 43: ...selecting Project New Project The New Project dialog will appear Figure 2 5 New Project Dialog Find the directory you created for the project and then name the project icetut16 pjt Click OK to close...

Страница 44: ...irectory and click on its name to select it If you could not file this file or if it was missing type icetut16 asm in the File name box of the dialog Click OK to close this dialog and return to the Ed...

Страница 45: ...Click OK to close this dialog If you were able to find and copy the file icetut16 asm to the project directory you should now be in the main MPLAB IDE window Figure 2 1 with no other windows open Proc...

Страница 46: ...the File Name Click OK You have now named the file and are ready to begin entering the source code into the empty window icetut16 asm Source Code list p 16c74b title PIC16C74B Tutorial Flash PORTB LED...

Страница 47: ...e is a software delay Fosc 1 Tosc Tcycle 4 x Tosc Delay TEMP1xTEMP2xTEMP3xTcycle DELAY movlw 0xFF movwf TEMP1 TEMP1 255 movwf TEMP2 TEMP2 255 movlw 0x07 movwf TEMP3 TEMP3 7 DLOOP decfsz TEMP1 F goto D...

Страница 48: ...ailed please check your typing and then try the build again For more information on creating and building projects refer to the MPLAB User s Guide DS51025 2 8 Using Software Break Points Now that your...

Страница 49: ...int in the source code file window Go to the main loop of the program and click the right mouse button on the line movwf PORTB A menu will appear Select Software Break Point s The line of code will ch...

Страница 50: ...un to Here instead of Software Break Point s from the right mouse button menu 2 9 Using Named Software Break Points MPLAB allows up to 16 named software break points These break points can be selectiv...

Страница 51: ...e break point You may single step to see the value of PORTB in the Watch_1 watch window change from H 00 to H FF 2 10 Using Hardware Break Points In addition to setting software break points on progra...

Страница 52: ...ovlw 0xFF of the DELAY routine highlighted indicating that this is the instruction where program execution halted This demonstrates that when you use a hardware break point to halt the processor you m...

Страница 53: ...s like the right mouse button complex trigger break point i e as a single event sequential trigger at location 0x000A with Ignore FNOP Cycles and Halt on Trigger set Figure 2 17 Click OK Figure 2 17 C...

Страница 54: ...the Trace Memory Window select Options Configure to bring up the Configure Trace dialog For more information on the trace memory window see Section 6 5 2 11 3 Complex Trigger Additional Functionality...

Страница 55: ...nt Settings Color tab as Trace Point Text Reset the program by selecting Debug System Reset or by clicking on the toolbar reset processor icon Then select Debug Clear All Points to clear all break tra...

Страница 56: ...2 20 Code Coverage Dialog Run the program by selecting Debug Run Run or by clicking the toolbar green stoplight icon The program will halt when it reaches the break point All the code executed before...

Страница 57: ...6CXXX tutorial on MPLAB ICE and MPLAB IDE functionality The simple examples shown here should give you a beginner s knowledge of working with the emulator and software For more detailed information on...

Страница 58: ...MPLAB ICE User s Guide DS51159B page 58 2001 Microchip Technology Inc NOTES...

Страница 59: ...ware Break Points Using the Complex Trigger Using Code Coverage Going Forward 3 3 Reviewing the Hardware The hardware setup used for this tutorial is listed below PC LPT Port LPT1 Bidirectional mode M...

Страница 60: ...rochip Technology Inc 3 4 Running MPLAB After installing MPLAB IDE software invoke it by executing the file MPLAB EXE For more information on using MPLAB refer to the MPLAB User s Guide DS51025 and th...

Страница 61: ...orts Tab The Ports tab displays information about the available LPT ports on the host PC Figure 3 2 Development Mode Dialog Ports Tab Select an available LPT port from the dropdown list To determine h...

Страница 62: ...essor to emulate from the dropdown list Below the processor is a brief description of any limitations that exist for emulating this processor on the MPLAB ICE emulator A more detailed description of l...

Страница 63: ...to change the global break and trace point environment options The default values are Clear Breakpoints On Download Global Break Enable and Freeze Peripherals On Halt For this tutorial uncheck Freeze...

Страница 64: ...og Timer and or Processor Mode i e internal and external memory The defaults are Watch Dog Timer disabled None and Microcontroller Processor Mode internal memory Processor Mode selection is not availa...

Страница 65: ...selecting Project New Project The New Project dialog will appear Figure 3 5 New Project Dialog Find the directory you created for the project and then name the project icetut18 pjt Click OK to close...

Страница 66: ...irectory and click on its name to select it If you could not file this file or if it was missing type icetut18 asm in the File name box of the dialog Click OK to close this dialog and return to the Ed...

Страница 67: ...Click OK to close this dialog If you were able to find and copy the file icetut18 asm to the project directory you should now be in the main MPLAB IDE window Figure 3 1 with no other windows open Proc...

Страница 68: ...s the File Name Click OK You have now named the file and are ready to begin entering the source code into the empty window icetut18 asm Source Code list p 18c252 title PIC18C252 Tutorial Flash PORTB L...

Страница 69: ...1 Tosc Tcycle 4 x Tosc Delay TEMP1xTEMP2xTEMP3xTcycle DELAY movlw 0xFF movwf TEMP1 TEMP1 255 movwf TEMP2 TEMP2 255 movlw 0x07 movwf TEMP3 TEMP3 7 DLOOP decfsz TEMP1 F goto DLOOP decfsz TEMP2 F goto DL...

Страница 70: ...ailed please check your typing and then try the build again For more information on creating and building projects refer to the MPLAB User s Guide DS51025 3 8 Using Software Break Points Now that your...

Страница 71: ...rocessor icon Now you will set a software break point in the source code file window Go to the main loop of the program and click the right mouse button on the line movwf PORTB A menu will appear Sele...

Страница 72: ...un to Here instead of Software Break Point s from the right mouse button menu 3 9 Using Named Software Break Points MPLAB allows up to 16 named software break points These break points can be selectiv...

Страница 73: ...e break point You may single step to see the value of PORTB in the Watch_1 watch window change from H 00 to H FF 3 10 Using Hardware Break Points In addition to setting software break points on progra...

Страница 74: ...truction call DELAY highlighted indicating that this is the instruction where program execution halted This demonstrates that when you use a hardware break point to halt the processor you may skid or...

Страница 75: ...at it works like the right mouse button complex trigger break point i e as a single event sequential trigger at location 0x0026 with Ignore FNOP Cycles and Halt on Trigger set Figure 3 17 Click OK Fig...

Страница 76: ...to bring up the Configure Trace dialog For more information on the trace memory window see Section 6 5 3 11 3 Complex Trigger Additional Functionality The complex trigger can be set up to require tha...

Страница 77: ...toolbar reset processor icon Then select Debug Clear All Points to clear all break trace and trigger points Click on the watch window to make it active and then close it by either clicking on the x b...

Страница 78: ...Run or by clicking the toolbar green stoplight icon The program will halt when it reaches the break point All the code executed before the break point and the line where the break point was set will...

Страница 79: ...8CXXX tutorial on MPLAB ICE and MPLAB IDE functionality The simple examples shown here should give you a beginner s knowledge of working with the emulator and software For more detailed information on...

Страница 80: ...MPLAB ICE User s Guide DS51159B page 80 2001 Microchip Technology Inc NOTES...

Страница 81: ...teps needed to get started with MPLAB ICE are Running MPLAB Configuring the LPT Port Selecting the Development Mode and Processor Selecting Processor Power Setting up the Processor Clock Setting up Mi...

Страница 82: ...your PC motherboard and add ons there may be up to four different types of parallel ports SPP PS 2 EPP ECP The SPP port was the original parallel port It was designed for sending 8 bit wide data but...

Страница 83: ...r To select the MPLAB ICE emulator for the development mode select the Tools tab of the Development Mode dialog and click MPLAB ICE Emulator Figure 4 3 Development Mode Dialog Tools Tab When MPLAB ICE...

Страница 84: ...rget system 2 0 5 5V The emulator defaults to Processor Power from Emulator system power when first initialized 4 6 1 Processor Power from Emulator System Power Select the Power tab of the Development...

Страница 85: ...is configuration power must be supplied by the target board see above Note If you use power from the target board make sure it is always present or the emulator will not function properly If the devic...

Страница 86: ...the supported frequency range for each oscillator type Next select the Desired Frequency magnitude MHz kHz or Hz enter the Desired Frequency and click Apply The clock will then be programmed to operat...

Страница 87: ...be what is desired for internal time calculations e g Your crystal oscillator has a frequency of 8 MHz 50 ppm but the target frequency is shown as 7 993755 The frequency may be changed by simply typi...

Страница 88: ...Watchdog Timer Set Up Determine whether or not the Watchdog Timer WDT will be needed During development WDT is usually disabled However if a specific development requires the WDT to be enabled remembe...

Страница 89: ...ted development mode is retained with the project information To change the development mode for a project follow these steps Open the project The previously used development mode will be selected Cha...

Страница 90: ...Open and restore all windows to their saved states Download the contents of the hex file to emulation memory Reset the processor To close a project select Project Close Project You will be asked if yo...

Страница 91: ...these features is provided here but for more detailed information consult the MPLAB User s Guide DS51025 5 2 Highlights MPLAB ICE basic features include the following Resetting the Processor Viewing...

Страница 92: ...Registers File registers can be viewed by selecting Window File Registers This window displays all of the file registers of the emulated device Special Function Registers SFRs The special function re...

Страница 93: ...r convenience MPLAB IDE contains four toolbars to provide you with shortcuts for performing routine tasks The four toolbars are Edit Toolbar Debug Toolbar Project Toolbar User Defined Toolbar Click th...

Страница 94: ...ware break point is set by clicking the right mouse button with the cursor over the desired break location If a range of breaks is desired click and drag the mouse over the desired range The right cli...

Страница 95: ...ore additional instructions may be executed past the set break point before the processor halts 5 9 1 Right Mouse Button Hardware Break Points A simple complex trigger break point can be set by using...

Страница 96: ...roject Select Debug Complex Trigger Settings to display the Complex Trigger Settings dialog For more information on complex triggering as well as complex triggering examples see Section 6 3 5 10 Using...

Страница 97: ...zed features are available in the MPLAB IDE when using the MPLAB ICE emulator A general description of these features is provided in the MPLAB User s Guide DS51025 but a more detailed discussion is pr...

Страница 98: ...ex trigger break point may be set using the right mouse button Section 5 9 1 Other complex trigger functions may be set using the Complex Trigger Settings Dialog 6 3 1 Complex Trigger Settings Dialog...

Страница 99: ...er location in the trace memory window indicating the number of cycles captured by the trace memory window after the trigger occurs Cycles Traced After Trigger The approximate cycle that generated the...

Страница 100: ...12 bit or 16 bit core processor module Trigger Status This field indicates the status of the currently defined trigger as the emulator is running Example messages are No trigger in use No trigger has...

Страница 101: ...alog allowing you to save as a trf file trigger information for all tabs of the dialog Clear All Clears the current trigger information in all tabs of the dia log OK Accepts the current setting in the...

Страница 102: ...bits The external input value may be entered in either binary or hex just like the value field Pass counters number of captured events and trigger position values are all entered in decimal Complex Tr...

Страница 103: ...of the Complex Trigger Settings dialog will look different depending on the memory access selection 6 3 3 1 Program Memory If a Program Memory access is specified the trigger can be generated on an in...

Страница 104: ...Memory Selection 6 3 4 Event Selection Up to four events can be required before the trace or break occurs The combination of these events can be specified three ways Sequential All Events Any Event I...

Страница 105: ...nd the trigger event Trigger Figure 6 4 Complex Trigger Sequential Event Selection Keep in mind that for sequential triggers the emulator will wait until Event 1 is satisfied before proceeding to Even...

Страница 106: ...elect All Events if each event must occur in any order to generate the trigger The trigger will be generated when the final event occurs 2 Click on a tab to enter information about each event Event 1...

Страница 107: ...dialog for Any Event selection 1 Select Any Event if any single event will generate the trigger 2 Click on a tab to enter information about each event Event 1 Event 2 Event 3 Event 4 Figure 6 6 Compl...

Страница 108: ...imer Figure 6 7 Complex Trigger Time Between Events Selection For the trigger type Time Between Events the time stamp generator is held at zero until a specified starting event occurs The time stamp g...

Страница 109: ...buffer Filtered traces allow you to make more efficient use of trace memory You can focus in on sections of code and collect only those or you can select to not collect delay loops or other repeated s...

Страница 110: ...If you wanted to trigger an external logic analyzer every time a particular routine is executed this can be achieved by filtering on that address and setting the appropriate triggering in the Trigger...

Страница 111: ...functions properly and breaks just before the subroutine starts to fail It is observed that the routine functions correctly until another after subroutine RoutineB is called This problem can be solve...

Страница 112: ...MPLAB ICE User s Guide DS51159B page 112 2001 Microchip Technology Inc Figure 6 10 Setting the Second of Two Sequential Events...

Страница 113: ...ose that the flag bit is in RAM location Flags at bit position 3 It does not matter what the value of the other bits are but the trigger should occur when bit 3 of Flags becomes 1 For this use a Seque...

Страница 114: ...added at the address of the delay routine s return statement Set the Start Timer tab to a program memory fetch of address Delay and the Stop Timer tab to a program memory fetch of address EndDelay Che...

Страница 115: ...2001 Microchip Technology Inc DS51159B page 115 Advanced Features Figure 6 13 Specifying the Event that will Stop the Timer...

Страница 116: ...es For this use a Filter Trace Specify the traced addresses to be everything except the program memory range where the delay loop is located Uncheck Ignore FNOP Cycles Check Infinite Events and use ei...

Страница 117: ...ct a particular variable or SFR 2 The number of times the R W occurred providing you with a count of the collected cycles There are two ways to capture the actual data values with a filter The first i...

Страница 118: ...latching addresses as they appear on the bus Thus instructions that follow two cycle instructions that modify the program counter may not have been actually executed With code coverage enabled the nex...

Страница 119: ...performed When a reset has occurred and emulation has run and then halted all accessed program memory locations appear highlighted in the Program Memory window They will remain highlighted until the n...

Страница 120: ...ctions By default all instruction cycles are captured by the trace buffer The Complex Trigger dialog can be used to control which instruction cycles are captured Section 6 3 In MPLAB ICE the trace buf...

Страница 121: ...6 17 Trace Buffer Input MPLAB ICE MPLAB ICE Trace Buffer Complex Trigger Logic Delay Counter MPLAB ICE Emulation Program Memory Processor Module PICmicro Emulator Chip Analyzer Bus Internal File Regis...

Страница 122: ...Opcode Op Instruction being fetched Label Label Label if any associated with the program memory address Instruction Instruction Disassembled instruction Source Data Address SA Address or symbol of the...

Страница 123: ...complex trigger fired The menu items in the window perform the following functions File Save Saves the displayed trace buffer information to a tab delimited file Data Find Trigger Brings the trigger...

Страница 124: ...n be displayed in either hex raw or symbolic format External inputs can be displayed in either hexadecimal or binary format The time stamp can be displayed in either number of cycles or in seconds The...

Страница 125: ...he previous cycle i e there is a one cycle pipeline In Example 1 Figure 6 20 1 The first cycle the W register is loaded with the value of 0xFF 2 The next cycle the value gets written into the W regist...

Страница 126: ...MPLAB ICE User s Guide DS51159B page 126 2001 Microchip Technology Inc NOTES...

Страница 127: ...Verify Troubleshooting Verify Failures 7 3 Running Verify MPLAB ICE verification is a diagnostic tool designed to test the correct behavior of an MPLAB ICE unit It should be run with the system disco...

Страница 128: ...heck your connections before verifying and then select Tools Verify MPLAB ICE 7 3 2 Using the Verify Dialog The Verify dialog will now appear There are three tabs on this dialog Access tests Checks ba...

Страница 129: ...2001 Microchip Technology Inc DS51159B page 129 Verification Figure 7 3 Verify MPLAB ICE Run Mode Tests...

Страница 130: ...unts to zero Verify Executes all checked tests Loop Test Performs all checked tests repeatedly until Stop Loop is clicked Help Opens the on line help for MPLAB ICE verify Stop on first failure If chec...

Страница 131: ...h MPLAB ICE Figure 7 5 Tools Set the tool to verify Figure 7 6 Figure 7 5 Port Selection Dialog Ports Tab Figure 7 6 Port Selection Dialog Tools Tab If you are having trouble verifying MPLAB ICE you m...

Страница 132: ...ICE unit reports failures when running Verify please check the following items Confirm that the MPLAB ICE unit is powered up and properly communicating with your PC To determine this select Tools MPLA...

Страница 133: ...rt Verify that MPLAB ICE is connected to the selected LPT port Select Options Development Mode and select the Ports tab Click Query Port Info to see what LPT parallel ports are available Verify that t...

Страница 134: ...pect that the MPLAB ICE driver is not being loaded correctly check the Event Viewer In Windows NT 4 0 the Event Viewer is under Start Programs Administrative Tools In Windows 2000 the Event Viewer is...

Страница 135: ...that require you to configure the parallel interface so that it will correctly communicate with MPLAB ICE 8 4 1 Checking PC BIOS Settings When configuring a PC to run MPLAB ICE check and record the p...

Страница 136: ...lp if you are uncomfortable retrieving your PC s BIOS settings or are unable to retrieve them 8 4 2 Checking Operating System Settings After checking your PC s BIOS settings check the operating system...

Страница 137: ...icking the plus sign next to the ports if necessary If there aren t as many ports here as are listed under the BIOS you may need to add ports to the system Double click the Add New Hardware icon of th...

Страница 138: ...install a separate parallel interface card that can be dedicated to MPLAB ICE If you are unable to change the port settings through the BIOS they may be controlled on a separate port card or with jum...

Страница 139: ...time performance of the system Once determining that a compatible mode works it may be worth trying other parallel port modes i e bi directional to improve performance 8 4 9 Nothing I Do Works It is p...

Страница 140: ...MPLAB ICE User s Guide DS51159B page 140 2001 Microchip Technology Inc NOTES...

Страница 141: ...begin with but after a time it begins to function incorrectly This subroutine is called many times so it would be nice to skip the executions where the subroutine functions properly and break just bef...

Страница 142: ...using time between events Solution A Filter Trace Using the Filter Trace capture every time the interrupt service routine ISR starts The difference between the Trace Memory Window time stamp of one st...

Страница 143: ...w Trace Memory Figure A 2 Trace Display Filter Trace for ISR Time Calculate the difference between interrupt starts Seconds difference In Figure A 2 the difference is 132 microseconds Solution B Time...

Страница 144: ...be checked Enter the address of the start of the ISR either a numeric address or a label In Figure A 3 the address is irqsvc Click the Stop Timer tab Figure A 4 Stop Timer for ISR Time Again enter the...

Страница 145: ...le not correct A variable is not correct at a routine The code shows the variable being set correctly but somewhere in the code this variable is getting changed Where is the bad code In order to figur...

Страница 146: ...s Guide DS51159B page 146 2001 Microchip Technology Inc Figure A 6 Source Code File Window Configure the trace display Window Trace Memory Options Configure to focus on the source and destination add...

Страница 147: ...gging Techniques Figure A 7 Configure Trace for Variable Now set up a filtered trace to look at the routine that does the calculation Select Debug Complex Trigger Settings to open the Complex Trigger...

Страница 148: ...eck Halt on Trace Buffer Full Click Apply or OK Reset the system Debug System Reset and then run your program Debug Run Run green stoplight icon on toolbar or F9 After it halts bring up the Trace Memo...

Страница 149: ...1 the variable name is num_out Trigger Position should be End Select Halt on Trace Buffer Full and Ignore FNOP Cycles Click the Trigger tab Again set up the Complex Trigger Settings dialog for Sequen...

Страница 150: ...e trigger point i e cycle 0 Here num_out is set to 0 However you will see that num_out is set to 0 at cycle 3 as well Since this is all just initialization more information is necessary to find the pr...

Страница 151: ...delay routine Change the source code so that delay_cnt is set up as a 16 bit variable i e change delay_cnt to delay_cnt 2 Figure A 13 Source Code File Update A 4 3 Negative variable When a particular...

Страница 152: ...59B page 152 2001 Microchip Technology Inc Figure A 14 Configure Trace for Negative Variable Select Debug Complex Trigger Settings to open the Complex Trigger Settings dialog Figure A 15 Sequential Tr...

Страница 153: ...s flags Then enter 1xxxxxxx in the Value box where x means don t care Click Binary Trigger Position should be Center Select Halt on Trace Buffer Full and Ignore FNOP Cycles Click Apply or OK Reset the...

Страница 154: ...rnal inputs EXT7 EXT0 or use the trigger in TRGIN For more information on logic probes see Section B 6 Solution A External Inputs To clear all break trace and trigger points select Debug Clear All Poi...

Страница 155: ...Enable break on external trigger input and then select either Rising edge or Falling edge If you want the trace buffer to freeze on a rising edge of the trigger input select that option as well Click...

Страница 156: ...ked Enter the address of the start of the loop either a numeric address or a label In Figure A 1 the address is delay Enter a value for the Pass Counter In Figure A 19 this number is 10 Select Halt on...

Страница 157: ...notice that no flags have been set you have a phantom interrupt Phantom interrupts can occur when your program is in the process of clearing interrupt flags when an interrupt comes in Due to the pipel...

Страница 158: ...MPLAB ICE User s Guide DS51159B page 158 2001 Microchip Technology Inc NOTES...

Страница 159: ...Transition Socket Specifications DS51194 for information on a specific transition socket B 2 Highlights This appendix addresses the following electrical specifications of the emulator pod Power Paral...

Страница 160: ...orts both compatible and bi directional parallel port modes MPLAB will determine to which mode the host PC is configured Refer to Section 4 4 for more information regarding parallel LPT port communica...

Страница 161: ...rallel Printer Port Signal Assignment Compatible Mode Pin Number MPLAB ICE Signal Direction1 Description 1 STROBE Out Read Write Strobe 2 9 Data 0 7 Out Data Output Bus 17 R W Out Selects Read or Writ...

Страница 162: ...ror LED E This LED will turn on when the processor module is not inserted completely or correctly If this LED is on turn off the power and remove and reinsert the processor module B 5 3 Emulator Run M...

Страница 163: ...ve signals on the parallel port cable that will forward bias the buffers and allow enough voltage to turn on the LED This is not a problem and will not cause harm to any part of the system B 6 Logic P...

Страница 164: ...T6 External input bit 6 of the trace trigger inputs White 7 I EXT5 External input bit 5 of the trace trigger inputs White 8 I EXT4 External input bit 4 of the trace trigger inputs White 9 I EXT3 Exter...

Страница 165: ...ak Trace Trigger Points External Inputs and Outputs C 3 Unchanged Items Many MPLAB ICE functions operate identically to PICMASTER These functions include Projects including language tools and interfac...

Страница 166: ...end of the event Then run and view the trace buffer when execution halts The last time stamp is the time between the events 2 Using a Time Between Events trigger set the Start Timer and Stop Timer ev...

Страница 167: ...tion halts emulation a trace point whose execution appears in the trace window a trigger point whose execution causes an external signal to be gener ated MPLAB ICE maintains this functionality but thr...

Страница 168: ...TRGIN I External Break Input Signal Halts the processor either on a rising or falling edge where the edge is software pro grammable TRIGO TRGOUT O Trigger Output Signal Use this signal for triggering...

Страница 169: ...ich can not be changed by the linker Access RAM PIC18CXXX Devices Only Special general purpose registers on PIC18CXXX devices that allow access regardless of the setting of the bank select bit BSR Alp...

Страница 170: ...he source files for an application C A high level programming language that may be used to generate code for PICmicro MCUs especially high end device families Calibration Memory A special function reg...

Страница 171: ...file Directives make coding easier and provide custom output according to specific needs Download Download is the process of sending data from the PC host to another device such as an emulator program...

Страница 172: ...PLAB ICE only An external input signal logic probe line TRIGIN for setting an event based upon external signals External Linkage A function or variable has external linkage if it can be accessed from...

Страница 173: ...ecutable instructions assembled or compiled from source code into standard hexadecimal format code Also called executable or machine code Hex code is contained in a hex file Hex File An ASCII file con...

Страница 174: ...y A library is a collection of relocatable object modules It is created by assembling multiple source files to object files and then using the librarian to combine the object files into one library fi...

Страница 175: ...itively Macro Directives Directives that control the execution and data allocation within macro body definitions Make Project A command that rebuilds an application re compiling only those source file...

Страница 176: ...platform including the macro assembler and utility functions MPASM will translate source code into either object or executable code The object code created by MPASM may be turned into executable code...

Страница 177: ...ers to the processor at a break point or executing single step instructions or MPLAB IDE being run in simulator mode Node MPLAB IDE project component NOP No Operation An instruction that has no effect...

Страница 178: ...sfied You can assign the Pass Counter to break and trace logic and to any sequential event in the complex trigger dialog PC Personal Computer or Program Counter PC Host Any IBM or compatible Personal...

Страница 179: ...ware Programmer A device used to program electrically programmable semiconductor devices such as microcontrollers Project A set of source files and instructions to build the object and executable code...

Страница 180: ...ite loop where there will be no exit from the recursion Relocatable Section A section whose address is not fixed absolute The linker assigns addresses to relocatable sections through a process called...

Страница 181: ...s from one piece of information to another for a single instruction execution is referred to as the skew Skid When a hardware break point is used to halt the processor one or more additional instructi...

Страница 182: ...development mode and device and active tool bar Step Into This command is the same as Single Step Step Into as opposed to Step Over follows a CALL instruction into a subroutine Step Over Step Over al...

Страница 183: ...dows additional modes or functions can be found Figure G1 System Window Control Menu Watch Window Target Refers to user hardware Target Application Firmware residing on the target board Target Board T...

Страница 184: ...e The linker must find a target memory block in which to allocate an unassigned section Uninitialized Data Data which is defined without an initial value In C int myVar defines a variable which will r...

Страница 185: ...ge 16 55 77 118 154 Column 124 Command Line Interface 170 Compatible Mode 161 Compiler 170 Complex Trigger 52 167 Break Points 96 Settings Dialog 98 Complex Triggering 14 98 Examples 111 Configuration...

Страница 186: ...161 Infinite Events 15 109 116 Initialized Data 174 Inquire 84 Installation Hardware 10 31 Software 12 35 Instruction 17 122 Internal Clock see Clock On Board Linkage 174 Power see Power From Emulato...

Страница 187: ...91 Program Counter 179 Program Memory 15 92 103 179 Programmer 179 Project 179 Opening Closing 90 Saving 89 Set Up 13 42 64 PS 2 82 Q Qualifier 179 Quick Start 9 R Radix 179 RAM see Data Memory Readin...

Страница 188: ...mory 120 184 Capture 14 52 74 98 Freezing 96 Trace Memory Window 16 120 Customization 124 Reading 125 Viewing 122 Transition Socket 9 28 30 32 Specification 22 TRGIN 164 172 TRGOUT 164 Trigger Cycle 1...

Страница 189: ...2001 Microchip Technology Inc DS51159B page 189 Index NOTES...

Страница 190: ...MPLAB ICE User s Guide DS51159B page 190 2001 Microchip Technology Inc NOTES...

Страница 191: ...2001 Microchip Technology Inc DS51159B page 191 Index NOTES...

Страница 192: ...uzhou Liaison Office Rm 531 North Building Fujian Foreign Trade Center Hotel 73 Wusi Road Fuzhou 350001 China Tel 86 591 7557563 Fax 86 591 7557572 China Shanghai Microchip Technology Consulting Shang...

Отзывы: