Bootloader deleted after programmed with atmel ice?

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

Hello. I was using an atmega328p-pu as normal for years, using this configuration, with an ftdi basic (i made my own arduino board):

 

Today, i tried and managed to program the  atmega328p-pu using atmel ice, on DebugWire mode (using pins Miso,Mosi,SCK,RST), on a new 'naked' board i made, because it would not let me program it on the configuration above. The new board:

free image hosting site

 

 

I programmed the chip correctly, but now i cannot use in on my old configuration. When i connect the mcu on my old configuration, the Tx/Rx does not reset every time i open the serial monitor (using arduino ide, or teraTerm) and i cannot reset the mcu by connecting the RST to the GND.

 

It is that the bootloader got deleted when i programed the board with the Atmel ICE?

I want to burn the bootloader again, but when i go to tools>Device programming, and try to read the device signature, i get the classic error: 

web img

 

 

Which, the only way i know i can solve, is using a jtag connection, to the stk600 , and follow this tutorial:  https://www.youtube.com/watch?v=UuHpA8OjblE . So i will need to remove the smd-type atmega from the stk600, rewire all the connections from the stk600 to my atmega328p-pu and follow the tutorial?

 

I do not have a AVRISP mkll. And i do not have a second atmega with bootloader on it to burn a bootloader on the chip for now, guess i will have to order some of those. Is there any way i can burn the bootloader using ATmel Ice only? I have not seen any tutorial to help me program the atmega with the Atmel ice only.

 

THanks.

Last Edited: Mon. Oct 21, 2019 - 12:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yes, any programmer will first do a full chip erase and then load what ever you gave it to load.

But you can use that same programmer to re program the boot loader, so the chip is not a dead one.

With a virgin chip btw there is no bootloader at all present ( unless you bought a chip with the bootloader programmed by someone else.)

Also check the fuses if they are set correctly.

 

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

I was thinking about the fuses, yes. I dont know how to use the fuses at all. I will check those, to see how they could affect my mcu

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


I see several problems with your circuit:

First you have no bypass caps, these are 100nf (0.1uf) caps, they need to be connected as close to the pins as possible, both VCC/GND pins 7and 8, as well as AVCC/GND pins 20 and 22!

C2 and C3 are WAY to big, these two need to be 18pf caps.

 

Yes when you use an ISP programmer, it will erase all of memory including the bootloader, when it writes the new program to flash.

You need to decide, are you going to use ISP programming or bootloader serial programming, use one or the other, do not mix!

There is a tutorial in the tutorial section of this site that will tell you how to recover from programming errors, look for how to recover a bricked AVR! But you need to fix your hardware first!!!

 

Arduino nano's are cheap and easy to use, you should have one so you can at least use it to recover your AVR when you brick it!

 

Jim

 

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

Thanks mate. Yes, you are right about the caps on the crystal there, the truth is i have used 22pF, but i forgot to change the schematic...

I will try what you said, i think you soldev my problem.

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

meslomp wrote:
 any programmer will (sic) first do a full chip erase

It doesn't have to - but that is often the default behaviour.

 

Atmel Studio with Atmel-ICE, EDBG, etc has the option to only erase necessary pages ...

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:
Atmel Studio with Atmel-ICE, EDBG, etc has the option to only erase necessary pages ...
Only in Xmega. A 328P does not have the facility.