Reset DWEN fuse on Moteino with Dragon?

Started by hlawka, July 26, 2015, 05:45:22 PM

hlawka

In Studio 6 "Disable debugWIRE and Close" is grayed out;
under "Device Programming", "Unable to enter programming mode." (ISP or DW)

How can Moteino be made accessible again with Dragon or otherwise (e.g. USBASP)?

Thanks.

Felix

Maybe a question for who made that software/plugin?
I only know my way around AVR Studio.

hlawka

Sorry - this is AtmelStudio 6....

Can Moteinos be wired for HVPP?

Thanks.

Felix


hlawka

HVPP is a programming mode supported in AtmelStudio 6 for ATmega328p devices. (Stands for "High Voltage Parallel Programming".)

Thanks.

Felix

What are the pins on the atmega328 which are required for HVPP? And which would have the 12v high voltage on them?

EloyP

Quote from: Felix on July 29, 2015, 03:02:06 PM
What are the pins on the atmega328 which are required for HVPP? And which would have the 12v high voltage on them?

http://mightyohm.com/blog/wp-content/uploads/2008/09/hvfuse_fixed.png (from http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/).

Must be documented in the data sheet somewhere.

Because you broke out every single pin on the ATmega I think it should be possible to program the Moteino using HVPP, provided things are wired properly between the Moteino and the programmer. However, I don't know why someone would go that route if serial programming via the FTDI port is so easy, but to each its own.

Cheers,

Eloy Paris.-

EloyP

Quote from: Felix on July 29, 2015, 03:02:06 PM
What are the pins on the atmega328 which are required for HVPP? And which would have the 12v high voltage on them?

BTW, the pin with the 12 volts is RESET.

jra

The main (and probably only) reason you would use HVPP/HVSP these days would be if you so badly borked the fuses that you could no longer communicate with the chip via serial or ISP.  I managed to do that frequently enough when I first started building breadboard arduinos that I picked up an STK500 specifically for that purpose.

Felix

I used to brick Moteinos during programming with ISP in the early beginnings of Moteino development. Several causes can lead to that.
I bought a HV shield from mightyohm.com trying to salvage the bricked AVRs but it was really not worth the hassle. Doing it right the first time avoids all that.
I still use a AvR ISP MKii programmer to flash all Moteinos, it just works.

hlawka

The fuse that was changed was "DWEN", but that's enough to render ISP and serial communication inoperative; AtmelStudio 6 only offers "HVPP" at that point. TQFP parts can definitely be restored with Dragon, but apparently only if they're desoldered. Does anyone know if that's correct?

Thanks.

Felix

I think the answer is YES it needs desoldering because a HV programmer probably accesses pins like the XTAL1 which are not broken out on Moteinos or any other Arduino type board.
I have this HV Rescue Shield from MightyOhm.com which I used on a few occasions and it worked on about 3/4 cases (not sure if some atmegas were bricked beyond rescue or the shield didn't handle them all properly).

See this schematic of this shield:
http://mightyohm.com/files/hvrescue21/HVRescue_Shield_r21_schematic.png

hlawka

I regained control of this RFM69 Moteino with Dragon and debugWIRE, without resorting to HVPP. However Arduino IDE and codebender no longer recognize it (via USB and FTDI). Are there specific default fuse values codebender and Arduino IDE require in order to recognize Moteino?

Thanks.

Felix

First you'll need to make sure the bootloader is reinstalled and the fuses set correctly for it to run as designed. This is how you'd set them with avrdude:

-U lfuse:w:0xde:m -U hfuse:w:0xdc:m -U efuse:w:0xfd:m

hlawka

I wired up a borked Moteino to the Dragon's HVPP signals, with the crucial exception of HVPP pin 17; needless to say this didn't work. Although there're probably ways to apply 12V to RESET while addressing the fuse bits, it's more trouble than it's worth.

Otherwise I've had good success with FuseFix v. 1.1, and with Dragon; less success with MightyOhm's HV Rescue Shield 2.1, which for some reason won't write the flash, although it does reprogram the fuses.

Thanks.