go_away

Author Topic: enabling and using debugWire with AVRISP and JTAGmkII  (Read 7302 times)

0 Members and 1 Guest are viewing this topic.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
enabling and using debugWire with AVRISP and JTAGmkII
« 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?

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #1 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

Offline brijesh

  • Full Member
  • ***
  • Posts: 55
  • Helpful? 0
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #2 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.


Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #3 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.
« Last Edit: June 30, 2008, 12:15:50 PM by vidam »

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #4 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

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #5 on: June 30, 2008, 12:31:03 PM »
The resistance on the reset line is infinite and there is no capacitance.


Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #6 on: June 30, 2008, 12:35:50 PM »
By infinite you mean you don't have a pull-up on that line?

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #7 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.

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #8 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

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #9 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.


Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #10 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.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: enabling and using debugWire with AVRISP and JTAGmkII
« Reply #11 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....

 


Get Your Ad Here