I use arduino boards, but program them in C in AS7.
Very simple code
// debug led on D13 (PB5)
DDRB |= _BV(5);
It turnon on led on PB5 ports (D13 on arduino nano), whait a little and turns it off.
So, when the board is turned on i should see just one blink. However, when i plug into into a PC i see it blink from 8 to 11 times!
When i plug it into just USB charger - just one blink.
I looked at the reset line on o-scope and really see it go down multiple times when connected to PC.
As i understand it goes down when PC serial port asserts DTR signal which is connected to RESET. One reset is ok, but 11??
Is there any explanation why Windows asserts DTR so many times? Or maybe not windows or something else.
I looked into this problem because this crazy line of resets also erases my RTC clock on every USB connect. But that's another story.