Bootloader woes

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mftkoehler
 
Posts: 14
Joined: Wed Mar 21, 2012 4:54 pm

Bootloader woes

Post by mftkoehler »

I'm making myself slightly crazy trying to burn the Arduino bootloader into a project I've created. I'm using a ATMEGA328p chip with crystal and a bunch of other things that aren't relevant. I have been able to upload compiled .hex files to the chip using the bus pirate as an ISP. These run fine, and I've been able to upload sketches that output serial data to the Arduino IDE. The problem is that I can't seem to burn the bootloader to the chip. I've used the following command (mac):

avrdude -c buspirate -p m328p -P /dev/tty.usbserial-AE01J42R -U efuse:w:0x05:m -U hfuse:w:0xD2:m -U lfuse:w:0xFF:m -U flash:w:atmega328_optiboot.hex -U lock:w:0x0F:m

This works for a bit and then seems to complete. When I then try to connect using the FTDI friend and the Arduino IDE, it can't connect.

Possible problem: I have the wrong bootloader file. Should I be using ATmegaBOOT_168_atmega328.hex from the
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/atmega directory? Seems like the right one.

Possible problem #2: I am connecting incorrectly with the bootloader. I am assuming that I want to connect as the Duemilanove with ATmega328. I've also tried the Uno and 5V Pro mini without success.

Any suggestions? Thanks very much in advance,

Mike

User avatar
westfw
 
Posts: 2008
Joined: Fri Apr 27, 2007 1:01 pm

Re: Bootloader woes

Post by westfw »

Either 1 or 2. If you've burnt "optiboot_atmega328.hex", your board will behave like an Uno, and you should select "Uno" as the board type. If you burn ATmegaboot, then your board will behave like a "duemilanove with atmega328." The "board type" has more to do with which bootloader is on your chip, than the details of wiring/circuit.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”