Clearing DWEN fuse while in ultra slow clock mode

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

I have an ATtiny841, which I wanted to clock with the internal ultra low power oscillator @32kHz. I am using AtmelStudio 7 with AVR Dragon.

 

So I've set up the fuses properly for the clock source. With the new clock, I even had to lower the ISP Clock, so that it is below 32kHz/4, to verify the results. So it seems like the setting of the clock succeeded.

 

Then I wanted to load and debug my code, so I enabled debugWire as prompted by AS7. After power cycling the ATtiny, though, the debugger could not connect to the device. And ever since, I cannot access it neither with debugWire, nor with ISP.

 

My assumption is that debugWire got enabled (DWEN fuse is set), but it does not work with such a low clock speed. (I've found in the specs of the ATtiny841, that "clock frequencies below 100kHz may cause communication problems", of course only after I was already stuck.) As I cannot connect to the debugWire interface, I cannot disable it, and with enabled debugWire, I cannot use ISP either to clear the DWEN fuse.

 

So the question is simple: Is there anything I can do?

 

(PS: I've found and read through lot's of questions on disabling debugWire, but none of what I've found was related to slow clock speed.)
 

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

So the question is simple: Is there anything I can do?

HVSP is likely your only option.

 

Do you have an STK500, or another programmer capable of HVSP?

 

If not:

http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/

http://mightyohm.com/blog/products/hv-rescue-shield-2-x/

https://www.google.ca/search?q=hvsp+rescue

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

What is the tolerance on the internal 32KHz oscillator fro this chip? I know for the ARM processors it can be as low as 20KHz actually. It might be that you still have a to high programming frequency.

 

 

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

I am sure that there is an application when 32kHz is appropriate.
Most apps will use less power and be more responsive by using a fast clock for a short time and sleeping for a long time.
debugWIRE is clearly documented to be unsuitable for slow clocks.
Ask a neighbour with a STK500 to recover your chip. I would not even try with the Dragon because it is a lot more fiddly.
It is probably easier to just buy a new AVR.
David.

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

Unfortunately I don't have other tools than the Dragon, so I tried HVSP with that. Oh, and I don't have proper cables either, so I hacked together one. It didn't work, unfortunately, and not only with the one set to a slow clock, but with a new one either.

 

Dragon - ATtiny841 hookup

(JTAG header is provided with Vcc, that's why a cable is connected to that header as well.)

 

So I guess I'll just have to write off the unit with the misprogrammed fuses.

 

And I haven't yet though about having a higher clock frequency resulting in a lower power consumption, but definitely worth a check.

 

Thanks for the answers!

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

Your wiring is impressive. You should get a medal if it works.

A simpler solution is to apply an external clock to XTAL1 and let the Dragon disable debugWIRE in the usual way from AS7.
Since you are using an internal RC, your only hope is HVSP. (which is not too difficult)
It is HVPP that requires so many wires that I lose the will to live.

David.

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

Looks like you've got the t841 on a dev board?  If it has a resistor and/or a capacitor on /RESET, HVSP likely won't work.  Remove it/them, or cut a trace, or lift the reset pin, or...

 

I can't comment on the wiring in the photo, since I've never used a Dragon.  However, I count ten wires plus Vcc.  HVSP only requires 7.  What are you doing with the other 4?

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

joeymorin,

 

The remaining 3 wires are the Prog_enable[0..2] cables listed in Table 24-7. They are not on Figure 24-3, but are referred to in the Dragon manual. I tried without them as well with no result.

 

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

I am using this board: http://elecrab.com/archives/720, and yes, that has a 10kOhm resistor between Vcc and RESET. I haven't thought about that.

I am not too confident with my SMD soldering skills, but as this unit is useless in it's current state, I will try to remove the resistor, and try HVSP again.

 

Thanks!

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

10k shouldn't be a problem, it will only draw 1.2 mA from the 12V supply.  Mind you, I don't know what the Dragon can provide.  Normally, programming current is only about 250 uA.  If it can't provide the additional 1.2 mA, the 12V supply would see a voltage drop.  If the drop is too profound, HVSP won't work.

 

Anyone know what a Dragon can source on the 12V supply?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

I retried HVSP today. I bought some proper cables so that I won't have to worry about bad connections so much. Anyway, it did not work.

Then I removed the 10k pull up from the reset line, but that didn't help either.

Then I checked some levels with a scope - not a high level one, just a DSO Nano - and that give really strange results.

 

I could not observe any high voltage levels on the reset line, but checking the SCI/clock line, it gave a steady 115kHz square wave, between 17V and 23V. Now that seems completely off to me.

 

Does anyone have any idea?

 

Edit:

I've connected the Dragon to the ISP header of a correctly clocked attiny841, and checked if it still works. It does. But the strange square wave signal is there even in ISP mode on the HV_PROG connector pin #17.

Last Edited: Sun. Jan 17, 2016 - 08:41 AM