Pages: [1]   Go Down
Author Topic: Burning a Bootloader onto Atmega328  (Read 1156 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to burn the bootloader onto an Atmega328P-PN, following the instructions provided on the arduino website at this page: http://arduino.cc/en/Tutorial/ArduinoToBreadboard

I am attempting to follow the instructions for the minimal setup (as I could not find a 16MHz oscillator), and I have run into two problems, first, while running the 1.5.1 beta, the hardware configuration archive does not show up, so I had to download arduino 1.0.3 (this is less of a problem, and more of a query as to where to submit the bug for v1.5.1). After installing the old version I was able to find what I needed. However, after following the instructions exactly up to step 4 (Run Tools > Burn Bootloader > w/ Arduino as ISP.) I pull down the tools menu>programmer> Arduino as ISP, and THEN click burn bootloader instead, and receive this error while burning bootloader:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12

As far as I know this problem is generic, and the resolution might not be clear, but I would appreciate any help I can get. If it matters, I am doing this on an OSX computer running Snow Leopard (10.6.8 ) and I renamed the Arduino v1.5.1 to "ArduinoDue" in order to keep both IDEs (I don't know if this will cause problems or not, but I have both an Arduino UNO, and a Due that I need to work on)
For clarity's sake, I am attempting to use an Arduino UNO R2 as the ISP, and the Due is irrelevant from a hardware perspective, I apologize in advance if any of the information I provide is redundant, or convoluted. Thank you for your help
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16459
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why don't you try using Nick's bootloader sketch, it works much simpler as the bootloader code in embedded in the sketch so the IDE and AVRDUDE don't enter the picture. His sketch works great.

http://www.gammon.com.au/forum/?id=11635


Lefty
Logged

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

While trying to upload Mr. Gammons sketch onto the Arduino UNO, I get this error: "SCK was not declared in this scope" in line 527, in the function startProgramming() is there a simple solution to this? The specific line is:
pinMode (SCK, OUTPUT);
« Last Edit: February 20, 2013, 11:39:24 pm by maysarahs » Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the target board selected as Uno?
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

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

*smacks forehead, ah, okay, it uploaded, thank you! Now I have inserted the pins as the Arduino to breadboard tutorial suggested, and opened the serial monitor. After waiting, I just get some gibberish, is this supposed to happen?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16459
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

*smacks forehead, ah, okay, it uploaded, thank you! Now I have inserted the pins as the Arduino to breadboard tutorial suggested, and opened the serial monitor. After waiting, I just get some gibberish, is this supposed to happen?

The lower right on the serial monitor has a baudrate selector, does it match the baudrate you used in the sketch code in the serial.begin(xxxx) statement? Arduino is all about details.

Lefty
Logged

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

Aha! Thank you, I'm sorry for being such a beginner at this, I get this message after typing U and then G (for uno and then begin respectively):

Erasing chip ...
Writing bootloader ...
Committing page starting at 0x7E00
Committing page starting at 0x7E80
Committing page starting at 0x7F00
Committing page starting at 0x7F80
Written.
Verifying ...
Verification error at address 7F95. Got: 0xCA  Expected: 0xCF
1 verification error(s).

 Is the verification error an indication that it failed? I will try loading the blink sketch onto it now to see if it works, but I thought I'd ask here while I did that, thank you all for such prompt replies!
Logged

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

After connecting the LED (and prying out the microcontroller on the Uno) I tried to upload blink. If I have it set to upload to "atmega on breadboard" it fails to compile with this error:

In file included from Blink.ino:10:
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:213:26: error: pins_arduino.h: No such file or directory

However if I have it set to upload to Uno, I can upload the Blink sketch, and the LED connected to pin 19 on the ATmega (corresponding to digital pin 13 for arduino) will blink twice, and then it will tell me that it failed up upload:

Binary sketch size: 1,084 bytes (of a 32,256 byte maximum)
avrdude: stk500_recv(): programmer is not responding

I'm sorry if there is an FAQ with these problems already troubleshot, but I appreciate all of the help given so far.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6364
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
while running the 1.5.1 beta
Are you still running 1.5.x?  I believe that the layout of the "hardware" directory has changed pretty significantly in order to support multiple CPU architectures, so a lot of add-on board definitions that are prepared for 1.0 won't work right.
Logged

Pages: [1]   Go Up
Jump to: