I have designed a custom board using atmega32u4 with a few other components (Such as RTC, memory and etc) but left them empty to test if the microcontroller can be programmed. After just hand soldering the microcontroller and the necessary capacitors and resistors, ATMEL Studio can't read device signature.I'm using AVRISP MKII. This board was inspired by ARDUINO ProMicro in design. The things I tried to solve it:
Measure all 3.3 volt supply lines and all of the grounds. (They all correspond with PCB and schematic)
Checked SPI lines to see if microcontroller receives commands from the programmer by using oscilloscope.
I tried removing the 16MHZ crystal, still the same.
I reflowed the microcontroller since it is a QFN type (atmega32-MU package) and I have a few via holes under the micro for flux to come out.
I have properly washed the board after reflow.
I have AREF grounded with a 0.1uF capacitor and !HWB pin (PE7) is left empty. I didn't ground it.
I tested the programmer with an actual promicro board and it programs fine.
I think I'm missing something but I don't know what... I'd be grateful if you guys could help me. Attached is the schematic of the circuit.
The micro controller RESET is indicated by MICRO RST on pin 13. That RESET on PB4 is for another device which is not populated yet and left empty, I checked Pin 13 with Oscilloscope and it seemed working fine and going to zero at the first moment of programming. Also MISO and MOSI and SCK were sending signals to the relevant pins. Thanks
So, I realized the problem after almost a month! I had removed the 16MHz crystal from the circuit and this caused the problem with programming. Now, after placing the crystal the program is successfully uploaded to the ATMEGA32U4.