Search code examples
avratmega

Error while trying to debug ATmega88 with AVR Dragon


I'm trying to debug an ATmega88 using an AVR Dragon and AVR Studio 6. The program is written in C++. Every time that I'm trying debug the program a messagebox appears saying

"Start Debugging": "ISP on AVR Dragon (00A2000006C63) does not support debugging. Device is only programmed. Use Start Without Debugging to avoid this message."`

I think the Dragon supports debugging over ISP because I could debug programs written in assembler in AVR Studio 4. The program is:

#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
    DDRC = 0xFF;
    PORTC = (0 << PC4);
    while(1)
    {
        PORTC = (1 << PC4);
        _delay_ms(1000);
        PORTC = (0 << PC4);
        _delay_ms(1000);
    }

    return 0;
}

But this shouldn't be the problem. The program itself works out.


Solution

  • To debug with the Dragon and AVR Studio 6, you'll need a circuit that supports debugWIRE. A naked ATmega will do or a modified (with autoreset cut/disabled) Arduino also works.

    Then, in the settings for your project (not solution) you need to change Tool - Selected debugger to AVR Dragon and Tool - Interface to debugWIRE. The latter was the one that took me some time to find and as long as that one is set to ISP you'll never be able to debug.

    Once these changes has been made, you'll get the question to enable debugWIRE (press yes) when trying to start debug a session and after that you'll need to power cycle the circuit and press OK.

    While in debugWIRE mode you can't change any settings on it as ISP is disabled. To exit debugWIRE mode you need to be in debug mode (so just start it again if you stopped it) and then select Debug - Disable debugWIRE and close, and it'll revert back to ISP mode.