Burning bootloader to Atmega 328-PU

Hey there, I just got my fresh atmega 328- PU. I exchange the atmega 328-PU on my arduino UNO with the fresh atmega 328-PU. And I used arduino 0021 to burn bootloader. I follow the step here : http://tutorial.cytron.com.my/2011/12/19/burning-arduino-bootloader-with-avr-usbasp/

However, this is the error code that I get. Can anyone tell me why ? Is it clock problem ? or what ?

Thank you

That's because an ATmega328-PU is NOT the same chip as the ATmega328P-PU. It has a different signature. To use it you need a different boards.txt entry with the 'mcu' set to atmega328 instead of atmega328p:

unononp.name=Arduino Uno (Non-P 328)
unononp.upload.protocol=arduino
unononp.upload.maximum_size=32256
unononp.upload.speed=115200
unononp.bootloader.low_fuses=0xff
unononp.bootloader.high_fuses=0xde
unononp.bootloader.extended_fuses=0x05
unononp.bootloader.path=optiboot
unononp.bootloader.file=optiboot_atmega328.hex
unononp.bootloader.unlock_bits=0x3F
unononp.bootloader.lock_bits=0x0F
unononp.build.mcu=atmega328
unononp.build.f_cpu=16000000L
unononp.build.core=arduino
unononp.build.variant=standard

The 328 & 328P will both function, you just need to be aware that if you load directly using an ISP the 328 has a different signature. Once the bootloader is loaded there is no problem loading from the arduino environment as an Uno.

If you want to continue using 328 chips there are 2 files that need a 328 entry -
Boards.txt, mine is found at C:\Program Files\arduino-1.0\hardware\arduino\boards.txt, yours will depend on how you installed Arduino
ARVDude.conf, mine is found at C:\Program Files\arduino-1.0\hardware\tools\avr\etc\avrdude.conf, and once again yours will depend on how you installed Arduino

If you are interested in adding the entries let me know.

Actually, what is the purpose of burning bootloader to the chip ? I do not quite understand. What is that actually.

Thank you

The bootloader runs at power up & reset, it watches the Serial Rx line for a bit, and if there is no download activity it starts up your sketch.

The bootloader is installed using the SPI lines, so one needs an AVR ISP - In System Programmer - to install it.

When the bootloader sees Serial data coming in that it recognizes as a sketch download, it copies that data into the Flash/Program Memory, and when done it starts the sketch running.

Can I burn bootloader to Atmega 8 ?

Thank you

I believe so. The basics are:

In the IDE (1.0, 1.0.1):
Select Tools:Board:Arduino NG or older w/ Atmega8

Select Tools: Programmer: pick the programmer you intend to use, which will connect to the ICSP header or equivalent pins (MISO, MOSI, SCK, Reset, +5, GND)
(I use this one: http://www.mdfly.com/index.php?main_page=product_info&cPath=5&products_id=415
added 2 lines to programmers.txt so it shows up in the list of programmers:
usbasp.name=MDFLY
usbasp.protocol=usbasp

You are of course free to use whatever you have.)

Select Tools: Burn Bootloader.

Have not tried that particular chip, don't know how it will do with the latest IDE and subsequent dowloading of sketch via serial port.

Other option is to load the sketch with no Bootloader using the same programmer:

In the IDE:
Select File: Upload Using Programmer

That will leave you with no bootloader, your sketch will start right after reset.

I was using arduino 0022 to burn bootloader for my fresh atmega 328 using USBasp. The arduino 1.01 didnt have the option where I can burn w/USBasp ><

Why it is so ?

I don't know ??
Here's a screen shot of my 1.0.1, no changes made yet (to add the MDFly programmer).
It is listed there.

What I mean is this :

In the new version 1.01 arduino IDE, there is no option like that. Just the burn bootloader. Kinda weird

Thank you

In 1.0.1, you select the Programmer, then burn the bootloader.
In -0021, -0022, -0023, you selected both together.
Just a menu structure change.

Okay. Get it.Thank you sir :slight_smile:

johnwasser:
That's because an ATmega328-PU is NOT the same chip as the ATmega328P-PU. It has a different signature. To use it you need a different boards.txt entry with the 'mcu' set to atmega328 instead of atmega328p:

unononp.name=Arduino Uno (Non-P 328)

...
.....
.......

Thanks for your help. I am using 1 ATmega328 chip & I am facing the same issue with the IDE. My first result was EXACTLY like the 1st post (IMAGE). Then I used this code to modify my boards.txt file. After doing all the detup in hardware & software when I hit the BURN BOOTLOADER option, it stucked & asks for "upload.tool" & "bootloader.tool" so like the other boards I added these 2 lines

unononp.upload.protocol=arduino
unononp.bootloader.tool=avrdude

The results are UNSUCCESSFUL. The error report is here...

avrdude: AVR Part "atmega328" not found.
Valid parts are:
  t10  = ATtiny10        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16880]
  t9   = ATtiny9         [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16836]
  t5   = ATtiny5         [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16792]
  t4   = ATtiny4         [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16748]
  ucr2 = 32UC3A0512      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16727]
  x128a4 = ATXMEGA128A4    [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16629]
  x64a4 = ATXMEGA64A4     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16532]
  x32a4 = ATXMEGA32A4     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16435]
  x16a4 = ATXMEGA16A4     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16338]
  x256a3b = ATXMEGA256A3B   [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16241]
  x256a3 = ATXMEGA256A3    [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16144]
  x192a3 = ATXMEGA192A3    [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:16047]
  x128a3 = ATXMEGA128A3    [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15950]
  x64a3 = ATXMEGA64A3     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15853]
  x256a1 = ATXMEGA256A1    [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15756]
  x192a1 = ATXMEGA192A1    [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15659]
  x128a1d = ATXMEGA128A1REVD [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15562]
  x128a1 = ATXMEGA128A1    [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15465]
  x64a1 = ATXMEGA64A1     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15368]
  m6450 = ATMEGA6450      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:15179]
  m3250 = ATMEGA3250      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:14990]
  m645 = ATMEGA645       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:14801]
  m325 = ATMEGA325       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:14612]
  m8u2 = ATmega8U2       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:14433]
  m16u2 = ATmega16U2      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:14248]
  m32u2 = ATmega32U2      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:14063]
  usb82 = AT90USB82       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:13877]
  usb162 = AT90USB162      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:13693]
  usb1287 = AT90USB1287     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:13504]
  usb1286 = AT90USB1286     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:13315]
  usb647 = AT90USB647      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:13127]
  usb646 = AT90USB646      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:12938]
  m32u4 = ATmega32U4      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:12750]
  t84  = ATtiny84        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:12567]
  t44  = ATtiny44        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:12385]
  t24  = ATtiny24        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:12203]
  m128rfa1 = ATMEGA128RFA1   [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:12015]
  m2561 = ATMEGA2561      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:11821]
  m2560 = ATMEGA2560      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:11628]
  m1281 = ATMEGA1281      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:11440]
  m1280 = ATMEGA1280      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:11251]
  m640 = ATMEGA640       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:11063]
  t85  = ATtiny85        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:10882]
  t45  = ATtiny45        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:10703]
  t25  = ATtiny25        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:10523]
  pwm3b = AT90PWM3B       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:10342]
  pwm2b = AT90PWM2B       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:10159]
  pwm3 = AT90PWM3        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:9976]
  pwm2 = AT90PWM2        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:9792]
  t4313 = ATtiny4313      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:9610]
  t2313 = ATtiny2313      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:9423]
  m328p = ATMEGA328P      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:9235]
  t88  = attiny88        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:9049]
  m168p = ATMEGA168P      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:8861]
  m168 = ATMEGA168       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:8673]
  m88p = ATMEGA88P       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:8486]
  m88  = ATMEGA88        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:8300]
  m48  = ATMEGA48        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:8113]
  t861 = ATTINY861       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:7925]
  t461 = ATTINY461       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:7736]
  t261 = ATTINY261       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:7547]
  t26  = ATTINY26        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:7390]
  m8535 = ATMEGA8535      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:7232]
m8515 = ATMEGA8515      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:7074]
  m8   = ATMEGA8         [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:6913]
  m161 = ATMEGA161       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:6773]
  m32  = ATMEGA32        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:6598]
  m6490 = ATMEGA6490      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:6405]
  m649 = ATMEGA649       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:6220]
  m3290p = ATMEGA3290P     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:6037]
  m3290 = ATMEGA3290      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:5852]
  m329p = ATMEGA329P      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:5667]
  m329 = ATMEGA329       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:5483]
  m169 = ATMEGA169       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:5303]
  m163 = ATMEGA163       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:5145]
  m162 = ATMEGA162       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:4949]
  m1284p = ATMEGA1284P     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:4759]
  m644p = ATMEGA644P      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:4567]
  m644 = ATMEGA644       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:4377]
  m324pa = ATmega324PA     [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:4186]
  m324p = ATMEGA324P      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:3995]
  m164p = ATMEGA164P      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:3804]
  m16  = ATMEGA16        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:3626]
  c32  = AT90CAN32       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:3435]
  c64  = AT90CAN64       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:3245]
  c128 = AT90CAN128      [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:3055]
  m128 = ATMEGA128       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:2877]
  m64  = ATMEGA64        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:2696]
  m103 = ATMEGA103       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:2556]
  8535 = AT90S8535       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:2435]
  8515 = AT90S8515       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:2321]
  4434 = AT90S4434       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:2238]
  4433 = AT90S4433       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:2114]
  2343 = AT90S2343       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1990]
  2333 = AT90S2333       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1862]
  2313 = AT90S2313       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1749]
  4414 = AT90S4414       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1636]
  1200 = AT90S1200       [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1521]
  t15  = ATtiny15        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1388]
  t13  = ATtiny13        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1215]
  t12  = ATtiny12        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1082]
  t11  = ATtiny11        [C:\Users\Roy\Desktop\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf:1018]

I have burnt the bootloader in a 328p chip with the same setup & it was successful at the first try but burning a 328 bootloader is like a pain. searching the solution for last 2 days but no improvement. :frowning:
Any help please!