I use atmel ice programmer and Atmel Studio.
I designed a new board which use Atmega2560.Everything was ok.I compile program with arduino IDE and copy hex file and paste it memories tab that located in atmel studio.
Finally i load the program to the my circuit.The circuit is working but it works very slowly.For example the buzzer would be high for 1 second but it loud for 8-10 seconds.
my fuses and lock bits;
Lock bit 0xFC
CKSEL 8.0mhz 16k+65ms
First programming everything is ok(but slow).But when i try it second time it gives a fault(Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool))
I choose in device programming )atmel-ice,Atmega2560,ISP and apply it.It seems ISP clock 125khz.
And i press read button and it gives same error.It doesnt recognize my microprocessor.
I remove my chip and put new one.When i program it first time everything is ok(but still slow working).Then i try second time it gives same error like disposable chip:))Just one programming.
What is the problem?
P.s: my crystal is 16 mhz and ground capacitors are 18 pf.And everything is correctly connection.Anyway i can program it for 1 time otherwise i think i would never programm it if i have a connection fail.