Need help with ATmega 328PB Xplained Mini

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

Dear Community, I need some help

 

I have a brand new ATmega 328PB Xplained Mini and I connected it to the PC via USB and started Atmel Studio7.

I launched an existig smal project and did a built

 

Under Tools I selected mEDBG and as interface ISP

 

In the programmer I selected mEDBG, Device: 328PB Interface: ISP

 

When I try to read the Device signature I get this Error:

 

 

 

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 also have a Atmel ICE but nopt connected

 

Can anybody help?

 

thanks

 

Juergen

This topic has a solution.
Last Edited: Wed. Mar 18, 2020 - 08:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it in debugWIRE mode?

 

Can you start a debug session ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello awneil sorry for the late answer.

 

When I set TOOL to: mEDBG and Interface: debugWIRE I can enter DEBUG and debuging seems to work.

 

When I want to program the device I go to Device programming:

Tool:mEDBK, Device:ATmage328PB, Interface:ISP

 

I go to memories and press Apply, I receive Error: Erasing device failed

 

When I try to read the Device signature I get:

 

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.

 

 

thanks for your help

 

regards

 

juergen

 

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


To program the device using ISP, you need to change the chip from debugWIRE mode to ISP mode:

 

  1. Start a debug session (in debugWIRE mode)
  2. In the debug session, choose Debug > Disable debugWIRE and Close
  3. Power Cycle The Board!
  4. You are now is ISP mode.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hello awneil

 

I followed your instuctions and it works.

 

When I want to switch back to debugging I get "Launch Failed" with the message ........ Do you want to use SPI to enable DWEN fuse?

 

After I press YES I am able to continue debugging.

 

Thank you for your help

 

regards

 

Juergen

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

You're welcome.  I feel your pain - having just been through the same.

 

I would've linked the old thread from here which gave me the solution - but couldn't find it.

 

This debugWIRE lark really is a pain, especially with the mEDBG - where the download is so painfully slow!

 

angry

 

But it's waaay better on a real Atmel-ICE.

 

Now please see Tip #5 in my signature (below; may not be visible on mobile)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
This debugWIRE lark really is a pain, 
Whichis the very reason I'd only ever choose "JTAG" chips as JTAG "just works" and you don;t have all the switching back/forth, getting "stuck" malarkey!

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

Yes - you said that in the thread I was looking for!

 

But the chip choice was not mine - so I'm stuck with it

 

frown

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I also have a Atmel-ICE, can I use it instead?

 

I did connect the Atmel ICE together with the USB connection, but I had also trouble with it.

 

Do I have to disconnect the USB connection to the PC when I use the Atmel-ICE and use a seperate power source?

 

Look forward to your advice.

 

regards

 

juergen

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's really a separate question.

 

Would be better to mark this thread as resolved (Tip #5), and start a new thread with the new question.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you, I will start a new threat

 

regards

 

juergen

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

JB57 wrote:
start a new threat

 

surprise

 

(I think you mean threadwink )

 

Don't forget to give a link here so people can find it ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Mar 18, 2020 - 08:38 AM