Hi I have the good old arduino-isp (an arduino nano set up to be a programmer).
Now I am trying to get it to work with PlatformIO (and I am almost there after 2 hours)
First of all I want to complain a bit, because the documentation for that is hard to find and the PlatformIO does not ask my about uploading and is not suggesting anything in the platform.ini
This does not explain it: Generic ATtiny44 — PlatformIO latest documentation
here it is explained, however, it is so ugly: Atmel AVR — PlatformIO v6.1 documentation
it uses a custom command instead of “stk500v1”
I found that you can instead do it like this:
(but the flags part is vital)
Now what happens is that it is indeed finding the programmer on my COM and the atTiny, it is writing and verifying and finishing normally!!! Yes there is no error!
But then the AtTiny doesn’t do anything It has an LED on Pin9 and it is supposed to be blinking.
The exactsame code works with the clonky ArduinoIDE (but since you will ask for it anyways, I attached the code
Maybe the problem is related to that part of avrdudes output
avrdude: safemode: Fuses OK (E:FF, H:DF, L:62)
I have no clue what the fuses do, but avrdude brings no such things when using ArduinoIDE (also safemode…?)
thanks if you could help meeeee
Hi, thank you very much for your answer!!
I was messing around with the pins, it turns out something called “alternative pin mapping” is something that exists. Using pin 1 instead of pin 9 does work!
In your reply it sounds to me a bit like I am using a weired/uncommon config. Is there a way to make it work as it is in ArduinoIDE? Is there a switch?
This is on my wall and I have crossed out, what is labeled “alternative pinout” at the bottom. Because using the ArduinoIDE “always” was the non-alternative pinout (i was using 1.8.13) and I got confused once.
But, of the Arduino IDE, not ATTinyCore. There’s no 1.8.13 version of the ATTiny core, it jumps from 1.5.2 to 2.0.0-dev. You’d have to look into the Tools → Boards → Board Manager menu to find out what version you’re using.
Very likely you’re using 2.0.0-dev as the core, since if you say D9 worked in the Arduino IDE, that is “PB1”.
But in the previous 1.5.2 version, “PB1” can be found as pin “D1” as linked here.
If you want PlatformIO to use the 2.0.0-dev core also, you need to add
platform_packages =
maxgerhardt/framework-arduino-avr-attiny@2.0.0-dev
; tinyx4 doesn't exist anymore, is now "tinyx4_legacy".
; use new pin mapping instead.
board_build.variant = tinyx4_cw
to your platformio.ini. That’s the “switch” you’re looking for. Then, your original code should work just fine.
oh, i forgot that attiny had to be installed (And didn’t find its version) yeah it turns out that I have version 1.0.2 from David A. Mellis (attiny)
so I think I rather will stick to the new stuff.