Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

bootloading atmega328p on an arduino board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

bootloading atmega328p on an arduino board

by kjwbr on Mon Jul 25, 2011 4:04 pm

I'm VERY new with arduino and pretty much software altogether, and I've been trying to bootload a modified arduino board that has an atmega328p with a 16mhz crystal. I use an
AVR pocket programmer to put the bootloader on, and I've made sure that the drivers are installed. I'm also using arduino 0022. here's the procedure I've been using:


- connect the board/pocket programmer to the computer
- connect power supply to board
- using cmd, enter the following: avrdude -B 1 -C usbtiny -p m328p -V -e -U flash:w:ATmegaBOOT_168_ atmega328.hex -U efuse:w:0x05:m -U hfuse:w:0xDA:m -U l fuse:w:0xFF:m

then, I go to arduino 0022, and try to upload a simple serial call repsonse sketch using a 5V FTDI connection between the board and the computer. I have made sure that all the right driversare installed, but i always get the error: "avrdude: ser_send(): write error: sorry no info avail"

getting into a bit of a time crunch, so ANY help would be much appreciated!!
kjwbr
 
Posts: 1
Joined: Mon Jul 25, 2011 3:43 pm

Re: bootloading atmega328p on an arduino board

by madworm_de on Mon Jul 25, 2011 4:56 pm

First, you missed the lock bits. If you don't re-lock the bootloader it will get wiped by a chip erase.

My standard (extremely verbose) procedure is this:

Code: Select all | TOGGLE FULL SIZE
avrdude -c usbtiny -p m328p -VVVVV -B 100 -U lock:w:0x3F:m
avrdude -c usbtiny -p m328p -VVVVV -B 100 -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0x05:m
avrdude -c usbtiny -p m328p -VVVVV -B 1 -e -U flash:w:suitable_bootloader.hex
avrdude -c usbtiny -p m328p -VVVVV -B 100 -U lock:w:0x0F:m


Also you should provide more information, especially verbose output of avrdude.
NO LARDO CHIPS
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Re: bootloading atmega328p on an arduino board

by minerva on Sun Aug 21, 2011 8:11 am

If you're working with an Arduino-compatible AVR such as the ATmega328, and what you're programming it with is an Arduino bootloader, and you're using an external crystal oscillator at 8 MHz or 16 MHz, the easiest way to do this is with the Arduino IDE.

Just connect the target board to the programmer (the Adafruit one is highly recommended) and to the PC, select the Arduino type in the Arduino IDE to match your target hardware (select ATmega168 or 328 or whatever your chip is, and select the right crystal frequency) and select burn bootloader.

*If* what you're flashing onto the chip is an Arduino bootloader, there's no need to stuff around with the command line or with fuses.
minerva
 
Posts: 58
Joined: Sun Dec 06, 2009 11:12 pm

Re: bootloading atmega328p on an arduino board

by madworm_de on Sun Aug 21, 2011 9:08 am

"If you buy our product, there is no need to use your brain". :?
NO LARDO CHIPS
madworm_de
 
Posts: 99
Joined: Mon Jun 09, 2008 6:56 am

Please be positive and constructive with your questions and comments.