Which bootloader for standalone atmeg arduino chip?

Hi,
I,ve bought an Uno and Pro Mini for experiments and learning the arduino platform, however for 'real' projects I have some blank atmega328P's on order that I plan to program the bootloader into, then the sketch for each project as it develops.
I use a TTL232R cable to do the sketch loading, but I,ll need to use my Uno with the isp programming sketch to initially program the bootloader into the blank chip. So far so good. However, which bootloader should I use? I know I need the choose one for the right frequency and chip type. Is the (westfw modified) optiboot the best choice, or does it not really matter as long as it supports the hardware?

Regards,
Texy

well it depends on the total amount of space your program will need, optiboot will use only 512bytes ,but if you plan to you the atmegas in standalone projects do you really need to use a bootloader ? i mean you can develop your application on the uno you have then flush the hex file onto the blank atmega

You really DON´T need ANY bootloader to upload sketches.

Do a search for " Burning sketches to the Arduino board with an external programmer"

Of course, but I do not want to use an external programmer, I want to use the TTL232R cable.
T.

In that case, use whichever you prefer. Just select the appropiate board to be able to upload;
i.e. if you burn duemilanove bootloader, you´ll have to select duemilanove board to upload sketches.

Do a search: " Using an Arduino as an AVR ISP (In-System Programmer) "

While either the atmega or optiboot bootloader will work, here are some things to consider:

If you intend to use the WatchDog timer, that will eliminate the atmega bootloader and push you to the optiboot bootloader.
You can fix the atmega code yourself (it is only a two line fix to the atmega bootloader code) but "as shipped" with
0022 there are WDT issues.

optiboot is smaller (512 bytes vs 2k) and faster uploading than atmega as well.

Also, westfw has created a standalone optiloader sketch that can burn the optiboot bootloader into the chips.
This avoids all the potential autoreset issues when trying to use an UNO with the
Arduino asn an AVR ISP sketch method.

--- bill

I've been using westfw's beta optiboot pretty much exclusively without any issues. For finalized projects I may or may not burn the sketch directly and not have a bootloader, but that's probably more of a personal choice in a lot of cases. A dedicated ISP programmer is a worthwhile investment. I have Adafruit's USBtinyISP and have used it on ATmega328Ps, ATtiny85s and ATtiny2313s. It's worked very well both with the Arduino IDE (burning bootloaders, but also burning sketches directly and with Arduino Tiny) and with WinAVR.

bperrybap:
While either the atmega or optiboot bootloader will work, here are some things to consider:

If you intend to use the WatchDog timer, that will eliminate the atmega bootloader and push you to the optiboot bootloader.
You can fix the atmega code yourself (it is only a two line fix to the atmega bootloader code) but "as shipped" with
0022 there are WDT issues.

optiboot is smaller (512 bytes vs 2k) and faster uploading than atmega as well.

Also, westfw has created a standalone optiloader sketch that can burn the optiboot bootloader into the chips.
This avoids all the potential autoreset issues when trying to use an UNO with the
Arduino asn an AVR ISP sketch method.

--- bill

I,ve only just seen posts on this new optiloader sketch program. I still need to download westfw optiboot hex file do I, or is it embedded into the sketch? If its not embedded, where do I put the hex file and how does the sketch point to it?
What I mean is, when using the arduinoisp sketch, you then use the IDE to select which arduino type to select the bootloader, but it doesn't browse to which file to use. Is westfw's method different?

Incidently my blank 328P's arrived yesterday, and I was able to program the standard optiboot bootloader into a couple with no problem using the arduinoisp method using my Uno and a 47uF cap (what I had handy). Worked first time without any issues. I was then also able to download a modified blink sketch using my TTL232R cable, again first time without any issues.

T.
Thanks,
Texy

optiloader is different. The bootloader(s) is embedded in the sketch.
The sketch looks as the signature of the chip to figure out which version to use.

I still need to download westfw optiboot hex file do I, or is it embedded into the sketch?

The sketch is self contained, including boot images for AVR 8, 168, 328p chips. It figures out what kind of chip the target is and burns the proper bootloader for it.

will it burn the fuses also ? also the bootloaders are compiled for 16mhz or other frequency ?

Yes, it'll burn the fuses as well. The included bootloaders are all compiled for 16MHz; optiLoader is designed to load optiboot onto older Arduino hardware. They should burn 8MHz systems OK, but the upload speed will be halved (57600); there aren't any other important clock dependencies in optiboot.

but if i recompile the optiboot for 8mhz clock and change the optiloader will that work ?

In order to use westfw's optiloadr sketch, you would have to embed the hx file data into it.
Otherwise compile your optiloader and use arduinoisp to program the target chip.

Texy