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.

Microcontroller Programming » Interesting Behavior with ATMega328 after loading Nerdkits Bootloader

July 28, 2009
by karlockhart
karlockhart's Avatar

It appears that the device ID has changed after loading the nerdkits bootloader, is that normal or did I mess something up?

I am using the following:

http://www.sparkfun.com/commerce/product_info.php?products_id=9231

Output Follows this Line:------------------------------------------------------------------------------------

C:UsersKarlDesktopworkspaceCodeCodebootloader>avrdude -F -c usbtiny -p 328p

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e950f

avrdude: safemode: Fuses OK

avrdude done. Thank you.

C:UsersKarlDesktopworkspaceCodeCodebootloader>make avrdude -c usbtiny -pm328p -U lock:w:0x2f:m

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f avrdude: reading input file "0x2f" avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written avrdude: verifying lock memory against 0x2f: avrdude: load data lock data from input file 0x2f: avrdude: input file 0x2f contains 1 bytes avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ... avrdude: 1 bytes of lock verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

avrdude -c usbtiny -pm328p -U efuse:w:0x00:m

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f avrdude: reading input file "0x00" avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of efuse written avrdude: verifying efuse memory against 0x00: avrdude: load data efuse data from input file 0x00: avrdude: input file 0x00 contains 1 bytes avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ... avrdude: 1 bytes of efuse verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

avrdude -c usbtiny -pm328p -U hfuse:w:0xd5:m

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f avrdude: reading input file "0xd5" avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of hfuse written avrdude: verifying hfuse memory against 0xd5: avrdude: load data hfuse data from input file 0xd5: avrdude: input file 0xd5 contains 1 bytes avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ... avrdude: 1 bytes of hfuse verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

avrdude -c usbtiny -pm328p -U lfuse:w:0xf7:m

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f avrdude: reading input file "0xf7" avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lfuse written avrdude: verifying lfuse memory against 0xf7: avrdude: load data lfuse data from input file 0xf7: avrdude: input file 0xf7 contains 1 bytes avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ... avrdude: 1 bytes of lfuse verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

avrdude -c usbtiny -pm328p -U flash:w:foodloader.hex:a

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e950f avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performe

     To disable this feature, specify the -D option.

avrdude: erasing chip avrdude: reading input file "foodloader.hex" avrdude: input file foodloader.hex auto detected as Intel Hex avrdude: writing flash (15372 bytes):

Writing | ################################################## | 100% 32.46s

avrdude: 15372 bytes of flash written avrdude: verifying flash memory against foodloader.hex: avrdude: load data flash data from input file foodloader.hex: avrdude: input file foodloader.hex auto detected as Intel Hex avrdude: input file foodloader.hex contains 15372 bytes avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 17.69s

avrdude: verifying ... avrdude: 15372 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

C:UsersKarlDesktopworkspaceCodeCodebootloader>cd ..

C:UsersKarlDesktopworkspaceCodeCode>cd sentinel

C:UsersKarlDesktopworkspaceCodeCodesentinel>make avrdude -c avr109 -p m328p -b 115200 -P COM2 -U flash:w:sentinel.hex:a

Connecting to programmer: . Found programmer: Id = "FDL v02"; type = S Software Version = 0.2; No Hardware Version given. Programmer supports auto addr increment. Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices: Device code: 0x35

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

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

avrdude done. Thank you.

make: *** [sentinel-upload] Error 1

C:UsersKarlDesktopworkspaceCodeCodesentinel>

July 29, 2009
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi Karl,

The bootloader will need a few modifications to work with the ATmega328P chip. In particular, the "config.h" file now contains the signature 0x1e9406, which is the signature for an ATmega168 chip. I actually don't have any ATmega328P's on hand so I can't test it now, but the bootloader will need these new signature bytes, and will also need to be given a new BOOT_SECTION_START address to put the bootloader properly at the end of the longer flash memory.

In any case, I just tried making the changes and e-mailed you a new compiled bootloader. Can you give it a try and let me know if it works? If it does, I'll put it somewhere for everyone.

Mike

Post a Reply

Please log in to post a reply.

Did you know that essentially all power supplies' voltages drop when current is drawn from them? Learn more...