platformio / platform-atmelmegaavr

Atmel megaAVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelmegaavr
Apache License 2.0
29 stars 22 forks source link

Garbled serial output from ATtiny1616 when using Platformio IDE, OK on Arduino IDE #22

Closed ArnieO closed 2 years ago

ArnieO commented 3 years ago

Code in PlatformIO IDE:

#include <Arduino.h>
void setup() {
  Serial.swap(1);       // Switch to alternate serial port.
  Serial.begin(115200);
  while (!Serial);
}
void loop() {
  Serial.println("Hello world!");
  delay(1000);
}

platformio.ini:

[env:ATtiny1616]
platform = atmelmegaavr
board = ATtiny1616
framework = arduino
upload_port = COM24
monitor_port = COM10
monitor_speed = 115200

In both cases I program via UPDI / jtag2updi.

Any advise on what is going on here would be highly appreciated, as I prefer working in PlatformIO IDE.

MCUdude commented 2 years ago

Issue can probably be closed. It turned out to be an incorrect oscillator setting. The fuses.py script would have solved this