Skip to content

Instantly share code, notes, and snippets.

@martinsp
Created October 8, 2015 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinsp/8d35ae5f6cbb0b393c7e to your computer and use it in GitHub Desktop.
Save martinsp/8d35ae5f6cbb0b393c7e to your computer and use it in GitHub Desktop.
Bootloading ATmega 328 containing 16Mhz Arduino bootloader with 8Mhz Arduino bootloader

Instructions how to turn ATmega chip having bootloader for 16Mhz Arduino to bootloader for 8Mhz Arduino

  1. Alter boards.txt for Arduino IDE
##############################################################

xx.name=328 8mhz external
xx.upload.tool=avrdude
xx.upload.protocol=arduino
xx.upload.maximum_size=30720
xx.upload.maximum_data_size=2048
xx.upload.speed=57600

xx.bootloader.tool=avrdude
xx.bootloader.unlock_bits=0x3F
xx.bootloader.lock_bits=0x0F
xx.bootloader.low_fuses=0xFF
xx.bootloader.high_fuses=0xDA
xx.bootloader.extended_fuses=0x05
xx.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex

xx.build.mcu=atmega328p
xx.build.f_cpu=8000000L
xx.build.core=arduino
xx.build.variant=standard
  1. Put this chip in a board with 16Mhz crystal which supports usbasp protocol. In Arduino select board "328 8mhz external", select programmer and burn bootloader
  2. Put this chip in a board with 8Mhz crystal, and now it can be programmed with TTL cable from Arduino or Platformio.
  3. Configuration for platformio
platform = atmelavr
framework = arduino
board = uno
# board = pro8MHzatmega328
# board = 328p8m
upload_speed = 57600
# upload_protocol = usbasp
board_f_cpu = 8000000L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment