Which hardware debugger works with Arduino boards?

Although Arduino IDE does not support debugging using a hardware debugger, I am considering using Atmel Studio 6 on Arduino boards.

I am using Atmega328 and hunting for the most cost-effective debugger. I am confused by the choices available. There are Dragon, JTAGICE2(most expensive), AVR One, JTAGICE3.

I need to debug through the 6-pin ISP header.

Has anyone used a debugger that actually works with Atmega328? Could you share which works?

I am looking at the Dragon because it is cheap. But I am not sure if it works with ISP. The programming interface supports ISP but the debug interface does not say it supports ISP. Debug interface supports JTAG and Debugwire.

Thank you.

328 only has the debugWire option, and to get that you have to disable the RESET pin.

I've never used dW but you'll have to check if the above gadgets support that.

Normally once you disable RESET you need a high-voltage programmer to program the chip, I'm not sure if you can program via dW, if not you'll also need a HV programmer.

Or you could get a board with the Mega1284, that has JTAG.


Rob

Graynomad: 328 only has the debugWire option, and to get that you have to disable the RESET pin.

I've never used dW but you'll have to check if the above gadgets support that.

Normally once you disable RESET you need a high-voltage programmer to program the chip, I'm not sure if you can program via dW, if not you'll also need a HV programmer.

Or you could get a board with the Mega1284, that has JTAG.


Rob

Is it a requirement to disable RESET whenever debugWire option is used? This is not friendly. Can high-voltage programming be done via ISP? I am using 6-pin ISP

Is it a requirement to disable RESET whenever debugWire option is used?

Yes.

Can high-voltage programming be done via ISP?

No.

You can HV program with an STK500 dev board, not sure about the above devices though.

You should check out the data sheet, it explains most of this.

What sort of debugging do you need? I had a monitor program working that used SPI to report to a second Arduino, that worked OK. Also have a look at Nick Gammon's site

http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

He had a tute on debugging with the SPI port but I can't find it now.

And as I said, maybe use a 1284-based board that has a JTAG header.


Rob

I use debugWire on Attinys 84, 85s, atmega328p's using the AVR Dragon and AVR Studio with great success.

You do not have to worry about anything, AVR Studio takes care of it for you. In AVR Studio, when you change the Dragon setting from ISP mode to debugWire mode, then start a debug session it will tell you that it needs to set the appropriate fuse and gives you a message box with the following info: disconnect target from the dragon, toggle target power, then reconnect target to dragon.

Works great, with only two main problems in my experience: 1. Make sure you end the debug session in the debug menu in AVR Studio (it will properly set the fuses back to normal) and not to do it manually. 2. The target board (attiny, atmega, etc) needs to be powered separately to work properly (because you have to toggle target power and leave dragon powered the first time you enter debugWire mode). You can run the target off the dragons limited power output, but the only times I have ever had problems is when I powered the target from the dragon.

However, you can not have a capacitive load on the reset line or lower than 10k pullup on it (maybe off a little on that last part).

Dave

I just upgraded from Atmel Studio 6.2 to Atmel Studio 7 and then tried to set it up for the Arduino. I have figured out how to create a project from an Arduino .ino file but I can't seem to download the compiled project to the Arduino board. Has anyone successfully transitioned to Atmel Studio 7 for Arduino?

Is it a requirement to disable RESET whenever debugWire option is used?

It's not the AVR RESET that you need to disable to be able to use debugwire. It's the Arduino auto-reset circuitry connected to the reset pin.

An Arduno MEGA or one of the 1284 boards can be debugged with JTAG.

There are Dragon, JTAGICE2(most expensive), AVR One, JTAGICE3.

Most of those are considered obsolete these days. The recommended debugger is the "Atmel ICE" Unlike the older debuggers, this will do both ARM and AVR debugging.

For m328 debugging, you might think about getting an "Atmel Xplained Mini 328p" eval board. That's very cheap, and is essentially an arduino with a built-in debugger. You can put Optiboot on the 328p (or not, if you're going to be using AS anyway.)