After unsuccessful attempts to run a few programs which drive peripherals like USART and Timers on Atmega128, I decided to make a JTAG debugger. I hope it will allow me to see what is happening may atmega128 corrupted, or something is wrong with the software or hardware.
The most widely used AVR JTAGICE clone is AVR miniICE, which is compatible with the original AVR JTAGICE. AVR JTAG is mainly used for target board debugging in the real world. And of course, you also can program your AVR’s with it.
To build this board is very ease as its schematic is simple:
List of materials you will need:
- 2-470R-R1, R2
- 2-22p-C7, C8
- 1-7.3728 MHz-Q1
All secret in its firmware, but don’t worry – it is ready to go.
AVR MiniICE has the following properties:
- Is compatible with AVR JTAG ICE;
- It is capable of debugging and programming Atmega microcontrollers with JTAG interface;
- Real-time debugging support;
- Regular updates of firmware to support new types of AVR;
- Upgrades can be done directly from AVR Studio;
- Power supply from 2.6 to 6V;
- Connects to AVR Studio through COM port;
- Two LED indicators (Power and Connect).
Now AVR studio 4 supports following AVR MCU’s (maybe already new ones included):
- ATmega128, ATmega128L, AT90CAN128
- ATmega16, ATmega16L
- ATmega162, ATmega162L, ATmega162V
- ATmega165, ATmega165V
- ATmega169, ATmega169L, ATmega169V
- ATmega32, ATmega32L
- ATmega323, ATmega323L
- ATmega64, ATmega64L
How to set up this adapter to be ready. The main thing is that you have to upload the firmware to it. For this, you will need an ISP programmer. First of all, you will need to upload a Bootloader (or Alternative bootloader )to Atmega16 to be able to update the firmware to the newest one located in the AVR Studio directory.
When the bootloader is programmed program fuses like this (Using PonyProg):
Then connect AVR miniIce cable to the PC COM port and start AVR Studio. In the AVR Studio Tools menu locate AVR Prog. And browse for file upgrade.ebn in AVR Studio directory (by default in “
C:\Program Files\Atmel\AVR Tools\JTAGICE\Upgrade.ebn“):
After AVR is programmed (usually you will get some error message – don’t pay attention to it), you can program AVR fuses to its previous state – to disable bootloader:
This is it. You have done it. If you did it correctly, it should work. Here is my prototyping view:
As I mentioned, AVR MiniICE can be used as an AVR programmer as well. Goto Tools->Program AVR. Then select AVR programmer JTAG ICE and desired COM port. After this you will be directed to the JTAG ICE dialog window where you can program your target AVR:
How to start debugging will be in following articles.
Download Another AVRICE project with SCH and PCB files as images.