Pages: [1] 2   Go Down
Author Topic: Bootloader to ATmega 328P  (Read 4863 times)
0 Members and 1 Guest are viewing this topic.
Mobile, AL
Offline Offline
Sr. Member
****
Karma: 0
Posts: 314
CAUTION!-Slow Learner
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>
« Last Edit: October 01, 2012, 03:24:30 pm by KenH » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26947
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try selecting Uno as the board type instead.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Mobile, AL
Offline Offline
Sr. Member
****
Karma: 0
Posts: 314
CAUTION!-Slow Learner
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26947
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26947
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26947
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26947
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26947
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* MKii_drivers.jpg (77.73 KB, 960x720 - viewed 45 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26947
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1] 2   Go Up
Jump to: