Skip to content

Instantly share code, notes, and snippets.

@stonehippo
Last active July 4, 2019 18:33
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 stonehippo/96f8b47b87de1b3472e6bcd636369c57 to your computer and use it in GitHub Desktop.
Save stonehippo/96f8b47b87de1b3472e6bcd636369c57 to your computer and use it in GitHub Desktop.
Custom PlatformIO board definition for ATTiny85

Custom PlatformIO ATTiny85 Board Definition

This PlatformIO custom board definition was created to include a default set of fuse values for the ATTiny85. It's derived from the standard ATTiny85 board definition. It originally came from troubleshooting some issues with setting fuses on Atmel AVR targets in PlatformIO.

The reason I created this board definition was to be able to use the pio run -t fuses command at default to set an ATTiny85 to run at 8mHz (rather than the default of 1mHz). This is helpful, because I've got a bunch of bare chips (rather than an breakout or dev board like the Adafruit Trinket).

The fuse settings are:

fuse value
low 0xE2
high 0xDF
extended 0xFF

The default low fuse setting (0x62) enable clock division by 8. The setting the low fuse to 0xE2 disables that setting. You can inspect AVR fuse values at http://www.engbedded.com/fusecalc.

I also have some info on AVRDUDE and setting fuses on Atmel AVRs.

{
"build": {
"core": "tiny",
"extra_flags": "-DARDUINO_AVR_ATTINYX5",
"f_cpu": "8000000L",
"mcu": "attiny85",
"variant": "tinyX5"
},
"frameworks": [
"arduino"
],
"fuses": {
"efuse": "0xFF",
"hfuse": "0xDF",
"lfuse": "0xE2",
"lock": ""
},
"name": "Tickle ATtiny85 Custom Board Definition",
"upload": {
"extra_flags": "-e",
"maximum_ram_size": 512,
"maximum_size": 8192,
"protocol": "usbtiny"
},
"url": "http://www.atmel.com/devices/ATTINY85.aspx",
"vendor": "Atmel"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment