AVRJTAG clone in action
Building AVR Jtag clone
Finally I found some time to finish AVRJTAG clone. It was hanging for a while on a breadboard with bunch of wires. I have made an Eagle CAD project with PCB layout you will find at the bottom of article.

I didn’t change the circuit very much from previous, just added ISP header(but didn’t have a chance to test it) and transferred to Eagle project as I didn’t find one ready to build:
Description on how to update firmware is in previous article <Build your own AVR JTAG ICE clone>.
Testing AVR Jtag in action
Let’s give a test run. Using Jtag is easy as using AVR Studio simulator. Difference is only that you have to connect JTAG adapter to target board. Im my case I am using Atmega128L Piconomic board.

In the board there is a connector for Jtag adapter/debugger. Second option is to set JTAGEN fuse for target MCU.

Otherwise AVR Studio will throw an error:

After hardware is ready lets try with sample project. For this create AVR-GCC project in AVRStudio environment. Then select debugger platform (JTAG ICE) and AVR MCU(in my case Atmega128):

Write a simple program which controls a button and LED: button_led.c
Compile program and start debugger with run command. You can work with JTAG debugger as with simulator – stepping, auto-stepping, break-points, memory views, changing register and memory values and so on.

One difference that program is running in real world. So it is easy to debug platform with additional peripherals connected to MCU. And of course real time execution.
Project files for Eagle CAD and boot-loader are here: avr_jtag_clone.zip
Good luck.
Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post | TrackBack URI for this post
New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …Programming AVR ADC module with WinAVR,Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut … |
New on WinARM Tutorial
What are differences between WinARM and WinAVR,Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …LPC2000 watchdog timer,As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount … |

January 19th, 2007 at 10:02 pm
And how does it work with VCC connected to reset?
February 20th, 2007 at 1:08 pm
The ATmega16 Vcc,AVCC must be connected to the +5V net.
The AVRISP connector 5 pin(reset), should be connected to the JTAG connector 6pin (nSRST), not to the ATmega16 RST net.
February 20th, 2007 at 3:14 pm
AVR ISP connector 5 pin is OK I think as ISP head is only used to upload bootloader to adapter itself via ISP interface. It has nothing to do with JTAG. But VCC and AVCC circuit in picture is connected improperly. I will look at my original circuit if there is same problem, because my adapter works OK. Thanks Laszlo for notice.
February 20th, 2007 at 3:47 pm
Yep same error in my board. Can anyone tell my why it works for me with VCC connected to Reset pin? I have fixed circuit and pcb files. Thank you for your notice.
February 21st, 2007 at 10:44 am
probably ot works because the output pins have some diodes for protection, and draws the power from your target board.
I have a AVRJTAGICE mkII and that has this feature, you just connect a small adapter to the JTAG connector,and select ISP mode.
I tought that the JTAGICE has this feature to.
April 14th, 2007 at 12:13 pm
Hy,
I’ve build this JTAG loaded the bootloader, when I try to upgrade the ATmega163 is selected, and I get a verification error to, and offcourse I can’t connect to the JTAG adapter trough AVRStudio.
Please explain this errors, and give some answer.
Regards, Laszlo
April 19th, 2007 at 10:59 am
I build the PCB and load the bootloader and the upgrade files into mega16 by following your instructions. Fuse was programed the same as you describled.
but when I try to connect it to another Mega16(jtag enabled) to test. it comes with a error message:”cannot connect JTAG ICE from port x” (all available ports were tested)
The wire connection is good, and the target mega16 jtag connection is good, I dont understand why it didn’t work.
please help me!!!!
September 2nd, 2007 at 6:05 pm
Hi,
I made this JTAG ICE and everything seem to be fine, but when I build mentioned “button_led.c” and start debugging, program pointer appears out of program range (see screenshots http://www.imagecross.com/myspace-image-hosting-viewer-d.php?id=3145Screenshot-0.gif , http://www.imagecross.com/myspace-image-hosting-viewer-d.php?id=5241Screenshot-1.gif and http://www.imagecross.com/myspace-image-hosting-viewer-d.php?id=8699Screenshot-2.gif ).
Any idea what is wrong? After two days of testing I had no solution. Realy appreciate any hint. Thanks.
September 2nd, 2007 at 11:50 pm
Problem found! :) I made mistake with connecting external crystal and setting FUSE to external CLOCK. After changing FUSEs all working great. Sorry :)
September 3rd, 2007 at 10:41 am
Nice to hear that. Good luck.
December 24th, 2007 at 7:20 am
Hi :), juz wondering whether this AVRJTAG works with ATMega1280/1281/2560/2561? Has anyone try to use this JTAG for these chips?
February 27th, 2008 at 1:25 am
I’ve build this JTAG loaded the bootloader, when I try to upgrade the ATmega163 is selected, and I get a verification error to, and offcourse I can’t connect to the JTAG adapter trough AVRStudio.
Please explain this errors, and give some answer.
February 27th, 2008 at 1:27 am
please tell me could I use Max232 intant of Max3232,because I havn’t found it .
February 27th, 2008 at 2:15 am
Yes it has to be MAX232.
Double check the fuses - it should work.
February 27th, 2008 at 4:37 am
I built the JTAG, downloaded the bootice16_rom into the mega16, set the fuses as described in the page, but when i try to upgrade the soft i get that the device is an mega163 and an error about no able to erase the device at the end of the progress bar. I am using an mega16 but the 8 mhz maxium version. I sounds like the same described in a previous post.
February 27th, 2008 at 1:14 pm
Upgrade error:
The complete text of the error is: Adress: 0×0000, expected 0×940c, Received: 0xffff
February 27th, 2008 at 1:48 pm
Maybe you used a bootloader for mega16 instead of mega163? Hard to say right now where is a problem.
February 27th, 2008 at 2:33 pm
Another diagnosis, it is so strange because i can read flash and eeprom using de avrprog of the avrstudio via the serial port. In the other hand, i downloaded the bootloader containded into avr_jtag_clone.zip. So besides the error of the incorrect micro version, could be that there is a problem with the programming voltages. The Pcb is the attached in the quoted file. I will keep trying another possibilites.
April 11th, 2008 at 2:02 am
I get the “No supported board found, AVR Prog version 1.40″ message” when selecting AVRProg.
i havent got any pony prog hw, but then a jtagice mkII.
i have to make a cheap programmer for atmega128L.
could anyone show some picture about conf. and sec. bits window as the avr studio shows it?