Debugwire stopped to work - aparently solved

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used my JTAGICE MKII for approx. 2 years now with larger AVR's, and now I have made a PCB with a tiny45.

First I connected the ISP with my STK500 and enabled the DWEN fuse.

Then I connected the JTAG Debugwire and started some debug sessions. It worked as expected.

Then I wanted to theck the system clock frequency and made a program loop toggling a port pin.

It was running only 8 MHz, so I had to reprogram the fuses to make it run 16MHz.

I pressed the button in debug mode to disable the DWEN
fuse. But the ISP from STK500 did not work.

I also thied high voltage programming. It did not work, I read a signature of FF FF FF.

I could no longer debug either.

To avoid waisting more time I desoldered the SMD chip and mounted a new one.

I used ISP to set the fuses and program my test program.

Now the timing was correct, so I enabled the DWEN fuse.

But the debugwire does not work, I get a dialogbox when trying to start a debug session saying:

"Unable to connect to device. This could be caused by reset line circuitry or disabled debugWIRE interface. Make sure the reset line is free before continuing."

When attempting to start the debug session, the reset line toggles.

I tested that the normal JTAG connects and works fine with a Mega128.

I use Studio 4.12 SP4 build 498.

Any Ideas ?

Erik

Last Edited: Wed. Nov 15, 2006 - 03:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem is apparently solved now, se my post in AVR forum:

"debugWire and ATmega48/88/168 - submit your experience"

It also contains some suggestions to the Atmel team.

Erik

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the similar problem, but without STK500 (doesn't matter). After programming DWEN debugiing through DebugWire work properly, but impossible to diable DebugWire and activate SPI again. Target - ATtiny2313.
Please, Erik, could you explain it again on forum or sent to email(san_915@mail.ru). Have no ideas. Thank you beforehand.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe the timing is more critical for disabling the DWEN via debugwire than normal debug operation. I suggest you mount the 4K7 resistor between Vtarget and Reset on the JTAGICE MKii probe PCB, as described in the AVR forum thread. This works for me.

And for your chip not working: In this situation high voltage programming is the way to regain control over the chip, I don't know any other way when you get stuck in the middle of nowhere between debugwire and ISP. Read the documentation carefully in Studios tools help and get the wires correctly connected.

By the way I wrote and debugged my first own SMPS regulator program with softstart and overcurrent protection on the tiny45. I was lucky to succeeded in only 3 hours. Nothing compared to the debugwire trouble. :-)

Erik

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, I'll try it (4k7 resistor). Have found in other posts a solution with additional grounding wire between target board and PC. What do you think about?
Furthermore, I've asked the Atmel's tech support team about this issue.
BR, Alex.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Grounding is good, but don't make ground loops.

Erik

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unsuccessfully. Nothing helps.
After once programming DWEN fuse (enable DebugWire)there is impossible disable it again to be able to reprogram ATtiny via SPI. :evil: Will try disable DWEN with simplified self-made parallel programmer.
hope for the helpful dialog with Atmel's AVR-consultants. As I can see there, this is the general issue over the world. Isn't it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Will try disable DWEN with simplified self-made parallel programmer.
You must disable DW FROM WHITHIN a debug session. I'm assuming that you can go into DW mode in debug?? ISP is DISABLED when DW is enabled.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You not disable the DWEN from a debugging session, but that requires that debugwire works.

When it doesn't then I know no other solution than high voltage programming, as it overrides the disabled reset function.

My debugwire did not work properly, but well enough to enter debug mode. When I used the disable debug wire button from a debug session, my chip stopped working until I regained control with high voltage programming.

As I'm not the only only one with insufficient skills to solve this in minutes rather than hours, I hope the Atmel guys will consider my suggestions for improvements of Studio.

Quote:

The problem is apparently solved now, se my post in AVR forum:

"debugWire and ATmega48/88/168 - submit your experience"

It also contains some suggestions to the Atmel team.

Erik

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Quote:
Will try disable DWEN with simplified self-made parallel programmer.
You must disable DW FROM WHITHIN a debug session. I'm assuming that you can go into DW mode in debug?? ISP is DISABLED when DW is enabled.

Is it matter - how I can set DWEN=0 both via SPI programmer or via JTAGICE in the debug session?
I've done DWEN=0 via in-cirquit programmer, than had a successfully debug session with JTAGICE.
One more thing - from DS ATtiny13(p.166, errata)

"Device may lock for further programming
Special combinations of fuse bits will lock the device for further programming effectively
turning it into an OTP device. The following combinations of settings/fuse bits
will cause this effect:
– 128 kHz internal oscillator (CKSEL[1..0] = 11), shortest start-up time
(SUT[1..0] = 00), Debugwire enabled (DWEN = 0) or Reset disabled
RSTDISBL = 0.
– 9.6 MHz internal oscillator (CKSEL[1..0] = 10), shortest start-up time
(SUT[1..0] = 00), Debugwire enabled (DWEN = 0) or Reset disabled
RSTDISBL = 0.
– 4.8 MHz internal oscillator (CKSEL[1..0] = 01), shortest start-up time
(SUT[1..0] = 00), Debugwire enabled (DWEN = 0) or Reset disabled
RSTDISBL = 0.
Problem fix/ Workaround
Avoid the above fuse combinations. Selecting longer start-up time will eliminate the
problem.

Very similar behaviour. Maybe there are the generic bug for tiny-family? What do you think about.
If anybody had a successfull experience with DW ATtiny2313, please, describe it step-by-step.

BR, Alex.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
how I can set DWEN=0 both via SPI programmer or via JTAGICE in the debug session?
Start a debug session and if the DW is not enabled it will be done automatically provided that you have the normal ISP connection. When you finish debugging (ie your program is working 100%) go to tools and then JTAG ICE MK2 ?? options (I have only used the Dragon with DW, I presume that the JTAG has the same facility) and click on "disable debugwire".

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would be perfect, if all happen just so as you wrote. But clicking on "disable DebugWire" has no effect. Unfortunately. Mat be with DRAGON it will be otherwise, but I haven't any one.
Thanks, colleagues! If I have more news about, will write in this forum.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is an importent sequence you must follow if toggling between debugWire and JTAG (ISP).

To disable debugWire and enable JTAG:
- Connect debugWire (Reset) and ISP pins.
- For JTAGICE mkII: Start a new debug session and select open options.
- Click the disable DebuGWire button. It is at this moment JTAGICE mkII have some ground problem and for battery operated targets you might need to connect a ground to your target.
- Toggle power on your target!!!!!! Toggling power on the mkII should not be nessecary.

To enable debugwire:
- Connect debugWire (Reset) and ISP pins.
- Start a debug session. Studio will tell that it can't connect and ask if it should enable debugWire by use of SPI.-
- Click yes.

This works 100% of the time for me. And I have had a lot of problems before I found out all possible problems.

My favorites:
1. My oscilloscope, Yokogawa DLM2024.
2. My soldering iron, Weller WD2M, WMRP+WMRT.
3. JTAGICE3 debugger.