If the crystal is oscillating at 16MHz and you’ve double checked that there are no shorts or opens, then I would check the wiring of the programmer and make sure that the power to the 32U4 is correct and stable while you’re attempting to program it.
Next, you would have to look at the signals while programming.
But i checked the soldering again, i even started another new board starting with the crystal making sure no short, then the 32u4 and then only the capacitors. I left out the reset button and
the leds this time as they should not be needed i assume (the button is not used and visual indication i do not need for now).
This time i get this:
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
No “ff” anymore but also nothing else… I do not understand what should be wrong here… I have just a view parts soldered… I think i will have to let the dream go. Would have been cool but i seem to be not able to do it. And as i am too unexperienced i cannot even say what could be wrong I have set up an atmega1284p in the past from scratch but with “normal components” and that worked without issues. Maybe i need to solder cables onto the components and do not use a PCB at all…
Check the power on the uC , GND and VCC, ll need to be wired, check again shorts between programming pins, check again the continuity of the programming pins between header and uC.
The uC report to the programmer that has entered in programming mode but does not report the signature, one or the pins are in short with another usually MISO with SCK somewhere, the signature mismatch can be from under powering the uC ( powering the uC from MOSI, SCK and RESET pins ), check again the programming connections.
Check if the vias on the board are manufactured correctly.
As a life lesson for me on the old Atmega uC’s batch you can short the outputs how long you want to VCC or GND does not pop ( do not draw more than 200mA on the power pins ), never drive them more than 0.5-0.7V above VCC or below GND, this is the reason that I search the old batch of Atmega, the new ones with U suffix ( Microchip ones ) are made on another process and I do not experiment to much with them, they pop more frequently they are more sensitive.
The old batch was so reliable that I found them inside the Xray guns in medical applications ( Atmega128 )
How do you know the uC has entered programming mode? The programmer may be sending the “Programming Enable” command without reading and checking the 0x53 that is echoed back during the third sent byte. The programmer may just go on to doing the “Read Signature Byte” commands and using them as an indication that program mode has been entered.
If the programmer actually is looking for the 0x53 reply, and not proceeding without it, then there can’t be any problems with power or any of the signals, or the programmer wouldn’t have received the 0x53 and wouldn’t move on to reading the signature without it.
I would hope that any programmer worth its salt would realise this possibility and (at least initially) run below this speed.
Without any other components on the board, either 3.3V or 5V should be fine. 5V may be a better choice.
In practice there can be issues in the power side, a short somewhere, or the programmer SPI frequency to be to high, need to be around 500Khz for a uC clock of 2Mhz I believe. normally F uC/2 but if the F is a little bit under 2Mhz there will be issues in the communication with uC, so best is F uC/4 for SPI frequency.
Can you tell us more about this “cheap” oscilloscope that you have? Even if it’s not fast enough to look at the 16MHz crystal frequency, it may be able to look at the programming signals. It could verify:
That the 32U4 is seeing the programmer toggle the reset line.
If a programming clock signal is being received on the 32U4 SCK pin.
If a proper signal is being received on the PDI (MOSI) pin.
If the 32U4 is sending a response on the PDO (MISO) pin.