Society of Robots - Robot Forum

Software => Software => Topic started by: vidam on June 13, 2008, 11:20:05 AM

Title: enabling and using debugWire with AVRISP and JTAGmkII
Post by: vidam on June 13, 2008, 11:20:05 AM
hello,

I bought a $35.00 AVRISPmkII programmer cable to enable the DWEN fuse for debugWire. Knowing that I cannot use the AVRISPmkII cable for debugging I then switched over to the JTAGmkII.

Then I tried connecting up my JTAGmkII for debugWIRE mode (3 pins) and I kept getting an error that the CKDIV oscillator must be 1/4 of the system clock error.

I then tried to reconnect my AVRISPmkII cable to disable the DWEN fuse but I received the same error.

I'm using the ATmega 168. And AVR Studio 4.00 version.

I tried switching back to JTAGmkII debugWire making sure I restart AVR Studio in the process but still get that error trying to read the board.

What should I try next?
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: bens on June 16, 2008, 11:51:56 PM
If you enabled debugWire, you can now only talk to your mega168 using debugWire.  debugWire interfaces with the mega168 using only its reset line.  It uses very high frequency signals, so in order for it to function the reset line must be free of capacitance and any pull-up on the line must be 10k or greater.

- Ben
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: brijesh on June 20, 2008, 12:19:04 PM
To disable debugwire follow these steps.

1) Load a project and start simulation. You don't have to start executing the code or step, but just put the device and JTAGICE MKII into simulation mode.
2) Choose the "Debug" from menu, from the drop down list choose "JTAGICE mkII options". A window pops up where you have the option of disabling Debugwire.

Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: vidam on June 30, 2008, 12:10:26 PM
I'm having trouble with debugWire after I set the DWEN fuse in ISP mode. I am unable to connect to the target device using the JTAG mkii. And I am even unable to disable DWEN fuse once it is set.

Here is the error I get.


Failed to ensure correct emulator mode. debugWIRE was not disabled. Unable to find supply voltage on target. Please verify that the JTAGICE mkII probe is correctly attached to the target, and that the target power has been switched on.

Comments suggestions? Anyone have this happen to them too?
I probe is correctly attached to the target, and that the target power has been switched on.
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: bens on June 30, 2008, 12:22:54 PM
Are you sure you are using your mkII in the right mode?  The fact that it seems upset that debugWIRE was not disabled makes me think it's not trying to run in debugWIRE mode.  Also, are you sure you have the right connection?  Is your reset line free of capacitance?  Is the pull-up resistor on your reset line 10k or greater?

- Ben
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: vidam on June 30, 2008, 12:31:03 PM
The resistance on the reset line is infinite and there is no capacitance.

Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: bens on June 30, 2008, 12:35:50 PM
By infinite you mean you don't have a pull-up on that line?
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: vidam on June 30, 2008, 12:44:43 PM
I don't have a pull-up resistance. It has an internal pullup on the atmega 168. So the idea is not to put anything in parallel with it.
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: bens on June 30, 2008, 01:46:37 PM
That's good to know.  I've always used an external pull-up on the reset line, but I just looked at the datasheet and it does indeed say there is an internal pull-up there.  So then the only thing you have connected to your reset line is your mkII?  i.e. if you were to disconnect your mkII the reset line would be externally floating?

If that's the case I can only suggest that the issue is either with the way you're connecting your mkII or with the way you're configuring the operation mode of your mkII in AVR Studio.

- Ben
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: vidam on June 30, 2008, 08:08:16 PM
The RESET pin is burned up when setting the DWEN fuse. This is  because the designer put a 4.7k resistor in parallel with the internal resistor on the RESET line. I don't understand why the pin burned up but it happened repeatably on different Atmega168 chips.

Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: bens on June 30, 2008, 08:16:03 PM
I'm not sure what you mean when you say "burned up", and I'm not sure why this would happen when setting the DWEN fuse.
Title: Re: enabling and using debugWire with AVRISP and JTAGmkII
Post by: vidam on July 01, 2008, 10:45:27 AM
What I meant to say is a 4.7 kOhm resistor that is connected to MISO causes the output to read low when debugging. So you can't read a signature or anything. IT didn't burn up the ballpin on the ATmega168 chip. My mistake....