Unable to write to the atmega16A
language? Maybe include the initialization steps of your code for the
AVR to show how you've set it up.
Problems like this have happened to me two different ways:
1. If you slow down the AVR clock via the programming fuses, it may be necessary to configure the programmer for a slower speed. Check all of the speed settings for your programmer.
2. Less likely, but I once had an AVR design with a SPI bus that I was programming with ISP. These use the same pins. Programming the application "broke" the ISP programming. To solve the problem, I put a delay in the application to not init and use the SPI bus for a few seconds after reset. This gave time for reprogramming immediately after reset.