I'm designing a programmer for my 16F88 and I almost have the engine complete. I'm running into one bizarre issue that I can't seem to trace down. I'm hoping for some troubleshooting advice.
The programming spec says to write a 14-bit word by cycling the clock
16 times and latching the word onto the 2nd through 15th cycle. Likewise, reading a 14-bit word involves cycling the clock 16 times and reading the 2nd through 15th bits. The 1st and 16th bits are always pads. I've noticed that my PIC always uses 1's to pad the 14-bit word during a read command.My issue arises when the MSB of my 14-bit word is not a "1". When I try to read a word whose MSB is "0", the PIC doesn't throw a "1" as the
16th bit and then fails to read any more addresses. If I attempt to increment and read beyond that troublesome word, it always returns 0x3FFF.For example, if my 14-bit word is b00000000000001, then the PIC returns the 16-bit value of b1000000000000011 and everything is great (I just grab the 14-bits between the padded 1's). However, if my word is b00000000000010, the PIC returns b1000000000000100 and everything fails after that (it didn't throw the last "1" as the 16th bit).
I confirmed my write procedure is correct by incrementing past the troublesome word and continuing to read. In other words, all the data is being written, it's just not being read correct.
I'd appreciate any toubleshooting advice. This problem has been perplexing me for a while now.
Thanks!
-Dan