Go Down

Topic: [SOLVED] Bricked Arduino -- Cannot be Programmed (Read 343 times) previous topic - next topic

Totom3

Oct 07, 2018, 08:56 pm Last Edit: Oct 17, 2018, 03:54 am by Totom3
Hello,

I have received my Arduino yesterday and managed to brick it within 5 minutes of playing with it. Here's what happened:

  • Successfully uploaded code using the Arduino IDE;
  • Tried the same with Atmel Studio. It tells me DWEN fuse needs to be activated; I click ok & it reports that it successfully triggered it, and that I should now toggle the target device's power;
  • I disconnect and reconnect the power to the Arduino, unaware of the auto-reset feature. I then click on OK in Atmel Studio and get an error.
  • From there on, the Arduino is completely bricked. None of the Arduino IDE nor the Atmel Studio can program it, whether in ISP or in DW.


Details:
  • This is an Arduino UNO Rev3;
  • I am using an Atmel ICE as a programmer & debugger;
  • Serial communication seems to work, as determined by a loop-back test;
  • The reset button does NOT work: the LED 13 does not blink thrice when I press it;
  • Atmel Studio & ICE are capable of reading the device's voltage (5V) but not the signature and cannot initiate an ISP connection. The error received is the traditional "Got 0xc0 instead of 0x00...";
  • Atmel Studio is incapable of initiating a debugWIRE session. Every time, it suggests to enable DWEN through ISP, but then fails to do so;
  • I have tried to break the auto-reset soldering, to no avail;
  • When I connect the Atmel ICE to the Arduino, LED 13 flashes once;
  • Any attempt to upload code through the Arduino IDE will result in the dreadful "programmer out of sync" message;


I have done a TON of research and couldn't find anything. My only guess so far is that somehow the ISPEN or RSTDISBL fuses were unintentionally changed. I really have no idea how to proceed and would love to get some help on this. Thank you!

DrAzzy

#1
Oct 08, 2018, 01:58 am Last Edit: Oct 08, 2018, 01:59 am by DrAzzy
Oh, if you've got DWEN enabled, you can't program via ISP anymore (since the reset line is used for that) - and I think the cap for autoreset will prevent DW from working on arduino boards (per datasheet, all capacitors on the RESET/DW line must be removed). So what you've described sounds right.


Why not use a well-behaved, arduino friendly ISP programmer like a USBAsp, USBTinyISP, or another Arduino as ISP, and not mess with this DW stuff?  Based on what I see posted, there's essentially nobody using DW and Arduino. USBAsp and USBTinyISP can be had on ebay for about the cost of a cup of coffee.

That log almost looks like it's trying to use jtag, which is totally inappropriate.


DW is not supported by the Arduino IDE as the protocol is proprietary, only Atmel Studio can do that.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Totom3

Oh, if you've got DWEN enabled, you can't program via ISP anymore (since the reset line is used for that) - and I think the cap for autoreset will prevent DW from working on arduino boards (per datasheet, all capacitors on the RESET/DW line must be removed). So what you've described sounds right.


Why not use a well-behaved, arduino friendly ISP programmer like a USBAsp, USBTinyISP, or another Arduino as ISP, and not mess with this DW stuff?  Based on what I see posted, there's essentially nobody using DW and Arduino. USBAsp and USBTinyISP can be had on ebay for about the cost of a cup of coffee.

That log almost looks like it's trying to use jtag, which is totally inappropriate.


DW is not supported by the Arduino IDE as the protocol is proprietary, only Atmel Studio can do that.
Thank you for your response.

Let's assume that the DWEN fuse is set; why then is Atmel Studio still incapable of opening a debugWIRE session? If it is the Arduino board that is interfering, what if I pulled the MCU out of its socket and connected directly to it?

I don't want to use one of these "well-behaved" debuggers because that would require me to wait another good two weeks. I am used to developing on Atmel MCUs directly with ISP & debugWIRE through the Atmel ICE and don't really understand why this would not work when the MCU is simply wrapped in a board. And also I have had a great experience with debugWIRE so far.

I have bought two extra Arduino boards today and will soon try the Arduino-as-a-programmer solution. If that does not work I'll try what I mentioned above - pulling the MCU out. Worst case I'll just use one of the other boards...

 I will post an update once I have more information.

DrAzzy

It's the capacitor between the RESET pin and the DTR line of the serial adapter on the arduino board. This is used for uploads using the arduino bootloader - the DTR line goes low when the serial port opens, and this is capacitively coupled to the RESET line via a 0.1uF cap, which along with the pullup forms an RC - thus the transition from high to low on DTR is converted to a pulse on the reset line, which in turn resets the chip so the bootloader runs (and so the sketch restarts so you see the output from the beginning if using serial monitor).

if you pull it from the arduino board (be sure to give it decoupling caps!) you should be able to talk to it with DW.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Totom3

if you pull it from the arduino board (be sure to give it decoupling caps!) you should be able to talk to it with DW.
Wow, thank you so much! This makes so much more sense now.

One last thing: I have close to no experience in this domain and was wondering (1) what capacitors I should get; (2) if it would be possible to do this without any capacitors at all; and (3) how to connect properly to the MCU. If you know a source that explains this well, that works too!

Massive thanks again for your support!

DrAzzy

#5
Oct 16, 2018, 09:54 pm Last Edit: Oct 16, 2018, 09:54 pm by DrAzzy
You *must* have two 0.1uF ceramic decoupling caps for an atmega328p in DIP package (get a bunch - you will use more of them than any other single component if you start doing electronics stuff) - one goes between Vcc and Gnd, the other between AVcc and Gnd, and they must be located right next to the chip (there are some terrible arduino on breadboard tutorials that omit these components - but this can produce random resets, hangs, and failures to program (the behavior is unpredictable - sometimes it works, sometimes it doesn't, the kind of problem that is hellish to debug) - and others that show wires leading to the caps, located off to the side on the breadboard; this prevents them from doing their job).

You also need a 16MHz crystal and appropriate loading caps (typically 18~20pf ceramic), since the chip will be set up to use a crystal, and won't talk to the programmer without a clock source.

There are countless guides showing the connections online.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Totom3

You *must* have two 0.1uF ceramic decoupling caps for an atmega328p in DIP package (get a bunch - you will use more of them than any other single component if you start doing electronics stuff) - one goes between Vcc and Gnd, the other between AVcc and Gnd, and they must be located right next to the chip (there are some terrible arduino on breadboard tutorials that omit these components - but this can produce random resets, hangs, and failures to program (the behavior is unpredictable - sometimes it works, sometimes it doesn't, the kind of problem that is hellish to debug) - and others that show wires leading to the caps, located off to the side on the breadboard; this prevents them from doing their job).

You also need a 16MHz crystal and appropriate loading caps (typically 18~20pf ceramic), since the chip will be set up to use a crystal, and won't talk to the programmer without a clock source.

There are countless guides showing the connections online.
I see. Thanks for the help!

Go Up