Hi,
But how can the "debug pin" D20 be switched before setup? That cannot be at all.This is not logical for me. What has a constructor to do with the program execution? Decisive is the call and not the building. Not that you misunderstand me. I'm not interested in the logic levels of the SPI pins wobbling. That's not my point either. The point is that setup is called incomplete several times before the final reset. Because data are already transferred before what one does not see in the terminal.
To me it looks like the ATmega4809 is reset several times before it is allowed to real start. D20 switches already but it doesn't get to the serial yet.
If I add a 5s delay directly at the beginning of setup(), everything works as expected. After the long pause for the flash/verify there is only one D20 toggle sequence and in the IDE terminal I see the old and then the new values.
So it really looks like the controller is reset multiple times and only the first lines of code in setup that are processed fast enough can be processed until the next reset. Serial.begin() seems to take too long for this.
If you know that, you can help yourself if this is important. I was just surprised by it.
