I have a number of units of a custom board with an ATMega32C1. For some reason a number of them will not accept programming. When reading the device signature I am reading only zeros. I am using an AVRISP mkII with Atmel Studio 6.
Checked the supply voltage around and during a device signature read with an oscilloscope and it is stable and nice at 3.3V.
Checked with the oscilloscope the reset, MISO, MISO and SCK and all of them toggle between 0 and 3.3V during a device signature read.
Looked at the solderings which are done in a professional factory and they do look perfect.
Checked that no components are missing and all components connected to the AVR are correctly oriented.
Loads of capacitance on the board and one 100nF next to the supply pin.
There is one signal used by the ISP that is shared with other functions on the board, it is the MOSI that goes trough a 4.7k resistor to the gate of a MOSFET.
The reset has a 10k pull-up and 100nF to ground.
I have not performed enough probing on the ISP signals to understand what they should look like and how they look when something i wrong, but since my signals are switching nicely between 0 and 3.3V, there should not be anything disturbing the programming or in my initial case, device signature read.
The boards that do work always works and the boards that do not work, never work. I haven´t been able to fix any of the non working boards or made any of the working ones go into "non-working-mode".
I use QFN version of the chip.
What could be the reasons for the AVR not accepting programming and what would I do to find out which reason there is that my AVRs are not accepting it? I am a bit desperate as I have no clue on where I continue to find the problem. Any help is appreciated.