installing a bootloader - ATMega328

(before i get any flames, im just a 9th grader and a newbie to circuitry, so go easy :wink:

I started circuitry with a “Nerdkit” (from www.nerdkits.com). It has an ATMega168 with a preinstalled bootloader, that lets it communicate with a USB cable (theres also a driver for your computer).

a week ago i hooked up something wrong and killed the microchip :roll:

I’ve ordered two ATMega328’s now, and i want to install my Nerdkits bootloader. I have the AVR conf files changed to support the 328, and I have my breadboard wired up like the “Beginning Embedded Electronics - 2” tutorial. The only problem i have now (im pretty sure) is that i have no clue how to create a makefile!!!

they included the bootloader with all the necessary files in it. Heres the makefile code that was provided in the Nerdkit

AVRDUDEFLAGS=-c dapa -pm168


all: fuses install

fuses:
	avrdude ${AVRDUDEFLAGS} -U lock:w:0x2f:m
	avrdude ${AVRDUDEFLAGS} -U efuse:w:0x00:m
	avrdude ${AVRDUDEFLAGS} -U hfuse:w:0xd5:m
	avrdude ${AVRDUDEFLAGS} -U lfuse:w:0xf7:m
	
install:
	avrdude ${AVRDUDEFLAGS} -U flash:w:foodloader.hex:a

(it was all on one line)

The bootloader is licensed under GNU so i could upload the entire thing if it’s necessary. Theres also a seperate text file called “fuses.txt”, if that’s important.

So, can anyone help me get this bootloader onto my ATMega328 using a serial port?

to write a bootloader into an atmel mega chip - you need an in system programmer (ISP). This costs $50 or so. Or if your board has a JTAG port (pins) on it, you can use this cheap one…

http://www.nkcelectronics.com/avr-jtag- … r-kit.html

or maybe SparkFun has something equivalent.

If you’re stumped, PM me and you can mail the chips to me and where to find the .hex file for the bootloader you want and I’ll burn and return.

ALSO - Do you know about the Atmel AVR forums on avrfreaks.net?

Congrats on looking at electronics and firmware/software as a young person. I did so long ago have have had a great career in that field and never been unemployed!

huh… So what exactly does an in-system programmer do (or more specifically, how does it do it?)

looking [this ISP, since it changes information sent from the computer, wouldn’t it be possible to just do this on your computer?](http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=152)