Hello,
I am attempting to upload my code onto an attiny85 chip, while using arduino as ISP programmer.
The code uploads fine, but the cpu speed is wrong. I have set the fuses on the attiny to run at 8Mhz internal (no divider) and uploaded this simple sketch
void setup()
{
pinMode(PB4, OUTPUT);
while(true)
{
digitalWrite(PB4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(PB4, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
}
It blinks, but too slow, instead of 1 second blinks, i get 2s light on and 2s light off. If i upload this same code through Arduino IDE, it works correctly.
This is my platformio.ini config
[env:attiny85]
platform = atmelavr
framework = arduino
board = attiny85
board_build.f_cpu = 8000000L
upload_protocol = stk500v1
; each flag in a new line
upload_flags =
-P$UPLOAD_PORT
-b$UPLOAD_SPEED
; edit these lines
upload_port = COM9
upload_speed = 19200
it appears as if the board_build.f_cpu parameter has no effect at all, even if i change it to 1000000L, the speed of the blinks doesn’t change at all.