Failed to enter programming mode

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

Hello,

 

I am using Arduino UNO and Atmel Studio 7 to program the uC Atmeg328p. At first, everything worked fine and didn't have any problems. I was able to burn the code in Arduino UNO and make it work the way I wanted. Then my my problems started (not sure if it was a coincidence) after I tried to debug my code. Now when I get this error message:

Failed to enter programming mode. ispenterprogmode: error status received: got 0xc0, expected 0x00 (command has failed to execute on the tool)

Unable to enter programming mode. Verify device selection, interface settings, target power, security bit, and connections to the target device.

 

I have attached an image of the error that I am getting.

 

The device signature is not recognized and I tried to implement all the sort of suggestions that I found on internet, but without any success. For instance, I tried to change the configuration of the fuses (now everything is set to 0x00), but when I try to program the new changes, I still get the same error message. 

 

I have to say that I am quite new to uC, so I am pretty sure I am missing out something here, but I don't know what.

 

I would appreciate any suggestion/help.

 

Thank you.

 

Attachment(s): 

Last Edited: Tue. Nov 7, 2017 - 06:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

presacca wrote:
after I tried to debug my code.

 

Were you using a debugger? 

Were you in debugwire mode?  Did you "disable Debug-wire mode and exit" when you were done debugging?

If not, re-enter debug mode and exit properly.

Then it should work again.  (debug-wire mode disables isp programming as long as it is enabled)

 

Jim

 

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

Thank you Jim for your message.

 

The problem is that when I try to debug, I get a similar error message saying "Failed to enable DW:..." (see the attached figure.) 

 

Under the "Debug" menu, the option "Disable debugWIRE and Close" is disabled.

 

Any other idea of what I could have done wrong to cause this chain of problems? I hope I didn't damage the uC.

Attachment(s): 

Last Edited: Tue. Nov 7, 2017 - 08:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

after I tried to debug my code

With what? The Studio screenshot doesn't show using a debugger like an Atmel Ice or other.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Apologies. you are right. I am using Atmel-ICE. See the attached figure.

Attachment(s): 

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

Target has power correct?  Atmel-ICE does not provide power to target device.

 

Jim

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

Yes, correct. It does have power

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

Set interface to ISP and set speed to 125k or less, if fuse was changed to use internal (8 or 1 MHz) that may get it to start talking.

If that does not work use another arduino to inject a 1 MHz clock into the xtal1 pin and try again.

 

Jim

 

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

The clock speed has always been 125k and I tried to lower the speed, but unfortunately that didn't help.

 

I then used Arduino Due (different uC: ATmega16U2. Not sure if this piece of info is relevant to fix the problem) and Atmel works fine and I am allowed to enter the programming mode. But when I plug back Arduino Uno, I have the same issue. 

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

IIRC, there is a jumper on the bottom that has to be cut before ISP works on the uno (it disconnects the cap to the reset pin used by the bootloader).

 

Jim

 

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

Unfortunately, that doesn't help. And I am still very confused on the reason that everything worked fine until I attempted to use the debugWire mode

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

presacca wrote:
Under the "Debug" menu, the option "Disable debugWIRE and Close" is disabled.

 

You have to start debugging then this menu will enable!

 

Jim

 

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

I would do it, if I could. Atmel fails to enable the DW. I tried multiple times, without any success.