AVR JTAG ICE clone

What's this?

  Time to time is hard to find a bug in firmware. It could be useful know how program run, step program and watch what happens. And for this is there JTAG debugger. It allow to "look inside" MCU, so you can find bug much easier. Whole project is just modification of Aquaticus AVR JTAG. For more info look there.

AVR JTAG ICE clone

How it works?

  Communication with target MCU is done thru JTAG protocol. JTAG allow read registers, memories, state of individual periferies and so on. Communication with computer is thru virtual COM port (IC FT230X). Driver for virtual COM port is already in Linux kernel. However, on Windows you will need to install driver. User on application level (for example: AVR Studio) just set breakpoints and step whole program. As JTAG connector is there used 10. pin connector.
AVR JTAG conector
Pin Name In/Out Description
1 TCK Out Clock for target chip
2 GND - Ground
3 TDO In Test Data Output - data from target chip
4 VTREF In Voltage level on target device. It must not be 0 V, else communication with target chip will be deny!
5 TMS Out Test Mode Select - switch mode in state machine
6 NSRST In/Out On side JTAG IS is it pin which open collector, so it can be used as input or output. This pin is connected to the RESET of target AVR.
7 VSUPP In/Out/NC Due to JTAG ICE is powered by USB, there is option to power target device too. Also this pin can work as input. LED signalize voltage level. This pin do not have to be connected with target device.
8 NTRST In/NC Not connected. Pin is reserved for others JTAG devices (Reset JTAG interface).
9 TDI Out Test Data Output - data from JATG ICE
10 GND - Ground

Scheme for AVR JTAG ICE clone

How to build

   First you need to load firmware to flash. Because this device do not have special ISP connector, programming will be a little bit tough. However device was designed for this. First solder wire to testpoint TP1 and connect it with RESET signal on ISP programmer. Signals SCK, MISO and MOSI (pins 1,2 and 3) is possible connect via JTAG connector (pins 9,3 and 1). Do not forget connect ground and power supply not just for JTAG ICE, but even for ATmega16/ATmega16A.

Pins for ISP programming

   If you use USBasp and avrdude, then just type to command line:
avrdude -c usbasp -p m16 -U flash:w:path/to/aquaticus_jtag_m16.hex

   This command load program to the flash memmory. Now is need to set fuses correctly. Low 8 bits should be set as 0xFF, high 8 bits as 0xD8. If you use USBasp, then just type:
avrdude -c usbasp -p m16 -U lfuse:w:0xff:m -U hfuse:w:0xd8:m

Now just connect 2 and 3 (Norm) on JP1 and choose voltage level on which will JTAG ICE work (JP2: 5 or 3,3 V). Finally JTAG ICE is ready. Howto test JTAG ICE under AVR Studio 4 is for example on http://aquaticus.info. If you do not like problems, you should set also virtual COM port this way:
Bps = 115 200
Data bits = 8
parity = none
Stop bits = 1
Flow control = none

Download

All in one. Documentation, HW design, Firmware, stickers and so on...
  • AVR JTAG ICE clone.zip  (1631x)
  • Conclusion

       Device works perfect in AVR Studio 4. In AVR Studio 6 I could not connect with JTAG ICE (probably JTAG ICE is not supported). If someone find out how it run under AVR Studio 6, just let me know ;-)
    TOPlist


    Update: 2018.10.22