I've made a parallel port programmer (with HCT14 as interface) and a simple C source to programm the Atmel's S52, ISP.
My baby-steps were (software only):
- send "programming enable" and check for 0x69.
- get signature byte 0, 1 and 2.
- erase chip
- read lock bits
- read flash memory
Up to this point, step 2 always returned expected data.
Then I've added code to write the flash memory, but the code was wrong, it didn't wait enough time between byte writes.
From then on, step 2 started returning invalid data. At first, instead of 1E, 52, 06, it returned 1F, 53, 07 (bit 0 was always set).
I didn't know why this was happening, and continued writing to flash memory with code that works too fast.
Finally, the signature I now read is all FF.
I still get 0x69 for step 1.
I've changed the write_flash prog to consume more time between byte writes, and it works now, since I can read back the contents as written.
Read/write lock bits works fine.
Only the device signature is broken.
Anyone had a similiar problem? How is it possible that a device signature got erased somehow?
And NO, I didn't yet executed any code on the chip, but reading the flash memory shows the expected data.