Using AVR® JTAGICE mkII Debugger

  Important :

To successfully use AVR® JTAGICE mkII Debugger with generated .cof file, follow the steps below :

  1. First of all, start mikroC PRO for AVR and open the desired project.
  2. Open Tools › Options › Output settings, and check the "Generate COFF file" option, and click the OK button.
  3. Next, compile the project by pressing Ctrl + F9.
  4. Connect USB cable and turn on power supply on EasyAVR6.
  5. Program the MCU by pressing F11 and make sure that JTAGEN Fuse Bit is checked in the AVRFlash :
  6. JTAGEN Fuse Bit

  7. Connect external power supply and PC USB cable to the AVR® JTAGICE mkII Debugger's appropriate sockets.
  8. Connect probe cable of the AVR® JTAGICE mkII Debugger to the JTAG socket of EasyAVR6 :
  9. Connecting probe cable to the EasyAVR6

  10. Turn on power switch on AVR® JTAGICE mkII Debugger.
  11. Open AVR Studio, and under File menu, select Open File... Go to the project folder and open the generated COFF file, UART.cof :
  12. Open COFF file

  13. After that, you will be asked to save AVR Studio® Project File. To ensure proper debugging, this file should be located at the root of the original source file project.
  14. Then, appropriate device, debugger platform and port should be selected :
  15. Select Device And Debugger Platform

  16. AVR® JTAGICE mkII options window will appear after. There, following settings should be configured :
    Under Connection tab, Target clock frequency should be entered, and under Debug tab, Only reprogram device if object file has changed option should be checked.
  17. AVR® JTAGICE mkII Options

  18. Now, you can start debugging the code by clicking Step Over button Step Over Button on the Debug toolbar, or by pressing F10 :
  19. Assembly Code Debugging

  20. As you can see, the code you are debugging is in the assembly. To debug original source code, you should open the source file containing it, using File -> Open :
  21. Source Code Debugging

Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code