Go Down

Topic: atmega328p burning bootloader  (Read 548 times) previous topic - next topic

jaddion82052

hi guys,

I'm trying to burn the boot loader and eventually program an atmega328p DIP using an arduino nano.
Im running Arduino 1.8.10 and also Mac OS 10.13.4

The atmega328p is wired up like this tutorial, albeit with using a nano rather than an uno.

I'm successfully uploading the ISP sketch to the nano, and then selecting the following options.

Tools - Board - "Atmega328"
Clock 16MHz External           (16MHz xtal is connected with caps)
BOD 2.7v
Compiler LTO: LTO disabled.
Variant: 328P/328PA
Bootloader: "Yes UART0"
Port: usb140
Programmer: Arduino as ISP

This is the error message I receive once I attempt to burn the boot loader:

Code: [Select]
/private/var/folders/94/f3hz7ssd1z57fv4jg6cnhy480000gn/T/AppTranslocation/1A70E660-4B8D-41B8-BD43-461172061BA6/d/Arduino-2.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Users/XXXXX/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.3/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.wchusbserialfa140 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0b11111101:m -Uhfuse:w:0xd6:m -Ulfuse:w:0b11110111:m

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/XXXXX/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.3/avrdude.conf"
         User configuration file is "/Users/XXXXX/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.wchusbserialfa140
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
         Hardware Version: 122160443
         Firmware Version: -394600400.32766
         Topcard         : STK502
         Vtarget         : 1.8 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done.  Thank you.

Error while burning bootloader.




I'm new to burning bootloaders and this is slightly beyond me now, any thoughts tips or suggestions would be greatly appreciated. Many thanks.

max777

Hi !

not sure but...


I've seen that in your log


         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10

STK500 is different than "Arduino as ISP"
or maybe STK500 is how the bootloader burner see "Arduino as ISP"...
maybe you can check it

Budvar10

No it is OK, the STK500v1 is feasible for Arduino as ISP, even the response looks good, but why it is an error if it expects 0x14 and obtains 0x14, I don't know. Something with synchronization?
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

GoForSmoke

You can try this tutorial instead. It's not my site, just very good easy to follow info. His main site has a link to microcontrollers and that has links to tutorial blogs on many often discussed Arduino subjects with complete solutions. He shows photos and schematics, does the step by step with explanations and options laid out.

He shows the 328 and the 1284.

Just checking prices and ker-snap! ATMEGA328-PU is $1.95 to ATMEGA328P-PU at $2.14 for 1.
https://www.mouser.com/Search/Refine?Keyword=atmega328%20dip



 

1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

david_2018

I don't see it shown in the tutorial that you are using, do you have a 10uF capacitor connected between reset and ground on the nano you are using as a programmer?  

Go Up