In words, after the upload the Reset and RxD are both declared as output and the reset is also put to high.
The behaviour after the upload is a fast blinking D13 Builtin LED and the upload is not possible any longer.
I tried to alter the code in a way that it would ignore the before mentioned pins and everything works fine.
I have now two questions:
How do I recover the two boards which are flashed with the faulty code. I do have the Atmel Ice programmer if that is of any help. Though it uses also the resetline
Can someone explain the fast blinking LED? I don't touch that pin in my code. I think it flashes with 10 Hz. It must be the bootloader who turns it on and it goes off when the faulty program causes a reset.
I really would like to see a flowchart of the upload process, if anyone could guide me to that, that'd make me happy.
The High Voltage programmer is more expensive than the two boards, so I put them in the bin.
In the meantime, I found the flowchart and all the Info I longed for. The Bootloader flashes the LED right after the HW Reset occurs, and my program does a reset and the boot loader flashes again, all in all periodically.
Building my own HV programmer looks is something very useful when working on AVR chips. It might come back to bite me if I don't do it now.
I would have to alter it as I am not using Atmega328 with Dip pins. Instead I could put a socket for Nano board. I checked, all the required pins are accessible on the Nano board.