I had designed a clock with pic16f628a and it was working well. Recently i realised that the clock was not working and after some tested i found out that although i had programmed the pic it had only zero in its program memory. When i program it i still read the zero values only. My programmer is not able to write to its program memory. I want to know if there is a way to recover my pic or it is damaged.
Try programming another PIC with your programmer or use another programmer with the same same pic and cross check. Usually microcontrollers rarely fail. If fails, it may be due to some mishandling by excess voltages fed, or when the oscillator fails.
Cheers
If it reads as zeros then most likely the code protect bit was set. There was a glitch in Microchip PIC series that I reported a few years ago. the problem was that when the internal oscillator was used, the pic locked itself and was rendered useless. the solution was to quickly switch on and off the Power to the PIC when it was being erased. If you have access to a PIC KIT2 there is a mode called use VPP first program entry. this can help you erase the part.