PlatformIO Community

Attiny44 with arduino as isp doesnt work

Hello, i’m trying to program my a simple blink sketch to attiny44 with platformio. When i program it, it shows success, but LED doesnt blink. It works fine with arduino IDE, so my wiring is correct.
My platformio.ini:

[env:attiny44]
platform = atmelavr
framework = arduino
upload_protocol = stk500v1
; each flag in a new line
upload_flags =
-P$UPLOAD_PORT
-b$UPLOAD_SPEED

; edit these lines
upload_port = COM4
upload_speed = 19200
board = attiny44

Does someone know what’s wrong?

What exact settings do you have in the Arduino IDE, especially regarding the Fuses for crystal settings?

I don’t know about fuses, i just installed attiny support in board manager and selected attiny44, 1MHz internal clock

board = attiny44 uses 8MHz clock by default

It leaves the fuses the same however. Could you just try to go into the arduino IDE and set it to 8MHz internal, burn that program, see if it still works, and if yes, re-upload the PlatformIO program. Maybe your chip then has the right fuses.

Otherwise you’ll have to change your platformio.ini to change the frequency to 1MHz and use an extra_script to burn the fuses for 1MHz (the low-fuse is here). Custom fuses are explained here.

i uploaded the code in arduino IDE with 8mhz clock, and the LED flashing slowed down a lot.
Then, i tried to upload the pio program, but nothing happened.

I noticed when the pio program was uploading, it said

avrdude: safemode: Fuses OK (E:FF, H:DF, L:62)

you said i should burn the program with 8mhz setting. I’m not sure if you meant uploading or something else.

This is indeed the correct setting for 8MHz internal (along other stuff)

(from http://www.engbedded.com/fusecalc/)

I’m not really sure why the firmware doesn’t boot when uploaded with PIO…

Pressing / pulsing the ATTiny reset pin also doesn’t help?

Also can you post the code you’re running for full reproduction.

I tried pulsing the reset pin, doesnt seem to do anything.
I also tried to chenge the settings in arduino IDE to 8mhz and burn the bootloader.
Now it doesnt slow down the blinking when uploaded in 8mhz setting, but PIO still doesnt work.

my code:

#include <Arduino.h>
void setup() {
pinMode(0, OUTPUT);
}
void loop() {
digitalWrite(0, HIGH);
delay(1000);
digitalWrite(0, LOW);
delay(500);
}

my platformio.ini:

[env:attiny44]
platform = atmelavr
framework = arduino
upload_protocol = stk500v1
; each flag in a new line
upload_flags =
-P$UPLOAD_PORT
-b$UPLOAD_SPEED
; edit these lines
upload_port = COM4
upload_speed = 19200
board = attiny44

Could you give a schematic / drawing / picture of your hardware setup for reproduction? I have an ATTiny44 and will try to reproduce.

schematic:


arduino nano has the arduino as isp code from examples

What board support package are you using on the Arduino IDE? If you’re not using ATTinyCore, it’s possible that pin 0 on Arduino is pin 10 on PlatformIO…

It appears board_build.variant=tinyX4_reverse should trigger the ‘alternate / like older David Mellis core’ behaviour.

It works witp pin 10. Thanks for the help

1 Like