# Programming Atmega8 with AVRISP mkII Error ispProgramMem

If I go to Tools > Device Programming in AVRStudio 6.0 to program the Atmega8 everything is working fine. I've set the ISP frequency to 1 MHz and checked the fuses as well.

But as I just hit F5, programming most of the times failes (sometimes it works for whatever reason) giving me an error message:

Error: ispProgramMem: Error status received: Got 0x80, expected 0x00

but unfortunately no further information.

The build output does not report any errors:

------ Build started: Project: Blink, Configuration: Debug AVR ------
Build started.
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!=''). Target "CoreBuild" in file "D:\Program Files (x86)\Atmel\Atmel Studio 6.0\Vs\Compiler.targets" from project "C:\Users\Stefan\Documents\Atmel Studio\Blink\Blink\Blink.cproj" (target "Build" depends on it): Task "RunCompilerTask" D:\Program Files (x86)\Atmel\Atmel Studio 6.0\make\make.exe all make: Nothing to be done for all'. Done executing task "RunCompilerTask". Task "RunOutputFileVerifyTask" Program Memory Usage : 128 bytes 1,6 % Full Data Memory Usage : 0 bytes 0,0 % Full Done executing task "RunOutputFileVerifyTask". Done building target "CoreBuild" in project "Blink.cproj". Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Done building target "Build" in project "Blink.cproj".

Build succeeded.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
`

Does anybody know what the problem might be?

• If the chip was using an external oscillator previously and now you are trying to reprogram it without that oscillator - it will not work - put that oscillator back. Check the power lines/connections. Do you have anything connected to the pins that are used for programming? – Nazar May 5 '15 at 12:30