Académique Documents
Professionnel Documents
Culture Documents
USER GUIDE
® ®
The Atmel AVR JTAGICE mkII supports On-Chip Debugging and
programming on all Atmel AVR 8- and 32-bit microcontrollers and processors
with On-Chip Debug capability.
Supported interfaces are:
® ®
• JTAG (AVR 32-bit, AVR XMEGA , and megaAVR devices)
• PDI (AVR XMEGA devices) *Hardware revision 01 only
®
• debugWIRE (megaAVR and tinyAVR devices)
• SPI (megaAVR and tinyAVR devices)
• aWire (AVR 32-bit devices) *Hardware revision 01 only
Atmel-42710A-AVR-JTAGICE-mkII_User Guide-04/2016
Table of Contents
1. Introduction................................................................................................................ 4
1.1. Atmel JTAGICE mkII Features..................................................................................................... 4
1.2. System Requirements.................................................................................................................. 4
1.3. Hardware Revisions..................................................................................................................... 4
2. Getting started........................................................................................................... 6
2.1. Kit Contents..................................................................................................................................6
2.2. Powering the Atmel AVR JTAGICE mkII...................................................................................... 7
2.3. Connecting to the Host Computer................................................................................................ 8
2.4. Serial Port Connection..................................................................................................................8
2.5. USB Driver Installation................................................................................................................. 8
2.5.1. Windows........................................................................................................................ 8
2.6. Debugging.................................................................................................................................. 10
4. On-Chip Debugging................................................................................................. 26
4.1. Introduction to On-Chip Debugging (OCD) ............................................................................... 26
4.2. Physical Interfaces..................................................................................................................... 26
4.2.1. JTAG............................................................................................................................ 27
4.2.2. aWire Physical............................................................................................................. 29
4.2.3. PDI Physical................................................................................................................ 29
4.2.4. debugWIRE................................................................................................................. 30
4.2.5. SPI............................................................................................................................... 30
4.3. Atmel AVR OCD Implementations..............................................................................................31
4.3.1. Atmel AVR UC3 OCD (JTAG and aWire).....................................................................31
4.3.2. Atmel AVR XMEGA OCD (JTAG and PDI Physical)....................................................31
4.3.3. Atmel megaAVR OCD (JTAG)..................................................................................... 31
4.3.4. Atmel megaAVR/tinyAVR OCD (debugWIRE)............................................................. 31
5. Hardware Description.............................................................................................. 32
5.1. Physical Dimensions.................................................................................................................. 32
5.2. LEDs...........................................................................................................................................32
5.3. Rear Panel..................................................................................................................................32
5.4. Architecture Description............................................................................................................. 33
6. Software Integration.................................................................................................36
6.1. Atmel Studio............................................................................................................................... 36
6.1.1. Atmel Studio................................................................................................................ 36
6.1.2. Atmel Studio Programming GUI.................................................................................. 36
6.1.3. Programming Options..................................................................................................36
6.1.4. Debug Options.............................................................................................................36
8. Special Considerations............................................................................................ 38
8.1. Atmel AVR XMEGA OCD........................................................................................................... 38
8.2. Atmel megaAVR OCD and debugWIRE OCD............................................................................38
8.3. Atmel megaAVR OCD (JTAG)....................................................................................................39
8.4. debugWIRE OCD....................................................................................................................... 40
8.5. Atmel AVR UC3 OCD................................................................................................................. 41
9. Troubleshooting....................................................................................................... 43
9.1. Troubleshooting Guide............................................................................................................... 43
Revision 1 also has a green LED inside the encapsulation, which light up when a USB connection is
made.
Revision 1 units are also fully RoHS compliant.
2.5.1. Windows
® ®
When installing the JTAGICE mkII on a computer running Microsoft Windows , the USB driver is loaded
when the unit is first powered up.
Note: Be sure to install the front-end software packages before powering up for the first time.
Proceed with the default ("recommended") options through the New Hardware Wizard.
If it is not detected automatically, point the wizard to the device driver (provided by Jungo) called
JTAGICEmkII.inf which is stored in the <windows_root>\inf folder.
2.6. Debugging
The simplest way to get started with your Atmel AVR JTAGICE mkII using Atmel Studio is to build one of
the many example projects from ASF. See the for more information.
Alternatively, the PDI interface can be connected using the multicolored "squid" cable, which is shipped
with the JTAGICE mkII kit.
JTAGICE mkII probe Target pins Squid cable colors STK600 PDI pinout
Pin 1 (TCK) Black
Pin 2 (GND) GND White 6
Pin 3 (TDO) Grey
Pin 4 (VTref) VTref Purple 2
Pin 5 (TMS) Blue
Pin 6 (nSRST) PDI_CLK Green 5
Pin 7 (Not connected) Yellow
Pin 8 (nTRST) Orange
Pin 9 (TDI) PDI_DATA Red 1
Pin 10 (GND) Brown
Be sure to use the correct orientation of the 6-pin header when connecting the Atmel AVR JTAGICE mkII
to the target application PCB.
JTAGICE mkII probe Target pins Squid cable colors SPI pinout
Pin 1 (TCK) SCK Black 3
Pin 2 (GND) GND White 6
Pin 3 (TDO) MISO Grey 1
Pin 4 (VTref) VTref Purple 2
Pin 5 (TMS) Blue
Pin 6 (nSRST) RESET Green 5
Pin 7 (Vsupply) Yellow
Pin 8 (nTRST) Orange
Pin 9 (TDI) MOSI Red 4
Pin 10 (GND) Brown
JTAGICE mkII probe Target pins Squid cable colors aWire pinout
Pin 1 (TCK) Black
Pin 2 (GND) GND White 6
Pin 3 (TDO) Grey
Pin 4 (VTref) VTref Purple 2
Pin 5 (TMS) Blue
Pin 6 (nSRST) Green
Pin 7 (Not connected) Yellow
Pin 8 (nTRST) Orange
Pin 9 (TDI) aWire Red 1
Pin 10 (GND) Brown
JTAGICE mkII probe Target pins Squid cable colors SPI pinout
Pin 1 (TCK) SCK Black 3
Pin 2 (GND) GND White 6
Pin 3 (TDO) MISO Grey 1
Pin 4 (VTref) VTref Purple 2
Pin 5 (TMS) Blue
Pin 6 (nSRST) RESET Green 5
Pin 7 (Vsupply) Yellow
Pin 8 (nTRST) Orange
Pin 9 (TDI) MOSI Red 4
Pin 10 (GND) Brown
Note: Add-on cards for the STK500 like e.g. STK501/502 usually have a dedicated JTAG connector.
If you do not have an STK500 JTAG adapter available, the 10-pin multicolored "squid" cable can also be
used to connect directly to the device's JTAG port on PORTC[5::2] of the STK500.
Alternatively, the JTAGICE mkII can be connected to any target interface using the 10-pin "squid" cable
(provided).
When designing an application PCB which includes an AVR with the JTAG interface, it is recommended
to use the pinout as shown in Figure 4-2 JTAG Header Pinout. The JTAGICE mkII 100-mil probe
connectors support this pinout.
Figure 4-2. JTAG Header Pinout
Note:
™
The pinout shown above is compatible with the Atmel STK600, Atmel AVR ONE!, AVR Dragon , and
future tools with PDI interface. The JTAGICE mkII supports this pinout using the AVR XMEGA PDI
adapter for JTAGICE mkII (shipped with the kit or available from your local Atmel representative.)
4.2.4. debugWIRE
The debugWIRE interface was developed by Atmel for use on low pin-count devices. Unlike the JTAG
interface which uses four pins, debugWIRE makes use of just a single pin (RESET) for bi-directional half-
duplex asynchronous communication with the debugger tool.
When designing an application PCB which includes an AVR with the debugWIRE interface, the pinout
shown in Figure 4-6 debugWIRE (SPI) Header Pinout should be used.
Figure 4-6. debugWIRE (SPI) Header Pinout
Note:
The debugWIRE interface cannot be used as a programming interface. This means that the SPI interface
must also be available (as shown in Figure 4-7 SPI Header Pinout) in order to program the target.
When the debugWIRE enable (DWEN) fuse is programmed and lock-bits are un-programmed, the
debugWIRE system within the target device is activated. The RESET pin is configured as a wired-AND
(open-drain) bi-directional I/O pin with pull-up enabled and becomes the communication gateway
between target and debugger.
4.2.5. SPI
In-System Programming uses the target Atmel AVR’s internal SPI (Serial Peripheral Interface) to
download code into the flash and EEPROM memories. It is not a debugging interface. When designing an
application PCB which includes an AVR with the SPI interface, the pinout shown in Figure 4-7 SPI
Header Pinout should be used.
Figure 4-7. SPI Header Pinout
5.2. LEDs
The Atmel AVR JTAGICE mkII three LEDs which indicate the status of current debug or programming
sessions.
Table 5-1. LEDs
5.4.3. Probe
The Target Adapter is pictured below. The 20-wire flex-cable connects the Target Adapter to the Atmel
AVR JTAGICE mkII. The Target Adapter has two 10-pin connectors that have identical pin-out, and
signals. Use the one that best fits the target board. Only one of the connectors should be connected at
any given time.
After Using the JTAGICE mkII to 1. The JTAG ENABLE fuse has 1. Program the JTAG ENABLE
download code to the device, the been disabled. fuse.
emulator no longer works
2. The programming interface is 2. Close the Programming
still active. It is not possible to interface, then enter emulation
use both OCD and programming mode.
at the same time
JTAGICE mkII is detected by JTAG: JTAG ENABLE Fuse is not JTAG: Use an other programming
Atmel Studio or other software programmed debugWIRE: interface to program the JTAG
front-end, but it will not connect DWEN Fuse is not programmed ENABLE Fuse
to target device
debugWIRE: Use an other
programming interface to
program the DWEN Fuse
Atmel Studio gives a message 1. No power on target board. 1. Apply power to target board.
that no voltage is present
2. Vtref not connected. 2. Make sure your JTAG
Connector includes the Vtref
3. Target Voltage too low.
signal.
3. Make sure the target power
supply is able to provide enough
power.
OCD fuse is disabled, but using The JTAGICE mkII will This is correct operation
the JTAGICE mkII, OCD is still automatically program the OCD
possible fuse if it is disabled
SPI programming after a When the debugWIRE Interface Re-enable the SPI Interface as
debugWIRE session is not is enabled the SPI Interface is described in section Special
possible disabled considerations "Connecting to
Target through the debugWIRE
Interface". Use command line
software to re-enable SPI
interface.
11.3.1. General
• Single stepping GCC-generated code in source-level may not always be possible. Set optimization
level to lowest for best results, and use the disassemble view when necessary.
11.3.6. Common
• When editing I/O bits in the I/O view: in order to clear a flag, which is "cleared by writing a one to its
bit location", first clear it, then set it immediately. After it is set, it will automatically be cleared by the
target device on its next cycle. Also note that any flags which are set in a register will be cleared by
editing the register, since the set flags are written back to the register, and thus get automatically
cleared.
• Single stepping a SLEEP instruction does not put the part into sleep mode. Use Run mode instead
of single stepping.
• It is not possible to edit the target flash content using the Program Memory View in Atmel Studio, or
by editing flash constants in the Watch Window
• When using USB, it is not possible to use one Atmel AVR JTAGICE mkII in a debug session and
another one for programming from the same instance of Atmel Studio. Use separate instances of
Atmel Studio when you need to debug a part and also have the programming interface available.
• It is not possible to upgrade a JTAGICE mkII over USB if it is connected via a bus-powered USB
hub
• Be aware that the On-chip Debug system is disabled when any Lock bits are set, as a security
feature
• Do no set the compatibility fuse while debugging with JTAGICE mkII for parts with this fuse bit
• On some devices, breaking execution on one of the two instructions immediately after an LPM
instruction seems to corrupt the flash displayed in the dis-assembly view. Workaround: Do not
single step LPM code, and do not insert breakpoints immediately after LPM instructions.
® ® ® ® ® ® ®
Atmel , Atmel logo and combinations thereof, Enabling Unlimited Possibilities , AVR , AVR Studio , megaAVR , tinyAVR , XMEGA , and others are registered
®
trademarks or trademarks of Atmel Corporation in U.S. and other countries. Windows is a registered trademark of Microsoft Corporation in U.S. and or other
countries. Other terms and product names may be trademarks of others.
DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any
intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND
CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED
OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS
INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this
document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to
update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive
applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.
SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any
applications where the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without
an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the
operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments
unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically
designated by Atmel as automotive-grade.