I have successfully burned a bootloader onto a stand alone ATmega328P using ATmega_Board_Programmer burning from an Arduino Uno rev 3. This is what gets output to the serial monitor with the burning:
Atmega chip detector.
Written by Nick Gammon.
Version 1.18
Compiled on Oct 30 2016 at 19:18:27 with Arduino IDE 10612.
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 = 0xC0
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 512 bytes starting at 7E00
Bootloader:
7E00: 0x11 0x24 0x84 0xB7 0x14 0xBE 0x81 0xFF 0xF0 0xD0 0x85 0xE0 0x80 0x93 0x81 0x00
7E10: 0x82 0xE0 0x80 0x93 0xC0 0x00 0x88 0xE1 0x80 0x93 0xC1 0x00 0x86 0xE0 0x80 0x93
7E20: 0xC2 0x00 0x80 0xE1 0x80 0x93 0xC4 0x00 0x8E 0xE0 0xC9 0xD0 0x25 0x9A 0x86 0xE0
7E30: 0x20 0xE3 0x3C 0xEF 0x91 0xE0 0x30 0x93 0x85 0x00 0x20 0x93 0x84 0x00 0x96 0xBB
7E40: 0xB0 0x9B 0xFE 0xCF 0x1D 0x9A 0xA8 0x95 0x81 0x50 0xA9 0xF7 0xCC 0x24 0xDD 0x24
7E50: 0x88 0x24 0x83 0x94 0xB5 0xE0 0xAB 0x2E 0xA1 0xE1 0x9A 0x2E 0xF3 0xE0 0xBF 0x2E
.
.
.
7FF0: 0xFF 0x27 0x09 0x94 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x04 0x04
MD5 sum of bootloader = 0xFB 0xF4 0x9B 0x7B 0x59 0x73 0x7F 0x65 0xE8 0xD0 0xF8 0xA5 0x08 0x12 0xE7 0x9F
Bootloader name: optiboot_atmega328
First 256 bytes of program memory:
0: 0x0C 0x94 0x5C 0x00 0x0C 0x94 0x6E 0x00 0x0C 0x94 0x6E 0x00 0x0C 0x94 0x6E 0x00
10: 0x0C 0x94 0x6E 0x00 0x0C 0x94 0x6E 0x00 0x0C 0x94 0x6E 0x00 0x0C 0x94 0x6E 0x00
.
.
.
E0: 0x90 0xE0 0xFC 0x01 0xEC 0x55 0xFF 0x4F 0x24 0x91 0xFC 0x01 0xE0 0x57 0xFF 0x4F
F0: 0x84 0x91 0x88 0x23 0x99 0xF0 0x90 0xE0 0x88 0x0F 0x99 0x1F 0xFC 0x01 0xEA 0x57
Programming mode off.
The problem is the Low Byte fuse setting. It is 0xFF (and HFuse 0xDE, EFuse 0xFD). I want the chip to run on its internal clock, without the divider. The fuse calculator from Engbedded tells me that it is E2 I want.
What perplexes me is that when I look at the code for ATmega_Board_Programmer, the fuse values for LFuse, HFuse, and EFuse for the signature 0x1E950F (identified as the 328P I am burning) reads as E2, DE, 05 (and 2F for the Lock Byte).
Why is ATmega_Board_Programmer not setting the fuses according to the code? In fact, I can find no AVR Part for which these fuse settings appear (the ATmega328 without the P comes closer).
I thought perhaps that ATmega_Board_Programmer wasn't able to burn anything, that these were the settings from the chip vendor (DigiKey), but the output from the ATmega_Board_Programmer suggests it did indeed burn the ATmega_Board_Programmer.ino.hex file:
Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Sketch uses 27,044 bytes (83%) of program storage space. Maximum is 32,256 bytes.
Global variables use 241 bytes (11%) of dynamic memory, leaving 1,807 bytes for local variables. Maximum is 2,048 bytes.
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/cu.usbmodem1d11 -b115200 -D -Uflash:w:/var/folders/q6/2g6gp6cd0tb2_4wz4ljn39sm0000gp/T/arduino_build_484799/Atmega_Board_Programmer.ino.hex:i
avrdude: Version 6.3, compiled on Sep 12 2016 at 17:22:25
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/Bigdaddy/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/cu.usbmodem1d11
Using Programmer : arduino
Overriding Baud Rate : 115200
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 : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/var/folders/q6/2g6gp6cd0tb2_4wz4ljn39sm0000gp/T/arduino_build_484799/Atmega_Board_Programmer.ino.hex"
avrdude: writing flash (27044 bytes):
Writing | ################################################## | 100% 5.08s
avrdude: 27044 bytes of flash written
avrdude: verifying flash memory against /var/folders/q6/2g6gp6cd0tb2_4wz4ljn39sm0000gp/T/arduino_build_484799/Atmega_Board_Programmer.ino.hex:
avrdude: load data flash data from input file /var/folders/q6/2g6gp6cd0tb2_4wz4ljn39sm0000gp/T/arduino_build_484799/Atmega_Board_Programmer.ino.hex:
avrdude: input file /var/folders/q6/2g6gp6cd0tb2_4wz4ljn39sm0000gp/T/arduino_build_484799/Atmega_Board_Programmer.ino.hex contains 27044 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 4.07s
avrdude: verifying ...
avrdude: 27044 bytes of flash verified
avrdude done. Thank you.
Any thoughts?
I know MiniCore is widely touted as a superior solution, but I am trying to understand/learn in the process. By the way, with MiniCore, the pinout would suggest I need to hook up an FTDI AND ICSP from my programming Arduino Uno to the ATmega328P on the breadboard. Yes?
Thank you all for so altruistically donating some of your time even to us newbies.