2010年9月1日 星期三

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.

AVR_JTAG_clone.jpg

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:

AVRjtag_SCH.png
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.

AVR_JTAG_clone_to_atmega128.jpg

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

Otherwise AVR Studio will throw an error:
Jtag_Valid_ID.jpg
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):

debug_platform.png

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.
debugging.png

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.

JTAG ICE & AVR Studio




沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。