<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JTAG Archives - Digital Me</title>
	<atom:link href="https://ba0sh1.com/tag/jtag/feed/" rel="self" type="application/rss+xml" />
	<link>https://ba0sh1.com/tag/jtag/</link>
	<description>Electronics, Computers at leisure time</description>
	<lastBuildDate>Tue, 31 Dec 2013 14:55:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
	<item>
		<title>JTAG adapter for Arduino Micro</title>
		<link>https://ba0sh1.com/2013/12/31/jtag-adapter-arduino-micro/</link>
					<comments>https://ba0sh1.com/2013/12/31/jtag-adapter-arduino-micro/#comments</comments>
		
		<dc:creator><![CDATA[Baoshi]]></dc:creator>
		<pubDate>Tue, 31 Dec 2013 14:55:14 +0000</pubDate>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[JTAG]]></category>
		<category><![CDATA[JTAGICE3]]></category>
		<guid isPermaLink="false">https://www.ba0sh1.com/?p=848</guid>

					<description><![CDATA[<p>For the holiday season I get myself an AVR JTAGICE3. Holding the new shiny emulator and a bunch of Arduino boards, what shall I do? Of course to hop onto the all-hail...</p>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2013/12/31/jtag-adapter-arduino-micro/">JTAG adapter for Arduino Micro</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>For the holiday season I get myself an AVR JTAGICE3. Holding the new shiny emulator and a bunch of Arduino boards, what shall I do? Of course to hop onto the all-hail Atmel Studio and ditch the toy-alike Arduino software. Reason being? Debugging Arduino code with serial console is no fun. I need my single steps, breakpoints and watches back. In fact the Arduino boards seems to be more valuable (to me) without the software. The onboard ISP connector seems to be standard and it &#8220;just works&#8221; with JTAGICE3. Well, I had this &#8220;just works&#8221; impression until I tried it on the new Arduino Micro board&#8230;<span id="more-848"></span></p>
<p>Make the story straight. The Atmel ISP connector combines SPI bus and RESET signal. SPI is used for downloading program, and RESET implements Atmel&#8217;s &#8220;debugWire&#8221; on-chip debug system. debugWire OCD is a very fancy protocol that uses only one RESET pin to debug. ATmega328p supports debugWire, and hence the ISP connector on Arduino UNO can be used for debugging. Arduino Micro uses a newer ATmega32U4 chip. Surprisingly debugWire is missing from the product datasheet, instead JTAG is listed. JTAG uses 4 I/O pins,  from Arduino Micro schematic we can see the JTAG pins (TDI/TDO/TMS/TCK) are multiplexed with analog pin A0-A3. It appears I have to sacrifice these analog pins for the JTAG interface.</p>
<figure id="attachment_854" aria-describedby="caption-attachment-854" style="width: 288px" class="wp-caption aligncenter"><img decoding="async" class="size-full wp-image-854  " title="JTAG pins on Arduino Micro" alt="JTAG pins on Arduino Micro" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/c611b-atmega32u4-jtag.png" width="288" height="196" /><figcaption id="caption-attachment-854" class="wp-caption-text">JTAG pins on Arduino Micro</figcaption></figure>
<p>JTAGICE3 comes with a 10-pin JTAG header, with the definition as follows:</p>
<figure id="attachment_855" aria-describedby="caption-attachment-855" style="width: 133px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-855 " title="JTAG header" alt="JTAG header" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/863a1-jtag-header.png" width="133" height="135" /><figcaption id="caption-attachment-855" class="wp-caption-text">JTAGICE3 JTAG Pinout</figcaption></figure>
<p>All I need to do is to make an adapter connecting these pins:</p>
<figure id="attachment_857" aria-describedby="caption-attachment-857" style="width: 462px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/590aa-arduino-micro-jtag.png" target="_blank" rel="noopener"><img decoding="async" loading="lazy" class=" wp-image-857  " title="JTAG on Arduino Micro" alt="JTAG on Arduino Micro" src="https://www.ba0sh1.com/wp-content/uploads/2013/12/Arduino-Micro-JTAG-1024x423.png" width="462" height="191" /></a><figcaption id="caption-attachment-857" class="wp-caption-text">JTAG on Arduino Micro</figcaption></figure>
<p>The actual construction is done on a perf board. I made it Arduino &#8220;Shield&#8221; type so they can be simply stacked together.</p>
<figure id="attachment_859" aria-describedby="caption-attachment-859" style="width: 600px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/756bb-arduino-micro-jtag-shield.png"><img decoding="async" loading="lazy" class="size-full wp-image-859" alt="Arduino Micro JTAG Shield" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/756bb-arduino-micro-jtag-shield.png" width="600" height="450" srcset="https://ba0sh1.com/wp-content/uploads/2013/12/756bb-arduino-micro-jtag-shield.png 600w, https://ba0sh1.com/wp-content/uploads/2013/12/756bb-arduino-micro-jtag-shield-300x225.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption id="caption-attachment-859" class="wp-caption-text">Arduino Micro JTAG Shield</figcaption></figure>
<p>I admit it looks quite dangerous when stacked up <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f62e.png" alt="😮" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<figure id="attachment_861" aria-describedby="caption-attachment-861" style="width: 600px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/74d25-arduino-micro-with-jtag.png" target="_blank" rel="noopener"><img decoding="async" loading="lazy" class="size-full wp-image-861 " alt="JTAG connected" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/74d25-arduino-micro-with-jtag.png" width="600" height="450" srcset="https://ba0sh1.com/wp-content/uploads/2013/12/74d25-arduino-micro-with-jtag.png 600w, https://ba0sh1.com/wp-content/uploads/2013/12/74d25-arduino-micro-with-jtag-300x225.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption id="caption-attachment-861" class="wp-caption-text">JTAG connected</figcaption></figure>
<p>I hook up JTAGICE3 and choose JTAG interface in Atmel Studio. And no surprise. Murphy gets me everytime! &#8220;[ERROR] No JTAG devices detected.&#8221; is the only reply I get. I Scratch my head several hours then to realize how stupid I were. Since the pins PF4-PF7 have been used as analog inputs for Arduino, how can JTAG establish connection with these pins! And the resolution is simple: connect using ISP header and enable the JTAGEN fuse bit. Now I feel the usefulness of ISP connector.</p>
<figure id="attachment_862" aria-describedby="caption-attachment-862" style="width: 560px" class="wp-caption aligncenter"><a class="thumbnail" href="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/2863d-enable-jtagen.png" target="_blank" rel="noopener"><img decoding="async" loading="lazy" class=" wp-image-862  " alt="Enable JTAGEN Fuse" src="http://blog.ba0sh1.com/wordpress/wp-content/uploads/2013/12/2863d-enable-jtagen.png" width="560" height="480" srcset="https://ba0sh1.com/wp-content/uploads/2013/12/2863d-enable-jtagen.png 700w, https://ba0sh1.com/wp-content/uploads/2013/12/2863d-enable-jtagen-300x257.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></a><figcaption id="caption-attachment-862" class="wp-caption-text">Enable JTAGEN Fuse</figcaption></figure>
<p>I can finally talk to ATmega32U4 using JTAG and do some debugging. The coming year will be interesting <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2013/12/31/jtag-adapter-arduino-micro/">JTAG adapter for Arduino Micro</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ba0sh1.com/2013/12/31/jtag-adapter-arduino-micro/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
