Daniel Porrey
Published © GPL3+

Bootload Your ATtiny85

Add a bootloader to your ATtiny85 to make prototyping easy.

BeginnerProtip1 hour30,576
Bootload Your ATtiny85

Things used in this project

Hardware components

ATtiny85
Microchip ATtiny85
×1
Tiny AVR Programmer
SparkFun Tiny AVR Programmer
×1
Adafruit FTDI Serial TTL-232 USB Cable
×1
SparkFun .1 µF Ceramic Capacitor
×1
SparkFun 10K Ω Resistor
×1
Adafruit Break-away 0.1" 36-pin strip male header
1 piece @ length 6
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Resistor 220 ohm
Resistor 220 ohm
×1
LED (generic)
LED (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Fritzing

Breadboard

Schematic

Fritzing - LED

Breadboard - LED

Schematic - LED

Code

boards.txt

Arduino
Version 1.0.2
menu.cpu=Processor
menu.clock=Clock

################################################################################

ATtinyX5.name=ATtiny25/45/85
ATtinyX5.bootloader.tool=arduino:avrdude
ATtinyX5.bootloader.file=optiboot/optiboot_attiny85.hex
ATtinyX5.bootloader.unlock_bits=0xff
ATtinyX5.bootloader.lock_bits=0xff

ATtinyX5.build.core=arduino:arduino
ATtinyX5.build.board=attiny
ATtinyX5.upload.tool=arduino:avrdude

ATtinyX5.menu.cpu.attiny25=ATtiny25
ATtinyX5.menu.cpu.attiny25.upload.maximum_size=1472
ATtinyX5.menu.cpu.attiny25.upload.maximum_data_size=128
ATtinyX5.menu.cpu.attiny25.build.mcu=attiny25
ATtinyX5.menu.cpu.attiny25.build.variant=tiny8

ATtinyX5.menu.cpu.attiny45=ATtiny45
ATtinyX5.menu.cpu.attiny45.upload.maximum_size=3520
ATtinyX5.menu.cpu.attiny45.upload.maximum_data_size=256
ATtinyX5.menu.cpu.attiny45.build.mcu=attiny45
ATtinyX5.menu.cpu.attiny45.build.variant=tiny8

ATtinyX5.menu.cpu.attiny85=ATtiny85
ATtinyX5.menu.cpu.attiny85.upload.maximum_size=7616
ATtinyX5.menu.cpu.attiny85.upload.maximum_data_size=512
ATtinyX5.menu.cpu.attiny85.build.mcu=attiny85
ATtinyX5.menu.cpu.attiny85.build.variant=tiny8

ATtinyX5.menu.clock.internal1=Internal 1 MHz
ATtinyX5.menu.clock.internal1.bootloader.low_fuses=0x62
ATtinyX5.menu.clock.internal1.bootloader.high_fuses=0xdf
ATtinyX5.menu.clock.internal1.bootloader.extended_fuses=0xfe
ATtinyX5.menu.clock.internal1.build.f_cpu=1000000L

ATtinyX5.menu.clock.internal8=Internal 8 MHz
ATtinyX5.menu.clock.internal8.bootloader.low_fuses=0xe2
ATtinyX5.menu.clock.internal8.bootloader.high_fuses=0xdf
ATtinyX5.menu.clock.internal8.bootloader.extended_fuses=0xfe
ATtinyX5.menu.clock.internal8.build.f_cpu=8000000L

ATtinyX5.menu.clock.internal16=Internal 16 MHz
ATtinyX5.menu.clock.internal16.bootloader.low_fuses=0xf1
ATtinyX5.menu.clock.internal16.bootloader.high_fuses=0xdf
ATtinyX5.menu.clock.internal16.bootloader.extended_fuses=0xfe
ATtinyX5.menu.clock.internal16.build.f_cpu=16000000L

ATtinyX5.menu.clock.external8=External 8 MHz
ATtinyX5.menu.clock.external8.bootloader.low_fuses=0xfe
ATtinyX5.menu.clock.external8.bootloader.high_fuses=0xdf
ATtinyX5.menu.clock.external8.bootloader.extended_fuses=0xfe
ATtinyX5.menu.clock.external8.build.f_cpu=8000000L

ATtinyX5.menu.clock.external16=External 16 MHz
ATtinyX5.menu.clock.external16.bootloader.low_fuses=0xfe
ATtinyX5.menu.clock.external16.bootloader.high_fuses=0xdf
ATtinyX5.menu.clock.external16.bootloader.extended_fuses=0xfe
ATtinyX5.menu.clock.external16.build.f_cpu=16000000L

ATtinyX5.menu.clock.external20=External 20 MHz
ATtinyX5.menu.clock.external20.bootloader.low_fuses=0xfe
ATtinyX5.menu.clock.external20.bootloader.high_fuses=0xdf
ATtinyX5.menu.clock.external20.bootloader.extended_fuses=0xfe
ATtinyX5.menu.clock.external20.build.f_cpu=20000000L

################################################################################

ATtinyX4.name=ATtiny24/44/84
ATtinyX4.bootloader.tool=arduino:avrdude
ATtinyX4.bootloader.file=optiboot/optiboot_attiny84.hex
ATtinyX4.bootloader.unlock_bits=0xff
ATtinyX4.bootloader.lock_bits=0xff
ATtinyX4.build.core=arduino:arduino
ATtinyX4.build.board=attiny
ATtinyX4.upload.tool=arduino:avrdude

ATtinyX4.menu.cpu.attiny24=ATtiny24
ATtinyX4.menu.cpu.attiny24.upload.maximum_size=1472
ATtinyX4.menu.cpu.attiny24.upload.maximum_data_size=128
ATtinyX4.menu.cpu.attiny24.build.mcu=attiny24
ATtinyX4.menu.cpu.attiny24.build.variant=tiny14

ATtinyX4.menu.cpu.attiny44=ATtiny44
ATtinyX4.menu.cpu.attiny44.upload.maximum_size=3520
ATtinyX4.menu.cpu.attiny44.upload.maximum_data_size=256
ATtinyX4.menu.cpu.attiny44.build.mcu=attiny44
ATtinyX4.menu.cpu.attiny44.build.variant=tiny14

ATtinyX4.menu.cpu.attiny84=ATtiny84
ATtinyX4.menu.cpu.attiny84.upload.maximum_size=7616
ATtinyX4.menu.cpu.attiny84.upload.maximum_data_size=512
ATtinyX4.menu.cpu.attiny84.build.mcu=attiny84
ATtinyX4.menu.cpu.attiny84.build.variant=tiny14

ATtinyX4.menu.clock.internal1=Internal 1 MHz
ATtinyX4.menu.clock.internal1.bootloader.low_fuses=0x62
ATtinyX4.menu.clock.internal1.bootloader.high_fuses=0xdf
ATtinyX4.menu.clock.internal1.bootloader.extended_fuses=0xfe
ATtinyX4.menu.clock.internal1.build.f_cpu=1000000L

ATtinyX4.menu.clock.internal8=Internal 8 MHz
ATtinyX4.menu.clock.internal8.bootloader.low_fuses=0xe2
ATtinyX4.menu.clock.internal8.bootloader.high_fuses=0xdf
ATtinyX4.menu.clock.internal8.bootloader.extended_fuses=0xfe
ATtinyX4.menu.clock.internal8.build.f_cpu=8000000L

ATtinyX4.menu.clock.external8=External 8 MHz
ATtinyX4.menu.clock.external8.bootloader.low_fuses=0xfe
ATtinyX4.menu.clock.external8.bootloader.high_fuses=0xdf
ATtinyX4.menu.clock.external8.bootloader.extended_fuses=0xfe
ATtinyX4.menu.clock.external8.build.f_cpu=8000000L

ATtinyX4.menu.clock.external16=External 16 MHz
ATtinyX4.menu.clock.external16.bootloader.low_fuses=0xfe
ATtinyX4.menu.clock.external16.bootloader.high_fuses=0xdf
ATtinyX4.menu.clock.external16.bootloader.extended_fuses=0xfe
ATtinyX4.menu.clock.external16.build.f_cpu=16000000L

ATtinyX4.menu.clock.external20=External 20 MHz
ATtinyX4.menu.clock.external20.bootloader.low_fuses=0xfe
ATtinyX4.menu.clock.external20.bootloader.high_fuses=0xdf
ATtinyX4.menu.clock.external20.bootloader.extended_fuses=0xfe
ATtinyX4.menu.clock.external20.build.f_cpu=20000000L

platform.txt

Arduino
Version 1.0.2
name=ATtiny Microcontrollers

tools.avrdude.path={runtime.tools.avrdude.path}
tools.avrdude.erase.params.verbose=-v -v -v -v
tools.avrdude.erase.params.quiet=-q -q
tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m

tools.avrdude.bootloader.params.verbose=-v -v -v -v
tools.avrdude.bootloader.params.quiet=-q -q
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i"

Blinking LED Code

Arduino
// ***
// *** Specifies the pin on which the LED is connected.
// ***
#define LED_PIN 4

// ***
// *** Specifies the amount of time (in milliseconds)
// *** to pause between truning the LED on and off.
// ***
#define DELAY_TIME 1000

// ***
// *** The setup function runs once when you press
// *** reset or power the board.
// ***
void setup() 
{
  // ***
  // *** Initialize the digital pin for output.
  // ***
  pinMode(LED_PIN, OUTPUT);
}

// ***
// *** The loop function runs over 
// *** and over again forever.
// ***
void loop()
{
  // ***
  // *** Turn the LED ON. Since we have connected
  // *** the LED to the 3.3v pin we must set our
  // *** GPIO pin to LOW to light the LED.
  // ***
  digitalWrite(LED_PIN, LOW);
  
  // ***
  // *** Pause
  // ***
  delay(DELAY_TIME);
  
  // ***
  // *** Turn the LED off. Since we have connected
  // *** the LED to the 3.3v pin we must set our
  // *** GPIO pin to HIGH to turn the LED off.
  // ***
  digitalWrite(LED_PIN, HIGH);
  
  // ***
  // *** Pause
  // ***
  delay(DELAY_TIME);
}

TCWORLD/ATTinyCore

Credits

Daniel Porrey

Daniel Porrey

50 projects • 318 followers
I am a developer and creator. As an Amazon Associate I earn from qualifying purchases.

Comments