wholder / DebugWireDebuggerProgrammer

An Arduino Sketch that can control and debug other AVR MCU's using the debugWire Protocol
46 stars 12 forks source link

Unable to change DWEN fuse #5

Open shashfrankenstien opened 2 years ago

shashfrankenstien commented 2 years ago

Hi @wholder,

I've been trying out your debugger setup as you've described in debugwire2. I've been testing this with an Arduino Uno as ISP and an ATtiny85 as target.

My first few tests went great! I was able to set DWEN fuse, step through code, exit and disable DWEN fuse.

I wanted to write some python code to interface with the debugger over the serial interface and automate checking register states at breakpoints. However, while trying to get this working, I must have done something wrong. I lost the ability to change the DWEN fuse.

I thought I bricked the chip. So I broke open a fresh one and started over. But now, though I can load the program and set DWEN fuse, I can't disable it.

I've check and rechecked my connections, everything looks right. Is there a possibility the Arduino GPIO pins are misbehaving? I am hoping you've come across something like this. If so, please do let me know!

My current solution is to build a 'High Voltage programmer' as described in this article to try and rescue the chips.

Commands:
 F - Identify Device & Print Fuses
 + - Enable debugWire DWEN Fuse
 - - Disable debugWire DWEN Fuse
 8 - Enable CKDIV8 (divide clock by 8)
 1 - Disable CKDIV8
 B - Engage Debugger

F

Timeout: Chip may have DWEN bit enabled

B

Cycling Vcc
Speed:  121212 bps
Sending BREAK: Ok
debugWire Enabled
SIG:    93 0B = Tiny85
Flash:  8192 bytes
SRAM:   512 bytes
SRBase: 0x0060
EEPROM: 512 bytes

L0000

0000:   C01F  rjmp  0040
0002:   9518  reti
0004:   9518  reti
0006:   9518  reti
0008:   9518  reti
000A:   9518  reti
000C:   9518  reti
000E:   9518  reti
0010:   9518  reti
0012:   9518  reti
0014:   C004  rjmp  001E
0016:   C112  rjmp  023C
0018:   9518  reti
001A:   9518  reti
001C:   9518  reti
001E:   D039  rcall 0092

EXIT

EXIT:   debugWire temporarily Disabled

-

Timeout: Chip may have DWEN bit enabled
Unable to change DWEN fuse
deltakid0 commented 2 years ago

@shashfrankenstien In the fear of bricking one of those, I found a video a couple of months ago that shows how to unbrick it using a TL8666ii Plus https://www.youtube.com/watch?v=oY_f5JrJ6y8

Here in Colombia it's around $100 USD which is very expensive compared to the $2's ATTiny85.

I would really appreciate it to hear about you back using this programmer and knowing whether you were able to unbrick it.