Bootloader with crystal question.

I poked around the archives and could not find an answer to this question...

If I were to use a minimal setup on a breadboard, just an ATMEGA, 10K resistor, .1 uF cap and some wire, could I burn a bootloader with full external crystal support?

I'd then remove the ATMEGA from the board and place it in an Arduino 'compatible' board with an external oscillator (no ISP connector).

I'm ASSuming this would work. Yes? No?


Probably not without changing fuse settings.
Need one setup for internal oscillator settings, need another setup for external crystal.
Why not just get a crstal and 2 22pf caps?
16MHz Crystal HC49US - dipmicro electronics 33 cents
22pF/1000V Radial Ceramic Disc Capacitor - dipmicro electronics 40 cents for 2
$2.50 for shipping.
$3.25 and make a lot of problems go away.

Maybe I was not clear...

The board the MCU would be actually running in has an external oscillator. It does not have an ISP connector. Although I could just rig some jumpers.

What I want to know is, can I burn the bootloader for the 328 in that board while the IC is on a breadboard without? I'd like to know if this works. Even if I can easily get a crystal and caps...

Heck, I ought to just try it and see for myself...

Yes, try it. Am not sure how cleanly the 16MHz carry over using jumper wires, that may cause you a problem.
All the examples I have seen using a depopulated Duemilanove for example jumpered over to a breadboarded part for programming had an oscillatar with the breadboarded part, which I would suggest to match your final configuration.
Some of the early discussions I saw when I started arduino-ing involved 2 and 4 parts on PCBs running off the same crystal (not sure if that was this forum or not, I came across one or two less useful ones before settling here). But that was colocated chips & PCB traces, not wires up in the air.
Be sure to let us know if it works!

If I'm not mistaken, the burn sequence sets fuses first and then uploads the bootloader. When avrdude gets around to actually burn the bootloader code, the atmega will be expecting an external crystal and so will not respond unless one is present.

Fuse settings used for an external crystal will work equally well with an external oscillator so one option is to hook up a 16MHz oscillator (rather than crystal + caps) to your burn target.

Something like this?

Note that is the steps to burn a sketch to the breadboard chip. You need to remove the chip one the Arduino board and add a jumper between the reset on the Arduino board and the pin1 of the breadboard chip.

Interesting link Alparent.

Thus far I have not been able to communicate with the m328p on the breadboard. (USBasp via ISP connection)

I found some info while looking at the Sanguino that may help. I have not had time to try their suggestions.

Updates later when I can hack this.