NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Problem bootloading ATMega328PU from protostack

December 30, 2012
by Nichben
Nichben's Avatar

Hi, I ordered the USBASP AVR programmer from protostack too. I followed your directions from NErdkits library, http://www.nerdkits.com/library/howto_install_bootloader/. I carefully checked all my connections and when powering up without the ATMega chip i got 5.15 V. With the chip I'm getting 5.13 V. This is using the power from the USBASP programmer setting the jumper to 5 V. I also pulled the reset pin to ground via a 10k resistor. So far I tried to erase the chip and execute the make fuse command. Here's what I got below:

C:bootload>avrdude -c usbasp -p m328p -e

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9514 avrdude: Expected signature for ATMEGA328P is 1E 95 0F Double check chip, or use -F to override this check.

avrdude done. Thank you.

C:bootload>avrdude -c usbasp -p m328p -e -F

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9514 avrdude: Expected signature for ATMEGA328P is 1E 95 0F avrdude: erasing chip

avrdude: safemode: Fuses OK

avrdude done. Thank you.

C:bootload>make fuses avrdude -c usbasp -pm328p -U lock:w:0x2f:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9514 avrdude: Expected signature for ATMEGA328P is 1E 95 0F Double check chip, or use -F to override this check.

avrdude done. Thank you.

make: *** [fuses] Error 1

I added -F to get through the erase part as you can see above, but I'm hesitant to try this doing make fuses command. Please let me know how I may proceed. Protostacks web address is http://www.protostack.com/blog/. Thanks, John

December 30, 2012
by Noter
Noter's Avatar

The signature you are reading says your chip is ATmega328 instead of ATmega328P. Chips are virtually the same except for some low power options so give it the -F and carry on.

December 30, 2012
by Nichben
Nichben's Avatar

I found the makefile so I thought I'd add this too;

AVRDUDEFLAGS=-c usbasp -pm328p

all: fuses install

fuses:
    avrdude ${AVRDUDEFLAGS} -U lock:w:0x2f:m
    avrdude ${AVRDUDEFLAGS} -U efuse:w:0x05:m
    avrdude ${AVRDUDEFLAGS} -U hfuse:w:0xd2:m
    avrdude ${AVRDUDEFLAGS} -U lfuse:w:0xf7:m

install:
    avrdude ${AVRDUDEFLAGS} -U flash:w:foodloader.hex:a

Thanks, John

December 30, 2012
by Nichben
Nichben's Avatar

Where can I put the -F after make fuses in the cmd window or in the makefile itself after the -U?

December 30, 2012
by Noter
Noter's Avatar

If you don't know what those fuse settings do you probably should look them up before writing to the chip. If the serial programming or reset get disabled your chip is bricked until you get it to a high voltage parallel programmer. I like the Engbedded Atmel AVR® Fuse Calculator to look up values.

Otherwise, add the -F at the end of the AVRDUDEFLAGS definition near the top of the makefile.

December 31, 2012
by Nichben
Nichben's Avatar

I used the makefile and other files in the bootloader328P folder that was included in the NK sampled source code from the downloads page of the NK website. I checked the fuse bits in the makefile anyway at the site you suggested. the reset and serial programming were not disabled. I added the -F where you advised and ran make fuses again. That working I compared the results to that in the tutorial and found it mine was the same. I did the make install and that also worked. I was able to make the initialload program from the sample source code and that ran as expected. All is well. Many thanks, John

Post a Reply

Please log in to post a reply.

Did you know that NerdKits believes in the importance of a mixture of meaningful topics, clear instruction, and engaging projects? Learn more...