Home
mikroICD™ - MikroElektronika
Contents
1. Figure 12 1 CODE Watch Page 21 Page 22 DISCLAIMER All the products owned by MikroElektronika are protected by copyright law and international copyright treaty Therefore this manual is to be treated as any other copyright material No part of this manual including product and software described herein may be reproduced stored in a retrieval system translated or transmitted in any form or by any means without the prior written permission of MikroElektronika The manual PDF edition can be printed for private or local use but not for distribution Any modification of this manual is prohibited MikroElektronika provides this manual as is without warranty of any kind either expressed or implied including but not limited to the implied warranties or conditions of merchantability or fitness for a particular pu
2. 0 1139 Available RAM 352 bytes Available ROM 8192 bytes 00 FF 99 0 FF FF FF OOF All files di ebugger option or press F9 on is mm rz 00 Loo co Loo 4 m j L lad o E ke y b rd 40 68 Insert Compiled Programmed CA XmikroC PRO for PIC Examples Development Systems EASYPIC6 Led a e M sure to enable power supply on your device Page 8 Figure 3 2 mikroC window during debugging When mikrolCD debugging is started a program line which will be next executed is highlighted with a blue strip void main ely ANSELH 0 bit 0 Disable comparators a C20N bit 0 i TRISA 0x00 set direction to be c Figure 3 3 Execution line is highlighted Next step is to select values which will be monitored Click on View gt Debug Windows gt Watch Window Shift F5 or click the icon to open Watch Values window View Project Build Run Tools Help Debug Windows 0 Watch Window Shift F5 Toolbars Stopwatch Bookmarks Ez Breakpoints Code Explorer Advanced Breakpoints Shift Ctrl A Figure 3 4 Open watch values window Within Watch Values window you can set which registers or variables are going be monitored Watch Values T 0 a F E m Add Select variable fram list PORTH Sf Remove lt gt Properties i Add All Remove A
3. 7 1 Breakpoint selection Turn OD 01 Click on a blue dot to place a breakpoint Lines 31 and 34 are enabled as breakpoints The mikroICD enables each program line to be marked with a breakpoint The breakpoint is an intentional stopping or pausing place in the program used for the purpose of debugging Breakpoints are placed in the program by clicking the blue dots to the left of the program line or by pressing m icon F5 By selecting the Run command icon F6 the microcontroller will execute the program from the current location highlighted in blue until it reaches a breakpoint highlighted in red The debugger halts after reaching the breakpoint Hardware and software breakpoints There are two kinds of breakpoints hardware and software breakpoints The only visible difference between them is in the speed of program execution before it reaches the specified program line Hardware breakpoints are placed within the microcontroller chip and provide considerably faster program execution The total number of software breakpoints goes up to 16 while the number of hardware breakpoints is much smaller For example PIC16 microcontrollers have only one whereas PIC189 microcontrollers have up to 3 hardware breakpoints When all hardware breakpoints are used then remaining breakpoints in the program will be used as software breakpoints 8 Advanced Breakpoints Option The mikrolCD provides the means for using the Ad
4. 8588888 8 838588838 00 00 STATUS Idle a Figure 10 1 EEPROM watch window Page 19 11 RAM window The mikrolICD allows you to view the contents of the microcontrollers RAM memory using the RAM window You can activate it by clicking the View gt Debug Windows gt RAM Window option 00 1F FF 00 00 6 06 SIX a 00 lt lt 05 gt lt 05 gt 1 00 00 Figure 11 2 RAM window Page 20 Unlike the Watch Window option all memory locations are displayed in a table The content of each RAM location is displayed in the hexadecimal format and may be changed at any time during the operation of the microcontroller Changed values are directly written in to the microcontroller by pressing Enter key In the table cell you can type value in hexadecimal format To write typed value into the MCU RAM memory press Enter key on your keyboard 12 CODE Watch window The CODE Watch window will appear by selecting the View Debug Windows gt CODE Window option It shows the values currently stored in the MCU internal FLASH memory 9 Click the Read Code button to read content of MCU FLASH memory S nN Progress bar monitors code reading process After code reading is finished you can preview it in the table 8855888388 e 00 00 00 00 00 00 00 00 00 00 00 00
5. Figure 8 1 Advanced breakpoints menu Figure 8 2 Advanced breakpoints window Page 16 The Program Memory Break option is used for placing breakpoints at specified addresses the program memory The value entered in the Address field must be in the HEX format 02 The File Register Break option is used for stopping code execution when read write access to the specified data memory location occurs If the Read Access option is selected the File Register Equal option can be used for setting the appropriate value in the Value field The program execution will be stopped when the value read from the specified data memory location matches the value written in the Value field All the values entered in the Value field must be in the HEX format 03 Emulator Features enables the usage of Event Breakpoints and Stopwatch Event Breakpoints Enable Stopwatch Break on Stack Overflow Underflow To use the Stopwatch define Breakpoint 2 and Breakpoint 3 as a Start and Stop not implemented conditions and check the Enable Stopwatch checkbox Break on Watchdog Timer Halt on Start Condition Breakpoint 2 when checked the program execution not implemented will stop on Breakpoint 2 Otherwise Breakpoint 2 will be used only to start the Break on SLEEP break on SLEEP Stopwatch instruction SLEEP instruction will not be Halt on Stop Condition Breakpointit3 when checked the program execution will stop executed If you choose to continue the
6. TM Whether you are a beginner or a professional this Lj powerful tool with intuitive interface and convenient set of commands will enable you to track down bugs quickly mikrolCD is one of the fastest and most reliable debugging tools on the market in circuit debugger b Ey 9075 OP PL m DEVELOPMENT TOOLS COMPILERS BOOKS 100 81155 want to express my thanks to you for being interested in our products and for having confidence in MikroElektronika The primary aim of our company is to design and produce high quality electronic products and to constantly improve the performance thereof in order to better suit your needs Nebojsa Matic General Manager The PIC dsPIC PIC24 PIC32 and Windows logos and product names are trademarks of Microchip Technology and Microsoft in the U S A and other countries Table of Contents Introduction to mikrolCD What is mikrolICD Key features Hardware and software Compilers mikroProg 1 Starting compiler 2 Preparing mikrolCD Step 1 Enable mikrolCD Step 2 Build your project 3 Start mikrolCD debugging 4 Watch Window What are the Watch Variables Types of variables Adding Watch Variables Step 1 Select variable CON NN OU HR A A PrP PB Step 2 Add variable 5 Debugger toolbar Debug commands Execute commands Managing breakpoints 6 Real Time debugging Step by Step Execut
7. cludes 4 initial release FJ 1 Directives Description mikroC PRO amp Web Links 10 This is a simple Hello World project It turns on off LEDs connected to a GT d for PIC icon http wwl microchip com _ PORTA PORTB PORTC PORTD and PORTE Project Manage THIKTO EROJ m p i ie apicem GAA ec ae amp itey ALE zi ET http wvi microchip com dovnloads en DeviceDoc 41412D pdf D QS Bap Derice Dev Board EasyPIC7 ac LEDs F eB en T http wwv mikroe com eng products viev 757 easypic v7 developmer bd Name 18 45 22 Denm ap ee ee Header Files In this manual we will use Oscillator HS PLL 32 0000 MHz amp 0000 MHz Crystal Binaries E Ext Modules None Project Level Defines CB MCU Clock 1 T ere Image Files mikroC PRO for PIC compiler 20 http vvv mikroe com eng products view 7 mikroc pro for pic LEDs jpg Frequency 32000000 MHz re NARI TM E Turn ON the PORT LEDs at SW3 EEPROM Files All other compilers mikroBasic d Active Comments Fles E Build Debugger Type 1 Syms and mikroPascal for PIC ER Hamid Library Manager Project Explore Release ICD Debug TRISA 0 set direction to be outpu
8. dAll g Remove All furn ON the PORT L Select variable from list BP id PORTD _ Search for variable by assembly name EY C20N bit e TRISA 0x00 s set direction to be output Pid i e TRISB 7 set direction to be output a 0x00 set direction to be output i TRISD 0x00 set direction to be output do PORTA 0x00 Turn OFF LEDs on PORTA 40 PORTB 0x00 Turn OFF LEDs on PORTB PORTC 0x00 Turn OFF LEDs on PORTC e PORTD 0x00 Turn OFF LEDs on PORTD 1 A PORTA OxFF Turn ON LEDs on PORTA udis PORTB OxFF Turn ON LEDs on PORTB OxFF Turn ON LEDs PORTC 06 d e PORTD OxFF Turn ON LEDs on PORTD 00 FF 99 00 00 00 00 00 00 L3 Delay ms 1000 1 second delay Figure 3 1 Run menu e so while 1 Endless loop oo 00 00 FE AA 00 00 00 F7 B B7 F7 BF OF BF DS OF 71 FE EE D9 7 7F FA AF C7 B7 R eee cee Click the Run option EE messages IESESESEAE3E3EIE3E Errors v warnings v Hints ES S 3 5 05 A7 F4 B6 CF AD DF FC 3D F d d S Line Message No Message Text Unit rom rop own menu se ect tart 0 1 mikroCPIC1618 exe MSF DBG pP 16F887 UICD DL 011111114 fo8 N C Users Public Docume ul 68 B6 FF 2F F3 FE EB EB AF D b F9
9. e remaining lines Execute to cursor 7 Using Breakpoints Hardware and software breakpoints 8 Advanced Breakpoints Option 9 Disassembly view 10 EEPROM Watch window 11 RAM window 12 CODE Watch window 11 12 12 12 12 14 14 14 14 15 15 16 18 23 20 21 Introduction to oT 40 8 D What is mikrolCD Key features mikrolCD is a highly effective tool for a Real Time debugging on hardware level The mikrolCD debugger enables you to execute your program on the host microcontroller and view variable values Special Function Registers SFR RAM CODE and EEPROM memory along with the mikrolCD code execution on hardware In order to use mikrolCD it is necessary to have the appropriate hardware mikroProg for PIC dsPIC and PIC32 and software Mikroelektronika compilers for PIC dsPIC or PIC329 Supported in all Mikroelektronika hardware programers for PIC dsPIC and PIC329 mikroProg for PIC dsPIC and PIC32 Supported in all MikroElektronika compilers for PIC dsPIC and PIC32 mikroC mikroBasic and mikroPascal Real time step by step debugging Can monitor SFR RAM CODE and EEPROM memory Hardware and software p mikroProg programmer mikrolCD is included with on board programmers on mikroElektronika develop ment systems and on mikroProg for E PIC dsPIC and PIC32 stand alone programmer Microcontroller on target device 2 is connec
10. eed additional information please place your ticket at www mikroe com esupport If you have any questions comments or business proposals mikroICD User Document ver 1 00 07100000 018866 do not hesitate to contact us at officeemikroe com
11. icon L LedBlinking c 227 5 LedBlinking Ist EES r r Address Opcode s 0 0000 main LedBlinking c 26 LedBlinking c 28 0x2803 10 0 0004 0 1703 0 0005 0 0188 sLedBlinking c 29 0 0006 0 0189 LedBlinking c 30 0x0007 0x1283 0x0008 0x1387 LedBlinking c 31 0x0009 0x1388 Figure 9 2 Assembly language LST file generated by mikroListExporter v 2 0 Date Time 7 1 2011 2 31 27 PM void main ANSEL 0 BSF STATUS 6 CLRF ANSEL ANSELH 0 CLRF ANSELH C10N bit 0 BCF STATUS 5 BCF C10N bit C20N bit 0 BCF C20N bit 10 EEPROM Watch window You can start EEPROM Watch window using View Debug Windows gt EEPROM Window option It shows the values currently stored in the MCU internal EEPROM memory e Click the Read EEPROM CE gu of microcontroller EEPROM ai lias memory which will be shown in the EEPROM Watch window esssls e Click the Write EEPROM button to program the data from the EEPROM Watch window into the internal EEPROM memory of the microcontroller e eo e S 8388585888388 8 8 8 8 8 8 8 8 8 8 e eo 8 8 8 8 8 8 8 8 8 8 8 S 8 8 8 8 8 8 8 8 8 8 8 8558585885888888 S 88 8 8 8 8 8 8 8 8 8 G 8 8 8 8 8 8 8 8 58 8 85 8 81818 8 00 00 00 00 00 00 00 00 00 00 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8858588888888 885858
12. kralCD Figure 2 1 Build Debugger Type options i Select ICD Debug option to create debug output HEX file Select mikroICD option to enable usage of mikrolCD debugger for debugging Step 2 Build your project Next step is to build your project and to program it to MCU memory To do that click on Build gt Build Program Ctrl F11 option or click on icon in the build toolbar Compiler will automatically build the program and start mikroProg Suite for PIC software which will program the code into microcontroller Build Ctrl F9 Rebuild All Sources Alt F3 9 SLBA 13 32 2 Build And Program Build current project and t resin Stop Build All Ctrl F12 E Build Program Ctri F11 Figure 2 2 Build menu Figure 2 3 Build toolbar Activate Build Menu From drop down menu select Build Program option or press Ctrl F11 on your keyboard Start mikrolCD debug To start mikroICD debugging open the Eie Edt View Project Build Run Took Bf Debug ayou id gigi Run menu and click the Start Debugger PON Wee K mM LedBlinkine 2 Values F9 option or icon from Run toolbar 2o A CY pro for pic p P 8 4 Add 96 Remove Properties 4 Ad
13. ll Search far variable by assembly name PORTE Peripheralz Freeze Name Value Figure 3 5 Watch values window 4 Watch Window What are the Watch Variables Each special function register SFR and user defined variables which are not removed by the optimizer can be monitored in Watch Window during the debugging process With execution of each program line values of selected variables are automatically updated Watch Window also provides the information about the memory address and the full assembly name of each variable Types of variables Purple colored variables are special function registers and sbit variables from the definition file of the selected microcontroller Black colored variables represent user defined variables or variables used internally by compiler libraries Adding Watch Variables Adding variable for monitoring can be done in two simple ways by selecting the variable from the drop down list or by searching for the desired variable using the search box Step 1 Select variable Watch Values l Er 8871 eo 9 er mi Te Me ET me Add Remove X Properties Add All 4 Remove Select varable from list Ox0 FEO Ox0F40 PMSTAT 0 0 41 PMSTATH Ox0F40 PMSTATL Ox0F64 PMWR PORTE bit _ Ox0FS7 PMWA PORTH bit OxOFDO BOR bit 2x0F81 FORTE Ox0FS82 PORIC 3 Ox0FS3 POBRID T Figure 4 1 Select variable f
14. ned int half address 2 F n ee hee TFT Fill Screen CL AQUA ia j Disable other peripheral E TRISDO bit 0 o LATDO bit 1 v TRISB4 bit 0 LATB4 bit 1 70 e PLLEN bit 1 e i Delav ms i50 To execute program one line at the time you can use Step Into F7 and Step Over F8 options Execute remaining lines void main e ANSELH 0 e C10N bit 0 C20N bit 0 TRISA 0x00 34 TRISB 0x00 a i TRISC 0x00 Execution of all remaining program lines is available via Step Out o Ctrl F8 option Debugging will stop when all lines in subroutine are executed Execute to cursor void main c a ANSELH 0 C1ON bit 0 C20N bit 0 e TRISA 0x00 esa TRISB i TRISc oxo l In order to execute program starting from the current line to one where cursor is placed use option Run to Cursor gt I F4 Program will start execution at the current line blue strip and it will stop at line where cursor is placed 7 Using Breakpoints Avoid main ED D c z C10N bit 0 Disable Ei TRISA 0x00 set dii E 34 ff i TRISC 0x00 ff set dia TRISD 0x00 ff set dia Enabl File Name Turn GI 4 LedBlinking c Turn OE Leablinking t Turn OE Turn OF 4 1 secor PORTA Figure
15. on Breakpoint 3 Otherwise Breakpoint 3 will be used only to stop the Stopwatch mikrolCD debugging F6 then the program Reset Stopwatch on Run when checked the Stopwatch will be cleared before execution will start from the first instruction continuing program execution and the next counting will start from zero Otherwise the following the SLEEP instruction next counting will start from the previous Stopwatch value 9 Disassembly view During the process of compiling each program line written in a high level programming language is replaced with one or more assembly instructions To display program in the assembly language select the View gt Listing option or click icon in toolbar In this case LedBlinking c ES C LedBiinking tst 75 e 9 e Figure 9 1 High level programming language 20 SW mikroC PRO for PIC http www mikroe com eng produc NOTES Turn ON the PORT LEDs at 19 void main ANSELH C10N bit 0 C20N bit 0 Disable comparators TRISA 0x00 set direction to be output TRISB 0x00 set direction to be outpu TRISC 0x00 set direction to be output TRISD 0x00 set direction to be output an 1 the process of simulating and debugging is performed in the same way as if the program is written in a high level programming language To toggle between high level language and assembly language press Alt D on your keyboard or click on
16. or monitoring 9 Click to show drop down menu Select desired variable for monitoring Step 2 E Add Va riable Instead of selecting variable from list you can type in variable assembly name in the search box Select variable fram list Select variable fram list PORTA TRISA Search for ble by assembly name rrrrrrrrr Search for variable by assembly name PORTA a Mame Value Address PORTA Figure 4 2 Add variable for monitoring Figure 4 3 Search for variable 9 Click the Add button and selected variable will be added to list 01 Type in variable assembly name List with selected variables Click on add variable button Variable is added to list Page 11 5 Debugger toolbar Figure 5 1 Debugger toolbar To simplify debugging compiler IDE contains toolbar with icons ES Eh Ey 90 oF oT m that allow single click access to mikrolCD commands Debug commands Execution commands Managing breakpoints Ey Sh Eh 20 RM OD OI m The first three icons on the toolbar are Next set of icons enables you to Last set of icons is related to breakpoints used for starting stopping debugger execute program in real time and interrupt option Start debugger F9 gt Step Into F7 Toggle Breakpoint F5 Run Pause Debugger F6 e Step Over F8 2 1 Show Hide breakpoints Shift F4 Oc Step Out Ctrl F8 Clears breakpoints Shift Ctrl F5 Stop Debugge
17. r Ctrl F2 gt Run To Cursor F4 gu Jump to interrupt F2 Toolbar Icon D0 3 Name Shortcut Start Debugger F9 Run Pause Debugger F6 Stop Debugger Ctrl F2 Step Into F7 Step Over F8 Step Out Ctrl F8 Run To Cursor F4 Toggle Breakpoint F5 Show Hide breakpoints Shift F4 Clears breakpoints Shift Ctri F5 Jump to interrupt F2 Description Starts Debugger Run Pause Debugger Stops Debugger Executes the current program line then halts If the executed program line calls another routine the debugger steps into the routine and halts after executing the first instruction within it Executes the current program line then halts If the executed program line calls another routine the debugger will not step into it The whole routine will be executed and the debugger halts at the first instruction following the call Executes all remaining program lines within the subroutine The debugger halts immediately upon exiting the subroutine Executes the program until reaching the cursor position Toggle breakpoints option sets new breakpoints or removes those already set at the current cursor position Shows Hides window with all breakpoints Deletes selected breakpoints Opens window with available interrupts doesn t work in mikrolCD mode 6 Real Time debugging Real Time debugging enables execution of program in three different ways Step by Step 60 unsig
18. rpose MikroElektronika shall assume no responsibility or liability for any errors omissions and inaccuracies that may appear in this manual In no event shall MikroElektronika its directors officers employees or distributors be liable for any indirect specific incidental or consequential damages including damages for loss of business profits and business information business interruption or any other pecuniary loss arising out of the use of this manual or product even if MikroElektronika has been advised of the possibility of such damages MikroElektronika reserves the right to change information contained in this manual at any time without prior notice if necessary TRADEMARKS The MikroElektronika name and logo the MikroElektronika logo mikroC mikroBasic mikroPascal mikroProg EasyPIC EasyPIC PRO mikrolICD and mikromedia are trademarks of MikroElektronika All other trademarks mentioned herein are property of their respective companies All other product and corporate names appearing in this manual may or may not be registered trademarks or copyrights of their respective companies and are only used for identification or explanation and to the owners benefit with no intent to infringe Copyright MikroElektronika 2012 All Rights Reserved If you want to learn more about our products please visit our website at www mikroe com If you are experiencing some problems with any of our products or just n
19. t S ti 5 e listo dsPIC and PIC32 have the Debugger TRISB 0 set direction to be output mikroE n i Software mikrolCD lt TRISC 0 set direction to be output 8 ADC same IDE so using mikrolCD E m E Messages Quick Converter Flash IS the same for all Errors Warnings v Hints Compact Flash FAT16 Conversions Line Message No Message Text Unit Math 0 127 All files Compiled in 31 ms C Stdlib 0 1144 Used RAM bytes 0 1 Free RAM bytes 1515 99 Used RAM bytes 0 1 7 C String After the com ler is started 0 1144 Used ROM bytes 120 196 Free ROM bytes 32648 99 Used ROM bytes 120 1 gt E 0 125 Project Linked Successfully LedBlinking mcppi 8 EEPROM H H 0 128 Linked in 47 ms E write a new project or open the E Bonum e _ Sti n E n e Compiled CA mikroC PRO for PIC Examples Development Systems EASYPIC7 Led Figure 1 1 mikroC PRO for PIC window Page 6 2 Preparing mikrolCD In order to use mikrolCD you have to program your microcontroller with debug enabled HEX file of your project This is done in two simple steps Step 1 Enable mikrolCD Under Project Settings Build Debugger Type select ICD Debug mikrolCD options zi Build Debugger Type Build Type Release Co eki Debugger 3 Software 2 mi
20. ted with programmer via PGC PGD and o 25 MCLR pins These pins are used for programing purposes and cannot be used as 1 0 while mikrolCD is in use Before using mikrolCD it is necessary to program target microcontroller with a debug enabled version of your output HEX file Compilers cond All MikroElektronika compilers mikroC mikroBasic and mikroPascal for PIC dsPIC FOMPILER 1 1 and PIC32 natively support mikroICD Specialized mikroICD DLL module allows compilers to exploit the full potential of fast hardware debugging Along with compilers make sure to install the appropriate programmer drivers and mikroProg Suite for PIC programming software 1 Starting After the a ppropr iate software mikroC PRO for PIC v 5 4 0 CAUsers Public Documents Mikroelektronika mikroC PRO for PIC Examples Development Systems EASYPICALed Blinking LedBlinking meppi 000000000 lela jk File Edit View Project Build Run Tools Help and hardware is installed and DIB ES GF NAARAS AAN DEANT i id im iO Code Explorer es 15 P attached to your it s time to Bg Functions E 1 T ERHUE pua start the chosen compiler Q main LED Blinking Simple Hello World project Globals Copyright Esterni c Mikroelektronika 2011 TypeDef E Revision History Tags 20110929 In
21. vanced Breakpoint Advanced Breakpoints option with PIC18 PIC24 and dsPIC microcontrollers To enable it check the Program Memory Break Ei hogan EB ogee Manoy Seam Advanced Breakpoints check box within the Watch Address Ox 0000 Address 0 0000 Address 0 0000 Values window To configure the Advanced Breakpoints s mm V File Register Break 62 V File Register Break V File Register Break option it is necessary to start up mikrolCD F9 sU o m and select the View Debug Windows Advanced Read Access Read Acces Read Access Breakpoints option or to use the keyboard shortcut Write Access Write Access Write Access File Register Equal E File Register Equal File Register Equal Ctrl Shift A alue 0 00 Jalue 0 00 Value Ox 100 View Project Build Run Tools Help Debug Windows Watch Window Shift F5 Passcount 1 Passcount 1 Passcount 1 Toolbars gt Stopwatch Emulator Features o f Bookmarks Breakpoints Shift F4 Event Breakpoints F Enable Stopwatch Ta Code Explorer Advanced Breakpoints Shift Ctrl A Break on Stack Over Underfiow Halt on Start Condition Breakpoint 2 TNT Break on Watchdog Timer F Halt on Stop Condition Breakpoint 3 i i E E Break on SLEEP E Reset Stopwatch Run Macro Editor EEPROM Window 0 v Messages CODE Window Project Manager Shift Ctrl F11 i Project Settings
Download Pdf Manuals
Related Search
Related Contents
UM0492 User manual DOEPFER System A-100 BBD Module A-188 Bissell 3130 Vacuum Cleaner User Manual wine cooler AQ2140 Specification BE 1 Magnetic - inductive flowmeter type PEM Manual Cube20 System Copyright © All rights reserved.
Failed to retrieve file