HappyJTAG2 - JTAG AND SPI AVR8 interface
EMBEDDED JTAG !
EMBEDDED SPI !


New version released ! V2.45 (Check version list for details)
This construction is based on HappyJTAG Idea, to implement JTAG interface into target avr system and debug it remotly via USB, without specific JTAGICE hardware. All job is done by PC softraware. HappyJTAG version is easy , but not powerfull enough.There is barriere with performance, if you are manipulating with bits via USB interface. USB trafic is to huge to be effective.

This is why I have realized more poverfull version HappyJTAG2.This version uses specialized FT2232 ( or FT2232H ) chip, which has integrated JTAG interface on chip. It radically reduces USB interface communication and speed up overall process. There are two channels in FT2232, Channel A is used for JTAG and channel B is still free for standart serial communication between target and host PC.

Unfortunatly, the FT2232 chip requires more external components than FT232 chip. For example, external crystal oscillator, few more resistors and so on. But the result is balanced, because of overall performance is 100 times better if you compere with original HappyJTAG version.

HappyJTAG2 hardvare is standart published in datasheets, as you can see from schematic file. The main idea is to integrate FT2232 in target board and to use USB interface as standart target board interface for all communication, serial as well as JTAG or SPI. But there is also possible to replace target AVR8 with JTAG or SPI connector and to operate this interface as standart AVR JTAG or SPI interface ( remember, there is not in/out signals level convertors and so on, you have to add them to interface in this case )

All logic is covered by PC application. This application has two connection One is via USB to target and second is via TCP to AVRStudio. All commands are interpreted to FT2232 commands and sended to target FT2232 chip to process JTAG and SPI data integrchange. This PC software works in two modes:

The first mode alows run as independent software. There is support for connecting target via JTAG or SPI, read signature, reset target, download software (*.hex) into tagrget and to manage target fuses (read, write).

The second mode is AVRstudio mode. In this mode PC software interprets AVRStudio requests and communicate with target via JTAG or SPI. For AVRStudio it works as JTAGICEMK2 emulation.

Since version 2.31, there is no need for external Virtual Serial Port emulator. The HappyJTAG2 emulates one of serial port COM1-COM4 byself. You just have to start HappyJTAG2, select "ComX port emulation" radiobutton and open AVRStudio. In AVR Studio choose COMx ( pre-set in menu ) port for JTAGICEMKII device. Its all !

However, external serial port emulator its still supported. You can use third party freeware software and utility, for exaple HW groupīs "Virtual Serial Port" . You can download this emulator from :

HW Virtual serial port

This port is bridge between COM port oriented serial commmunication of AVRStudio and TCP oriented communication of HappyJTAG2 PC software. This is why you have to set up VirtualSerialPort into mode, where it redirects communication from COM port to TCP. You have to enter IP address 127.0.0.1 and port 2232 into Virtual serial port and let it run before you setup AVR studio to work with JTAGICEMK2 hardware and run HappyJTAG2 pc software. You have to connect HappyJTAG2 PC software with VirtualSerialPort by pressing ""Connect to AVRStudio" button. Dont forget to set baud rate as high as possible (115000) in AVRStudio dialog box, because it is limitation factor for overall performance.


Since 2.33 version, HappyJTAG2 supports also GDB debugger. The interface is TCPIP, port 2232.

HappyJTAG2 PC software was developed for ATMega32 target, however , current version supports more AVR8 modifications. My future plan is to enhance this software for the others AVR devices. There is also Boundary scan, so you can see physical pin states in graphical presentatoion, which is equal to ATMega32 DIP40 target.
Here is list of currently supported AVR8 models :
JTAG
- ATmega16
- ATmega32
-ATMega128
-ATMega640 (Not tested yet)
-ATMega644 (Not tested yet)
-ATMega644P
-ATMega1280 (Not tested yet)
-ATMega2560 (Not tested yet)
-ATMega1281 (Not tested yet)
-ATMega2561
-AT90CAN128
-AT90USB128 (Not tested yet)
-ATXMEGA128A1
SPI
- ATtiny13
- ATmega48 (Not tested yet)
- ATmega88
- ATmega168
- ATmega16
- ATmega32
- ATmega640 (Not tested yet)
- ATmega644 (Not tested yet)
- ATmega644P
- ATmega128
- ATmega1280 (Not tested yet)
- ATmega1281 (Not tested yet)
-ATMega2560
-ATMega2561
-AT90CAN128
-AT90USB128 (Not tested yet)

As one of the benefits of this solution (FT2232) is, that this software can operate with third party hardware as well as with this embedded chip. As good example is Amontec JTAGkey hardware. You can use JTAGkey also for AVR8 chips in this case ! Its tested and it runs !

The first prototype :

And finaly :

HappyJTAG2 (Click at picture to see it in full resolution):

Schematic (Click at picture to see it in full resolution) :

PC HappyJTAG2 program file:



Short range ToDo:
- next AVR familly members implementation


Future plans :
Because of missing detail description of AVR OCD debug implementation, there is still list of unrealized functions and space for improvement debug to full level as we are used to for specialized JTAG ICE hardware solutions. (If you have some information about details of OCD DEBUG MODE, DEBUG REGISTERS, SEQUENCES and so on... please let me know and contribute to this project ! )
- Enhance BREAK support


Simillar situation is with HappyJTAG2/AVRStudio interconnection. It emulates serial port currently. But I would like replace it with USB port emulation. So if you know about free virtual USB port solution for Delphi, please let me know....

At the end:
Here published version is freeware, with some limitations and all features, which freeware usually has. There is no waranty and so on.... But on the other hand, you can use this utility free for all your projects. This freeware version has limitations (Check version list for details).
- LOCKFuses - you cannot change LOCK FUSES
- There is integrated prohibition for Fuse JTAGEN and SPI (depends on interface, you are using), you cannot clear this fuse, so you cannot STOP/DISABLE JTAG (or SPI if you are using SPI interface) interface with this freeware

If this is important solution for you, you can ask for full wersion, without limitations , by e-mail.



VERSION LIST :
2.45
* ATXMega128A1 JTAG OCD AVRStudio4 full support.

2.44
* Fixed bug - button write flash for ATXMega128A1 JTAG did not write flash.... * Flash Bootloader section upload/download for ATXMega128A1/AVRStudio implemented

2.43
* ATXMEGA128A1 support ( No OCD)

2.42
* GDB debuger support
* ATMega8515 SPI suppot
* Few read eeprom memory bugs solved in OCD mode

2.41
* New menu item - emulated COM port number (COM1..COM4)
* ATMega644,ATMega644P suppot

2.40
* OOCDLINK hardware compatibility . HappyJTAG2 now support this hardware in SPI as well as JTAG mode. Pins Cbus1 and Cbus2 are set to low pernamently and reset signal is avalaible on Cbus0 and cbus2 pins paralely.

2.39
*Changed default firmware version number to 06.07 ( AVRStudio4 SP3 )

2.37
* FT2232H High speed device ( USB2.0 ) support has been added
* Alowed to change and select FT2232x device when more than one is connected and detected
* Improved breakpoints support ( location in bootsector is supported now )

2.36
* AT90CAN128 has been added

2.35
* Firmware version signature changed to 0x60B, to be compatibile with AVRStudio 4.18 SP1

2.34
* AT90USB1286 has been added, not tested yet.

2.33
* ATMega16 is supported
* GDB debuger FLASH programming support
* New window with list of supported models

2.32
* ATMega168 is supported and tested with SPI interface - removed bug for SPI flash ATMega168 programming (incorrect page size setup for ATMega168....)

2.31
* Direct COM port connection with AVRStudio, without external virtual serial port emulator. Currently there is COM4 port emulated by the HappyJTAG2 software.
* ATMega2561 JTAG support has been added

2.30
* SPI interface interface - improved performance

2.29
* ATMega2561 Target full support for SPI interface
* EFuse SPI support
* bug for SPI interface - bad flash programming for same programm addressing combination - fixed

2.28
* Increased performance - internal USB data communication is more effective now, the system responses are litlebit quicker.
* Added checkbox for fixed TARGET interface speed (when checked, software ignores AVRStudio interface speed command/setup and always use manually selected speed)
* Fixed bug - error during closing JtagICE MKII dialog window closing from AVRStudio.
* Default value for emulated firware version is changed to 052C ( AVRStudio 4.16 requires) - its changed just for new instalations, once you have installed previouse version, you have to change it manually via menu

2.27
*Added option for inverting RESET signal (to be compatibile with some third party JTAGKey hardware)

2.26
* Fixed bug for incorrect stepping from high level language if there was RJMP instruction in code fragment

2.25
*New AVR8 models are supported now - SPI interface
- ATtiny13

2.24
* Fuses
- fuse names are set/renamed according identified target
*New AVR8 models are supported now - SPI interface
- ATMega48
- ATMega88
- ATMega168

2.23
* Added checkboxes for Extended fuses
- show their actual statuses
- allow you to set / reset them

2.22
* Fixed bug for HexaFile Download (segments higher than 64kB) - added ExtendedSegmentAddress HexaFile instruction support


2.21
*AVR signature reading bug fixed (Reading from AVR studio)


2.20
* Removed restriction for clock fuse - now its possible to set up also external crystal by the seting fuses.


2.19
* Support for EFuse programming

2.18
* SPI interface has been added ! (ATMega32 for now...)
- FLASH reading
- FLASH programming
- FLASH/CHIP erase
- FUSES manipulation
- AVR Signature reading
- SPI speed seting

* Fixed bug - there was reported minority bug with windows registry reading , occured in some instalations


2.17
* Fixed bug for chaange emulated firmware version
* Set this version as default 0525, which is required by AVRStudio v 4.14

2.16
* ATMega128 OnChipDebug support added
* StepInto -fixed bug for long code fragment for one high level instruction

2.15
* OnChipDebug mode - removed code size restriction/limitation for Freeware version ! Freeware version is now able to debug full Flash 32kB code of ATMega32 chip.
* Set emulated firmware version in case of further atmelīs JtagICEmkII firmware upgrade (Set is manual from main menu and specialized dialog window)

2.14
* OnChipDebug support added/enhanced
- HighLevelSourceCode STEP INTO ! implemented
- HighLevelSourceCode STEP OVER ! implemented
- HighLevelSourceCode AUTO STEP ! implemented

2.13
* OnChipDebug support added/enhanced
- RunToCursor function support added
- Default program entry point set to 0 (Fix for assembler source code)

2.12
* Minority fix, prepared for FlashPageProgramming for more than 64kB....

2.11
* OnChipDebug support added/enhanced
- EEPROM edit / write support from AVRStudio memory window

2.10
* OnChipDebug support added/enhanced
- Single step - assembler level
- Two single braek support
- Program entry point setup after reset
- Read/Write Target SRAM --> you can watch vars at source level
- Read FLASH --> target disassembler window
- Read EEPROM
- Peripherial / IO registers Read/Write full support
- JTAG Speed set/selection
* Still ATMega32 supported, no check for the other typpes, not tested for the otrers, maybe it run....
* Freeware version is limited !
- for 8kB of main code starts at 0 (with one exception : boot loader segment from $3800 to $3FFF is supported too by freeware version)
- only one simple breakpoint support (others are ignored)
- only one break afther reset (others are ignored)
- LOCKFuses - you cannot change LOCK FUSES
- There is integrated prohibition for Fuse JTAGEN, you cannot clear this fuse, so you cannot STOP/DISABLE JTAG interface with this freeware


2.01
* First released version for FT2232 driver
- Full fuses manipulation (limited in freeware version)
- Full intel hex to target program unpload
- Reset control from PC
- AVRStudio program/data upload
- Full chip erase support
- No breakpoint upport
- No single step support
- No Flash/SRAM view/edit support
- OnlyATMega32 support
- No target EEprom support
- Boundary scan function
- Fixed JTAG speed
- support for Run/Stop functions from AVRStudio
.
Generated: Fri Dec 6 08:00:28 2024