Bootloader to ATmega 328P

Hello all, I've searched the forum and google but not found an answer to my problem - perhaps I didn't word my search properly. I also read thru several pages of forum but didn't find my exact problem, so here goes.

I've got an Arduino Duemilanove and have used several ATmega168P-20PU chips in the board. Now, I'm trying to use a ATMEGA328P-PU chip without much success. I tried to burn the bootloader to chip by using Arduino 1.0.1 and a USBtinyISP programmer. I've used this programmer several times with avrdude-GUI and also with the command line version of avrdude and it works good.

The computer system is a XP Pro, SP3 on an i5-2500 CPU @ 3.30Ghz amd Ardiono 1.0.1 IDE program.

From Arduino 1.0.1 "burn bootloader" menu command (after selecting the Arduino Duemilanove w/ ATmega328 as board), it seems to work ok, says "Burning bootloader to I/O Board (this may take a minute)...

When complete burning complete, I get the following error code in bottom windown in red text: (error address is different at different attempts)

avrdude: verification error, first mismatch at byte 0x7880 (2nd time msg 0x7b00)
0x05 !=0x02 (2nd time msg 0x81 != 0x21)
avrdue: verification error; content mismatch

OK, I try using avrdude-GUI program to burn bootloader direct (This is how I normally burn bootloaders for ATmega168 chips). I use the ATmegaBOOT_168_atmega328.hex bootloader file located in the bootloader folder. After burning is complete (no errors from avrdude-GUI), I check fuses:
Lfuse = FF
Hfuse = DA
efuse = 05

I put chip in Arduino Duemilanove board and attempt to load sketch "blink" and get the following error msg: "avrdude: stk500_getsync90: not in sync: resp=0x00"

To confirm everything works as it should, I go thru the same process with an ATmega168P-20PU uC and everything works as it should, including uploading the "Blink" sketch.

Any ideas on the problem with the m328?

Thanks in advance for any guidance and help,

Ken H>

Try selecting Uno as the board type instead.

Thanks CrossRoads - why ain't I smart like you? I was focused on the Duemilanove board I have and didn't even think of the UNO board. The bootloader loaded using the USBtinyISP clone I've got, then the blink loaded just fine.

THANK YOU!! This group has always came thru for me in time of need.

Ken H>

Just passing it along - I've done the same myself, and I think it was Nick Gammon that got me fixed up.

Anyone else can look at this forum possibly?? I own a avrisp mkii programmer, and some uno boards. I'm trying to fire up the arduino IDE, and then plug in the avrisp programmer, but I don't really know what else to do. Things aren't doing anything. I'm short some of the steps that I'm supposed to follow. Any Help would be appreciated.

What are you trying to do?

Burn a bootloader? Board must be powered from USB, or from Barrel Jack/wallwart. Then:
Tools: Board: Arduino Uno
Tools: Programmer: AVRISP MKii
Tools: Burn Bootloader

Upload a sketch via USB port after bootloader is installed?
Make sure your sketch compiles. Then:
File: Upload
Sketch starts after a couple second delay while bootloader checks & fails to see that another sketch is being downloaded.

Burn a sketch without a bootloader? Board must be powered from USB, or from Barrel Jack/wallwart. Then:
Make sure bootloader is installed first, sets up the fuses for crystal stuff.
Make sure your sketch compiles. Then:
File: Upload Using Programmer.
Sketch will start immediately after a restart.

October 03, 2012

I have owned an avrisp mkii for quite some time. I'm trying to use an uno board, to which I will supply plus 5 Volts, and then, I will upload the bootloader into many multiple 328 (the many suffixes I have yet to really understand) mcu's. I fire up the arduino ide, and I supply the plus 5 and hook up the avrisp mkii to the uno, but then I guess I have to put some type of a sketch or whatever into the arduino text editor. I don't know what that sketch or text (or what ever it is) is supposed to look like, I don't know where to get it from, I don't know if I have to tell the arduino ide what port the avrisp mkii is hooked up to, I don't know how to arrive at what that port actually is. The questions are boundless. I don't know any of these answers ????? Any help would be appreciated.

Did you read the prior reply? Connect the AVRISP MKii to the Uno, plug in your blank chip

Board must be powered from USB, or from Barrel Jack/wallwart. Then:
Tools: Board: Arduino Uno
Tools: Programmer: AVRISP MKii
Tools: Burn Bootloader

CrossRoads:
Did you read the prior reply? Connect the AVRISP MKii to the Uno, plug in your blank chip

Board must be powered from USB, or from Barrel Jack/wallwart. Then:
Tools: Board: Arduino Uno
Tools: Programmer: AVRISP MKii
Tools: Burn Bootloader

OK:

I'll try this in a couple of days and go from there.

CrossRoads:
Did you read the prior reply? Connect the AVRISP MKii to the Uno, plug in your blank chip

Board must be powered from USB, or from Barrel Jack/wallwart. Then:
Tools: Board: Arduino Uno
Tools: Programmer: AVRISP MKii
Tools: Burn Bootloader

Am I supposed to in some way inform the PC / Arduino environment which port the avtisp mkii is on??? The response I get from the Arduino IDE is: 'error while burning bootloader' and also 'avrdude: usbdev_open(): did not find any USB device "usb" '

Am I supposed to have avrdude on board this laptop?? I don't even know what avrdude is. Would it (if I had it) be used in conjunction with (in the background of) the arduino environment??? I currently use Arduino Release 0023. ???? By the way, I'm using a previously burned fully operational atmega chip. I'm of the belief that one can just keep burning and keep burning and keep burning this bootloader out to any chip if one desires, regardless of the fact that the arduino system is already fully functional (as is the case here) ??? I don't know what the heck to do.

The PC should recognize the MKii being plugged in.
If not, do the New Hardware install thing or Linux equivlent and use the drivers provided with Arduino, my path is:
c:\arduino-1.0.1\hardware\tools\avr\utils\libusb\bin
(might have the slashes backwards there)

You do have avrdude installed if you have the IDE running.
Yes, can burn & re-burn to your hearts content, up to 10,000 times or maybe 100,000 times, I don't remember the number in the datasheet.

I'd start with the MKii driver.

CrossRoads:
The PC should recognize the MKii being plugged in.
If not, do the New Hardware install thing or Linux equivlent and use the drivers provided with Arduino, my path is:
c:\arduino-1.0.1\hardware\tools\avr\utils\libusb\bin
(might have the slashes backwards there)

You do have avrdude installed if you have the IDE running.
Yes, can burn & re-burn to your hearts content, up to 10,000 times or maybe 100,000 times, I don't remember the number in the datasheet.

I'd start with the MKii driver.

I'm in a windows environment. After some digging around on the web, I'm starting to see that I need a 'JTAGICE mkii' driver in the same folder as the windriver file. My dvd player on this laptop is toast. I'd like to put that jtagice file in there, but can't seem to get it to load (don't really know how to load it). When I bought the AVRISP programmer, I got a disk that says 'technical library' with it. I have other PC's at the house here, but I think I should just be able to get the file off of the web. It's giving me fits trying to get the 'JTAGICE' file in there. Maybe windows issues are outside this forum's scope, but I'm not sure how to get it in there.

So having all these drivers that come with the IDE are not enough? Or they need to be in a different place?

Hi CrossRoads:

I dug way down into that file area on my arduino installation, and I have 14 files there too (the same umber as you). Maybe I tried to use the avrisp prior to installing the drivers?? The fact that the optical drive isn't working doesn't really help here either. I can look at the cd (on another pc), that was provided with the avrisp when I bought it, maybe it would work to put the entire contents of the cd onto a thumb drive (should I be fortunate enough to have it in fact only be a cd -- not a dvd).

I did the same thing when I bought mine, loaded up Atmel AVR Studio 5.1
But that loads up a Jungo driver.
The IDE can't use the MKii with it.
I had to go into Windows, uninstall the Jungo driver, and install with the IDE files.
Now I can burn bootloaders and upload sketches with no bootloader (File:upload using programmer) with the MKii no problem.
(search the forum for Jungo, someone else had posted about doing the same, I followed that - you might even find my post where I linked to the earlier post)

Hi CrossRoads:

The driver changes worked! It's been a few hours since I first started trying to set this up, but after reading some websites on several issues surrounding this situation, I got the programmer to work. There is also an issue with a file called 'avrdude.conf' or something. I cleaned up the drivers issue first, and then changed the 'avrdude.conf' file and I can install the bootloader into the fresh chips. It all works now. Thanks for the help.

Cool.