Reputation: 4453
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.
Upvotes: 0
Views: 2766
Reputation: 76
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.
Upvotes: 2
Reputation: 21
You can debug using the Dragon using debugWIRE. This uses the power, ground, and reset line. Usually ISP and debugWIRE physical connections are both made, because they are on the same connector. You have to tell the software to quit using ISP and start using debugWIRE, though. It is not smart enough to do that itself.
Upvotes: 2
Reputation: 2802
You may debug the program in AVR Studio's simulator, but debugging the hardware with ISP has never been possible. If you want to debug your application using AVR Dragon you have to use JTAG.
Also, your program is written in C, not C++, and will not work as expected. To set the bit in PORTC
you are doing it right, but to clear it you have to do
PORTC &= ~(1 << PC4); // Clear PC4, keep all the others
which will do a logic and
operation with PORTC
and 11110111
EDIT: Actually, you should also set with
PORTC |= (1 << PC4); // Set PC4, keep all the others
or else you will just overwrite the whole port
Upvotes: 1