Upload to Attiny85

Hi everybody,

I’d love to be able to use platform.io to push code to an Attiny85, but I’m having a hard time finding out if/how this works.

I discovered some very basic documentation in the docs:
http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer

And using some of the bits and pieces I found in the examples I tried this in many different variants, but it always fails for some other reasons (e.g. Arduino.h not being available)

[env:attiny]
platform = atmelavr
board_mcu = attiny85
board_f_cpu = 1000000L
upload_protocol = arduino
upload_speed = 19200

Did somebody successfully use Attiny85s with platform.io?

Thank you,
Fabrizio

Hi,

Try Upload using Programmer with

[env:attiny]
platform = atmelavr
board_mcu = attiny85
board_f_cpu = 1000000L
upload_protocol = usbtiny

Hi,

I have successfully used Attiny85 and also Attiny13 with platformio.
It’s essential to have set programmer - I’ve used both an arduinoISP as well as an usbtiny programmer successfully.
Just for your info - it’s possible :slight_smile:

Does the hint of ivankravets help you?
If not I could search for my project & configuration.

I managed to upload code now. Thank you for your replies, but there’s still a problem:

If I DON’T add framework = arduino I get this error message:

fatal error: Arduino.h: No such file or directory

since I’m using the Arduino stuff in my program (pinMode,…)

But when I add framework = arduino I get this error message:

Error: This board doesn't support arduino framework!

So what I did was I also added board = gemma since this supports the Arduino framework. I picked Gemma since it also runs an Attiny85, but not sure if this matters and If there’s a better way of doing this.

So this is my working configuriation that allows me to Upload via Programmer:

[env:attiny]
platform = atmelavr
framework = arduino
board = gemma
board_mcu = attiny85
board_f_cpu = 1000000L
upload_protocol = usbtiny

Should I pick a different board? Or is this a good-enough workaround?

Arduino framework requires board ID and settings. In this case you receive Error: This board doesn't support arduino framework!.

Nevertheless, the hook with board = gemma is right solution. In this case, the config can be simplified to

[env:attiny]
platform = atmelavr
framework = arduino
board = gemma
board_f_cpu = 1000000L

because gemma board has pre-configured settings for uploading and etc. See https://github.com/platformio/platformio/blob/develop/platformio/boards/adafruit.json#L58

1 Like