Hi there. I have been attempting to create a breadboard arduino and have finally managed to get a sketch onto my atmega238p by following this tutorial.
The problem is that I want to run at 8mhz with an external crystal (arduino mini) but there is no option for this in the board programmer software. there are 2 options of either 8mhz internal or 16mhz external. I have tried uploading the bootloader i want using the built in function in the arduino software but it only ever says 'error while burning bootloader (there is minimal activity on the tx/rx lights, just a single blink and then nothing).Am I missing something in the software or does it simply not have the functionality of burning the required bootloader? Any advise would me much appreciated. thanks.
ps. I am using an smd chip(broken out), im not sure if this is irrelevant information or not.
gonadgranny:
The problem is that I want to run at 8mhz with an external crystal (arduino mini) but there is no option for this in the board programmer software. there are 2 options of either 8mhz internal or 16mhz external.
The easiest solution is to use MiniCore:
It has an external 8 MHz clock option.
gonadgranny:
I have tried uploading the bootloader i want using the built in function in the arduino software but it only ever says 'error while burning bootloader (there is minimal activity on the tx/rx lights, just a single blink and then nothing).Am I missing something in the software or does it simply not have the functionality of burning the required bootloader?
Most likely there is something wrong with your circuit. Please do this:
- File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
- Tools > Burn Bootloader
- After the process fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
- Paste the error messages in a reply here USING CODE TAGS (</> button on the toolbar).
Hi, I will have a look at the software, thanks for the suggestion.
Here is the output:
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v2 -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/danny/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)
avrdude done. Thank you.
Error while burning bootloader.
What type of ISP programmer are you using? Is it an Arduino board like in the tutorial?
pert:
What type of ISP programmer are you using? Is it an Arduino board like in the tutorial?
that was done using an FTDI programmer. i am able to upload sketches this way but the bootloader generates that message. i just put the chip back in the original circuit connected to an arduino nano and tried burning it this way but i get the same message:
Arduino: 1.8.5 (Mac OS X), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v2 -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/danny/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)
avrdude done. Thank you.
Error while burning bootloader.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
i am still able to talk to the chip using nick's programmer sketch though...
Atmega chip programmer.
Written by Nick Gammon.
Version 1.38
Compiled on Aug 31 2018 at 13:36:05 with Arduino IDE 10805.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xFF
HFuse = 0xDE
EFuse = 0xFD
Lock byte = 0xEF
Clock calibration = 0x8A
Type 'L' to use Lilypad (8 MHz) loader, or 'U' for Uno (16 MHz) loader ...
Ok so I just tried the 'burn bootloader' on my arduno uno(chinese preassembled clone) and got the same problem(have tried using the standard arduino uni core and also the core you recommended, neither work). does this suggest that its something other than the wiring?
gonadgranny:
that was done using an FTDI programmer.
It's not possible to burn bootloader in the Arduino IDE using an FTDI. You need to use an ISP programmer. If you don't own a dedicated ISP programmer then you can use a spare Arduino as an "Arduino as ISP" programmer. You can do this with the Nano connected to your target board as shown in the Gammon tutorial:
- Upload File > Examples > 11.ArduinoISP to the Nano
- Install MiniCore following these instructions: GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB
- Tools > Board > ATmega328
- Tools > Variant > ATmega328P / ATmega328PA
- Tools > Clock > 8 MHz external
- Tools > Programmer > Arduino as ISP
- Tools > Burn Bootloader
Supposedly it is possible to burn the bootloader using an FTDI FT232 via the command line but it's very slow. I've never tried it and I would recommend that you don't mess with that since you're already having enough trouble without adding a bunch of extra complexity.
pert:
It's not possible to burn bootloader in the Arduino IDE using an FTDI. You need to use an ISP programmer. If you don't own a dedicated ISP programmer then you can use a spare Arduino as an "Arduino as ISP" programmer. You can do this with the Nano connected to your target board as shown in the Gammon tutorial:
- Upload File > Examples > 11.ArduinoISP to the Nano
- Install MiniCore following these instructions: GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB
- Tools > Board > ATmega328
- Tools > Variant > ATmega328P / ATmega328PA
- Tools > Clock > 8 MHz external
- Tools > Programmer > Arduino as ISP
- Tools > Burn Bootloader
Supposedly it is possible to burn the bootloader using an FTDI FT232 via the command line but it's very slow. I've never tried it and I would recommend that you don't mess with that since you're already having enough trouble without adding a bunch of extra complexity.
Yes i certianly dont want to complicate things further. I have tried following those instructions and now I get this error:
Arduino: 1.8.5 (Mac OS X), Board: "ATmega328, Yes, 328P / 328PA, 2.7v, Disabled (default), 8 MHz external"
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Users/danny/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.1/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.wchusbserial1420 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0xfd:m -Uhfuse:w:0xd6:m -Ulfuse:w:0b11110111:m
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/Users/danny/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.1/avrdude.conf"
User configuration file is "/Users/danny/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/cu.wchusbserial1420
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: -1451085996
Firmware Version: -1073745512.444305
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.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
Hardware Version: -1451085996
Firmware Version: -1073745512.444305
Topcard : STK502
Vtarget : 1.8 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 usavrdude: 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.
A 10uF capacitor between Reset and Gnd on the "Arduino as ISP", stripe toward Gnd will usually fix this problem of the Arduino used as Programmer getting reset.
kprims:
A 10uF capacitor between Reset and Gnd on the "Arduino as ISP", stripe toward Gnd will usually fix this problem of the Arduino used as Programmer getting reset.
kprims, do you mean to put a capacitor on from reset to ground on the programmer arduino (not the one being programmed)? thanks/.
Yes, he meant the programmer.